Hello Frank,
1. Suite installer displays shortcut creation screen, user picks preferences.
2. Suite installer tells the prerequisite installer user preference on that shortcuts to create.
3. Prerequisite installer creates shortcuts as user picked it in suite installer.
Alright, let's work through this together.
First of all, I am assuming that both the prerequisite and the main package are created with Advanced Installer - you have the AIP files (Advanced Installer Project) for both of them.
Let's start with a small description of what we are about to do here:
If I understood correctly, you want to install a shortcut created by your prerequisite package based on the user selection in the main package.
For this, we will have to first create the shortcut in the prerequisite package. Upon doing so, we will need to assign the shortcut to a component and then condition the component based on the user selection, by passing the value from the main package to the prerequisite. Here is how this can be achieved:
- first, we will need to add an executable to our project (so we have a base file for our shortcut)
- sampleExe.png (19.46KiB)Viewed 4053 times
The file should be added in the
"Files and Folders" page.
- after doing so, we will need to create an
external shortcut for the above executable. Here, we will need to use an external shortcut, because only a shortcut of this type will allow us to move its resource to a new component. A shortcut to an installed file will have the resource binded to the component of the executable, meaning that we can not condition it without conditioning the installation of the file.
The shortcut may look something as it follows:
- SampleShortcut.png (99.2KiB)Viewed 4053 times
As you can see, we are placing this shortcut on the Desktop folder. Additionally, the
"[APPDIR]sample.exe" is the path to our executable.
- now, we will need to create a component for this shortcut (so we can install it as a separate entity of the executable itself). To do so, please go to
"Registry" page and create a new registry entry, i.e.:
- registryEntry.png (78.68KiB)Viewed 4053 times
For the above registry entry, a new component will be created in the
"Organization" page.
- componentEntry.png (27.58KiB)Viewed 4053 times
In this component, we will need to add the resource of the earlier created shortcut. In the end, it should look something similar to this:
- componentEntryShortcut.png (81.37KiB)Viewed 4053 times
As you can see, we have already conditioned the installation of this component based on a
WIndows Installer property. This property will then be further assigned to a UI control in our main package.
- now, we are pretty much done with the prerequisite package. We will need to move to our main package now. Please open the AIP file for the main project and go to
"Dialogs" page. Here, we will create a new dialog and a checkbox which will decide whether the component (the shortcut) in our prerequisite package will be installed or not.
- InstallShortcutCheckbox.png (186.61KiB)Viewed 4053 times
As you can see, we have added in our dialog a new
"Checkbox" control. We have assigned to it the same property name as the one from our prerequisite package and the default value (when the checkbox is checked) of
"Yes".
- now, we will need to go to
"Prerequisites" page and if you did not add the package already, please add it as a
"feature-based" prerequisite. Additionally, in the
"Setup Files" tab of the prerequisite, we will pass the
INSTALL_SHORTCUT property to our prerequisite.
- PassProperty.png (57.28KiB)Viewed 4053 times
As you can see, we have passed the property over to the prerequisite. I have explained it in my previous thread, but here is what will happen behind:
main package is launched ==> the user will have the checkbox checked ==> the value of the
INSTALL_SHORTCUT property will be set to
"Yes" ==> the prerequisite will be launched with a command line such as follows:
msiexec.exe /i <path_to_MSI> INSTALL_SHORTCUT=[INSTALL_SHORTCUT] ==> the above command line will set, inside the prerequisite, a property named
INSTALL_SHORTCUT and it will set it to the value of the
INSTALL_SHORTCUT property from our main package (
"Yes") ==> when the evaluation of the components will be done, the prerequisite package will evaluate the condition, it will see that the
INSTALL_SHORTCUT property is equal to
"Yes" ==> will perform the installation of the component ==> the shortcut will be installed.
As for the uninstaller if I wanted to "uninstall" the prerequisites, maybe I can simply delete their folder contents and registry entries?
To be fully honest with you, I would advise against that as it is possible for you to leave some unwanted files behind. Obviously, this all depends on the complexity of your program.
Additionally, if you delete the files, that does not necessarily mean the program was uninstalled.
Hope you'll find this information helpful.
Best regards,
Catalin