Kouki
Posts: 5
Joined: Sat Mar 24, 2018 12:00 pm

List of installed features

Sat Mar 24, 2018 12:07 pm

In my C#-project i want to enable the user to add/remove features.
With the addition and removal I figured out:

Code: Select all

msiexec /i test.msi ADDLOCAL=FeatureToInstall REMOVE=FeatureToRemove
But how to display a list of features of application and determine which ones are installed?

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: List of installed features

Mon Mar 26, 2018 11:41 am

Hello and welcome to our forums,

If you want to programatically access your product list of features and check which one are installed, then you can try to use the Windows Installer C++ functions like "MsiEnumFeatures" and "MsiGetFeatureInfo".

Let us know if this helped, otherwise please give us more details about your requirements.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Kouki
Posts: 5
Joined: Sat Mar 24, 2018 12:00 pm

Re: List of installed features

Wed Mar 28, 2018 4:36 am

Thank you. I solved the problem by using the system registry. I added my own key for each features.
But there was another problem with installer. I want to organize the following scenario:
1. There is a periodically updated installer on the server.
2. In my program, I refer to it to add/remove/reinstall features.
3. When contacting installer:
3.1. If installer version is the same as the user's, then the maintenance mode should be started and the features could be managed.
3.2. If installer version is different, the program is reinstalled.
The problem in paragraph 3.1. It works only if the installer on the server is exactly the same as that installed by the user. If I just rebuild it (even without changing the version), then when I refer it, an error occurs:

Code: Select all

Another version of this product is already installed

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: List of installed features

Wed Mar 28, 2018 3:32 pm

Hello,

This is the default Windows Installer design. When you rebuild a setup project whose output you have already released, then it is mandatory to change the ProductVersion, otherwise Windows Installer will detect this is a different flavor of the already released product setup.

So, after you release the product setup of a certain ProductVersion you should make sure you no longer rebuild any other setup for the same ProductVersion.

If you have any questions or doubts just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Kouki
Posts: 5
Joined: Sat Mar 24, 2018 12:00 pm

Re: List of installed features

Thu Mar 29, 2018 4:42 am

Ie, in order for my scenario to work, should I change the installer version for any change of any features?
Maybe there is a better way to allow the user to add/update /delete functions, without having to reinstall the entire program?

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: List of installed features

Thu Mar 29, 2018 3:09 pm

Hello,
Ie, in order for my scenario to work, should I change the installer version for any change of any features?
Yes, this is mandatory.
Maybe there is a better way to allow the user to add/update /delete functions, without having to reinstall the entire program?
This can be done by creating patches. A patch is Windows Installer setup package (MSP) which incorporates only the diff between two different versions (patch compatible created) of your product.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Kouki
Posts: 5
Joined: Sat Mar 24, 2018 12:00 pm

Re: List of installed features

Fri Mar 30, 2018 4:45 am

Did not quite understand how to use patches in my case? Can you explain a little?
Let me explain. My installer consists of 4 features (each with its own exe). Also I have an application (attachment) that displays these features and allows them to manage (install, update, delete).
Let's assume the following situation:
1. The user has installed version 1.0.
2. I changed 1 feature and released version 1.1.
3. How can a user update this feature specifically (by clicking the Update button in the application) without reinstalling everything? Obviously, the REINSTALL attribute does not work, since the user can not start the new installer because of different versions.
Attachments
Application.jpg
Application.jpg (74.09KiB)Viewed 5447 times

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: List of installed features

Mon Apr 02, 2018 2:34 pm

Hello,

Basically you should rebuild a new setup project version (increase ProductVersion to 1.1 and keep the same ProductCode) which will include the new app resources for the related feature.

Then you should create a patch between the MSI packages of your v1.1 and v1.0 setups. Just follow our patch creation user guide steps to build an MSP patch. After the patch is built you can deliver it to the client machines where v.10 setup package is already installed.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Kouki
Posts: 5
Joined: Sat Mar 24, 2018 12:00 pm

Re: List of installed features

Thu Apr 05, 2018 5:56 pm

Well, then the last question.
I noticed that when user installs the program, installer partially caches it in the folder "windows/installer". Is it possible to do so, that would be completely cached installer? Because now the user can not manage (add/delete) the installed features if there is no access to the installer from which it is installed.

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: List of installed features

Wed Apr 11, 2018 3:35 pm

Hello,

I apologize for my delayed reply. We had two days off after the last weekend and now we are a bit busy.

Unfortunately this is not possible. The only solution for this case will be to build an EXE setup package and enable the "Do not delete extracted MSI and CAB files" option from "Builds" page -> "Configuration" tab. Thus each time when the user runs a setup maintenance operation Windows Installer will access the installation resources from the original install location.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”