Install another MSI based on Feature install - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

FGump
Posts: 65
Joined: Thu Jan 05, 2006 7:23 pm

Install another MSI based on Feature install

I'm using advanced installer v7.7 and have everything working as I want except for one thing. I have my installation asking the user if they want to do a Typical install, Custom, or Complete. When selecting Typical, I do NOT install some files required for more advanced parts of my application to function (not all users need this). However, I DO install extra files if they select Custom (or Complete) and select to install that "feature". Now, I want to do is run a separate EXE setup package (it's not an MSI) if that specific feature was selected for installation. How do I go about including the EXE setup or the correct way to tell Advanced Installer to run that setup when those files for that "feature" are installed?

Any help would be greatly appreciated.

Thank you very much,

Frank

[UPDATE] The feature I have that needs to determine if the external EXE setup gets launched is called "TWAIN" in my setup. I saw that I can create a custom action of "New Attached Custom Action" and select this EXE setup. I can then enter an "Execution Condition". I entered "!TWAIN = Installed". "!TWAIN" got put in from selecting the "Feature State" (not sure I understand the difference between Feature Action and Feature State). And I selected "= Installed" from the "Property -> Installation Status". I would think that this means if the Feature TWAIN is installed, then run this EXE. Will this work? Also the path to the EXE shows to be on my C: drive and I can't change it. How does it get launched upon re-distribution? I can't seem to change it to be [SourcePath] and I can't see how to include it in my setup or tell it to look in my setup folder to find/launch it.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Install another MSI based on Feature install

Hello Frank,
I'm using advanced installer v7.7 and have everything working as I want except for one thing. I have my installation asking the user if they want to do a Typical install, Custom, or Complete. When selecting Typical, I do NOT install some files required for more advanced parts of my application to function (not all users need this). However, I DO install extra files if they select Custom (or Complete) and select to install that "feature". Now, I want to do is run a separate EXE setup package (it's not an MSI) if that specific feature was selected for installation. How do I go about including the EXE setup or the correct way to tell Advanced Installer to run that setup when those files for that "feature" are installed?
You can add your EXE setup file as a prerequisite with the feature based option selected. Afterwards, the prerequisite shows up in the "Organisation" menu page and you can place it inside the feature you need.
[UPDATE] The feature I have that needs to determine if the external EXE setup gets launched is called "TWAIN" in my setup. I saw that I can create a custom action of "New Attached Custom Action" and select this EXE setup. I can then enter an "Execution Condition". I entered "!TWAIN = Installed". "!TWAIN" got put in from selecting the "Feature State".And I selected "= Installed" from the "Property -> Installation Status". I would think that this means if the Feature TWAIN is installed, then run this EXE. Will this work? Also the path to the EXE shows to be on my C: drive and I can't change it. How does it get launched upon re-distribution? I can't seem to change it to be [SourcePath] and I can't see how to include it in my setup or tell it to look in my setup folder to find/launch it.
Using this type of custom action you can execute an application (EXE or DLL) or run a script (VB or Java script) which is not among your project files. This usually happens when this functionality is only useful in the installation process, but not for the installed application itself. You want this to be part among your project files at install time so this is not the case to use it.
not sure I understand the difference between Feature Action and Feature State
The difference between Feature State and Feature Action is that the first checks for the current state of the feature on the local machine (for example if a feature is already installed when the installation runs), as opposed to the second which tells the installer what action to take with the feature during the installation (for example if a feature will be installed or not).
I entered "!TWAIN = Installed"
Please note that this is not the correct way to negate a statement in Windows Installer. The "!" character has a different meaning, instead you can use "NOT":

Code: Select all

NOT Installed
To better understand conditioning and install states in Windows Installer, please read the "Edit Condition Dialog" user guide article.

Best regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
FGump
Posts: 65
Joined: Thu Jan 05, 2006 7:23 pm

Re: Install another MSI based on Feature install

Thanks for the prompt reply! I will try adding it in as a prerequisite and put it into the feature I have (that I called TWAIN). What type of prerequisite should I use? Currently I have 2 prerequisites - one that checks for a MySQL driver (searches for an existing file and installs if not found) and the other that is similar. In this case I'm not really wanting to see if something is installed, just include it in the install and, as you've mentioned, then actually execute it based on a feature selected/installed.

As for the !Twain, I did not put the ! in front of the feature name. It got placed there automatically when I chose that feature by clicking on the Feature State button. Feature Action puts a & in front of it (like &Twain). So, I wasn't trying to do a NOT statement (as one would in coding like != or <>).

Thanks again for your time,

Frank
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Install another MSI based on Feature install

Hello Frank,
In this case I'm not really wanting to see if something is installed, just include it in the install and, as you've mentioned, then actually execute it based on a feature selected/installed.
If you always need to run your EXE setup file depending only on the feature you selected, then I'm afraid you cannot use prerequisites.

Instead try using a new attached custom action under the InstallFinalize standard action for your EXE setup file.
The execute condition for this custom action should be:

Code: Select all

(NOT Installed) AND ((&Feature_id = 3) AND NOT (!Feature_id = 3))
Where "Feature_id" is the installed feature's identifier that you want to trigger your EXE file with.
You should also check the "Asynchronous execution, wait for return code at the end of the sequence" execution property for this custom action.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”