Execute file based on feature selection - 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!

Christian
Posts: 4
Joined: Thu Apr 30, 2009 5:49 pm

Execute file based on feature selection

I would like to create an install that is basically a wrapper for some files I would like to install on a target machine. Currently I'm using NSIS and it has been working quite well, however it is quite a pain to create the uninstaller portion in NSIS, in addition to some other minor problems I am encountering.

The installer has to be able to do the following:

1) Allow users to select the components he/she wants to install (should be easy enough)
2) Allows users to input an optional passphrase - entering a valid passphrase will make an additional component available to the user that he/she can choose to install
3) Ability to run another setup file (as mentioned earlier, my installer is just a wrapper) that is packaged with the installer, for it to install its own files. I understand that this can be done using the Custom Attached Action function as part of the actions carried out by the installer, but I need this to be one of the choices in the components, and not automatically installed when the installer is run.
4) Automatically creates an installer that can run the uninstaller for the setup file mentioned in 3) and also removes the other installed files selected by the user during installation

To illustrate:

Let's say I have 6 files in my installer. Each of these files are optional components - they can be selected or deselected by the user during the installation.

File 'A' is a setup file that installs a program 'X' on the user's computer.
File 'B' is a setup file that upgrades any version of program 'X' that might be already installed on the user's computer.
File 'C', 'D', 'E' are document files that can be viewed in program 'X'.
File 'F' is also a document file that can be viewed in program 'X'

When the user runs the installer, he should be given the option to enter a passphrase. If he enters a valid one, File 'F' is made available to him in addition to the other files. If he does not, only File 'A' to 'E' will be made available to him.

When selecting components to install, if File 'A' is selected, File 'B' will be deselected, and vice versa.

If file 'A' is selected, the installer will run File 'A' directly from the installer, to let it install its own files.

If File 'B' is selected, program 'X' on the user's computer is upgraded, also by running File 'B' directly from the installer.

If File 'C' to 'F' are selected, they are copied to the user specified directory on the user's computer (set by default to where Program 'X' might be installed)

The user may choose to "install" with the following possibilities:

1) Just run File 'A'
2) Just run File 'B'
3) Run File 'A' and copy one or more files from 'C' to 'F'
4) Run File 'B' and copy one or more files from 'C' to 'F'
5) User should also be able to just copy one or more files from 'C' to 'F' without running either File 'A' or File 'B'
6) No files selected (exits installer)

The uninstaller should allow any files 'C' to 'F' that were installed via my installer to be removed, and also able to run the uninstaller that was installed along with Program X (that was generated/installed by the File 'A' or File 'B' setup files)

Would all these be possible with Advanced Installer, and could anyone briefly describe how they could be achieved? I would also like to know if AI has support for skinned dialogs similar to the likes of InstallShield, InstallAware, and NSIS's ExperienceUI and UltraModernUI addons.

Many thanks.
Last edited by Christian on Thu Apr 30, 2009 6:22 pm, edited 1 time in total.
Christian
Posts: 4
Joined: Thu Apr 30, 2009 5:49 pm

Re: Execute file based on feature selection

(double post, sorry!)
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Execute file based on feature selection

Hi,

Please note that Advanced Installer was designed to create installation packages for applications, it was not designed as a wrapper over other installers.
1) Allow users to select the components he/she wants to install (should be easy enough)
This can be done by organizing the application into features and adding the "SetupTypeDlg" dialog in the "Dialogs" page (it will allow the user to select the features).
2) Allows users to input an optional passphrase - entering a valid passphrase will make an additional component available to the user that he/she can choose to install
To retrieve information from the user you can use a custom dialog. The User Guide contains a dialog tutorial which may help you. In your project you can use an edit box to retrieve the string. On the same dialog you can use a custom action on the "Next" button to determine if the string is correct or not. This custom action can set an installer property according to the validation result.

The result property can then be used by another custom action to condition the installation of a feature. This optional feature can be disabled by default in the "Organization" page.
3) Ability to run another setup file (as mentioned earlier, my installer is just a wrapper) that is packaged with the installer, for it to install its own files.
If your package requires other software to be installed, this software can be added as a prerequisite. Please note that the User Guide contains a prerequisite tutorial which may help you.
I understand that this can be done using the Custom Attached Action function as part of the actions carried out by the installer, but I need this to be one of the choices in the components, and not automatically installed when the installer is run.
If the optional installer is MSI-based, it cannot run during "InstallExecuteSequence" in the Custom Actions page. However, you can use an "UI Custom Action" to launch it when a button is pushed. In this case the optional installer can be added as a temporary file.
4) Automatically creates an installer that can run the uninstaller for the setup file mentioned in 3) and also removes the other installed files selected by the user during installation
When uninstalling a MSI package the resources installed by it are automatically uninstalled. However, if you want to also uninstall the optional package you can use a custom action. The User Guide contains a how-to which may help you.
I would also like to know if AI has support for skinned dialogs similar to the likes of InstallShield, InstallAware, and NSIS's ExperienceUI and UltraModernUI addons.
Currently this is not supported. However, this feature is on our TODO list and it will be available in a future version.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Christian
Posts: 4
Joined: Thu Apr 30, 2009 5:49 pm

Re: Execute file based on feature selection

Thanks for replying.
If your package requires other software to be installed, this software can be added as a prerequisite. Please note that the User Guide contains a prerequisite tutorial which may help you.

If the optional installer is MSI-based, it cannot run during "InstallExecuteSequence" in the Custom Actions page. However, you can use an "UI Custom Action" to launch it when a button is pushed. In this case the optional installer can be added as a temporary file.
The package will not "require" other software to be installed, however it will include such other software, which user can choose to install if they desire to do so.

Are button presses the only way I can achieve this function? My current installer allows both the setup/upgrade executables as well as the document files to be listed as components that the user can choose to install on the component list. Users only need to select what they want to install, and the installer will 1) run the executable to install, and/or 2) copy the document files as selected by the users from a single component selection screen.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Execute file based on feature selection

Hi,
The package will not "require" other software to be installed, however it will include such other software, which user can choose to install if they desire to do so.
Please note that the user can choose which prerequisites will be installed. They are not mandatory.
Are button presses the only way I can achieve this function?
No, there are multiple solutions (including the prerequisites feature). However, for launching other MSI packages the recommended approaches are prerequisites and chained packages, or in the worst case scenario a custom action in the UI sequence.

Another approach would be to use chained packages for the optional MSI installers and custom actions for the non-MSI installers. In this case you can use feature actions to condition the chained installers and the custom actions (run an optional installer only if a certain feature is selected for installation).
My current installer allows both the setup/upgrade executables as well as the document files to be listed as components that the user can choose to install on the component list. Users only need to select what they want to install, and the installer will 1) run the executable to install, and/or 2) copy the document files as selected by the users from a single component selection screen.
Is your installer MSI-based? I'm afraid that Windows Installer has some limitations when it comes to multiple installations performed at the same time.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Christian
Posts: 4
Joined: Thu Apr 30, 2009 5:49 pm

Re: Execute file based on feature selection

Hi,

Prerequisites not being mandatory sounds good to me.

On the Feature Action method, would I be able to create a "Feature" that does not contain a file? User can then be able to select this feature to run the embedded setup executable if he so wishes to, without having a need to include a "dummy file" in order to be able to use this Feature Action functionality.

My own installer is created in NSIS, which as far as I understand, is not MSI-based. I'm not too sure about the setup executables (File A and B, in my original post), as they were not created by me. Is there a way to find out?

Thanks.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Execute file based on feature selection

Hi,
On the Feature Action method, would I be able to create a "Feature" that does not contain a file?
Yes, the package can contain empty features.
I'm not too sure about the setup executables (File A and B, in my original post), as they were not created by me. Is there a way to find out?
You can try running the installers during a MSI-based installation (when the progress is shown). If Windows Installer doesn't show an error message stating that another install is running, the packages are not MSI-based.

Another approach would be to use the Windows Installer Cleanup utility. When launched it will show all MSI-based packages installed on the machine. If the other executables are installed and they don't appear in the list, they are not MSI-based.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”