frankmanguiob
Posts: 10
Joined: Fri May 08, 2020 6:46 pm

Suite installer questions

Fri May 08, 2020 7:09 pm

Hi all,

First of all, a background of what I'm trying to do, and please do correct me if there is a better way.

I'm creating an installer for two applications, each preferably separately upgraded when new versions come along. The reason is the first application requires user opt-in for updates, the other does not because it's an autoupdate service. However, these should be bundled together as the service is pointless without the main app.

This made me decide to use a suite installer method for initial deployment, with each application having its own msi, both added as prerequisites to the suite installer. Further upgrades will be deployed by the autoupdater service, with the individual msi's obtained from a server. Also in the suite installer are support files and drivers, both of which I won't package with the upgrade msi's.

I designed the suite installer as a seamless experience, with both running in silent mode. All is well, until I came up with stuff I'm not so sure is possible:

1. Is the shortcut creation info possible to pass into the prerequisite msi's like [APPDIR]? For example if the user chooses to create a shortcut to the start menu only in the suite dialog box, I want the "main app" msi to do this as well.
2. Is it possible to just have a single entity (ie. Suite Software X) in add/remove programs instead of having two entries there, one for each msi?

I know it's a bit complicated but curious if someone has done the same thing before. Again, I'm welcome to be corrected in the overall architecture of the project.

Thanks!

Catalin
Posts: 6544
Joined: Wed Jun 13, 2018 7:49 am

Re: Suite installer questions

Mon May 11, 2020 11:14 am

Hello Frank and welcome to Advanced Installer forums,
First of all, a background of what I'm trying to do, and please do correct me if there is a better way.
Your approach to this is indeed correct.
1. Is the shortcut creation info possible to pass into the prerequisite msi's like [APPDIR]? For example if the user chooses to create a shortcut to the start menu only in the suite dialog box, I want the "main app" msi to do this as well.
If I understand correctly here, your question is if it is possible to pass a public property to your prerequisites. The answer to this is yes, it is possible.

If you take a look at our "MsiExec.exe Command Line" article, at the bottom of the page, you can see how it is possible to pass a property through command line. This is done as it follows:

Code: Select all

msiexec.exe /i <path_to_MSI> YOUR_PROPERTY="YourValue"
When you add a package as a prerequisite, we will launch it with a command line similar to the one above. That means that, if you need to pass a property to the prerequisite, you can do so from the "Install Command Line" fields.

A pretty common scenario for this is the following:

How to install the prerequisite in the same folder as the main package?

As it can be seen in the above thread, this can be achieved by forcing the prerequisite's application directory (APPDIR) to be the same with the one from the main package:

Code: Select all

APPDIR="[APPDIR]"
Basically, the prerequisite will be launched with a command line such as it follows:

Code: Select all

msiexec.exe /i <path_to_MSI> APPDIR="[APPDIR]"
2. Is it possible to just have a single entity (ie. Suite Software X) in add/remove programs instead of having two entries there, one for each msi?
Here, basically, by default, you should have 3 entries in the Control Panel. One entry from your main package (the suite installer) and two entries from your prerequisites, resulting in a total of 3 entries.

In this case, you can force the main installer to not be displayed in the control panel by not registering it with the Windows Installer ("Product Details" page --> "Register product with Windows Installer").

By doing so, the main installer will not appear in the Control Panel.

Additionally, if this option is not checked you cannot remove, repair or reinstall the application by using the Control Panel, the Windows Installer command-line options or the Windows Installer application programming interface (API).

Hope you will find the explanation helpful.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

frankmanguiob
Posts: 10
Joined: Fri May 08, 2020 6:46 pm

Re: Suite installer questions

Tue May 12, 2020 3:08 am

Hi Catalin, thanks!

Yes, I'm aware I can pass parameters. I actually pass a custom parameter myself to a custom property, but I can't find a way to do this:
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.

As for the uninstaller if I wanted to "uninstall" the prerequisites, maybe I can simply delete their folder contents and registry entries?

Catalin
Posts: 6544
Joined: Wed Jun 13, 2018 7:49 am

Re: Suite installer questions

Tue May 12, 2020 10:23 am

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
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
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
registryEntry.png (78.68KiB)Viewed 4053 times

For the above registry entry, a new component will be created in the "Organization" page.

componentEntry.png
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
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
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
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
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

frankmanguiob
Posts: 10
Joined: Fri May 08, 2020 6:46 pm

Re: Suite installer questions

Tue May 12, 2020 3:53 pm

Hi Catalin,

Thanks for the reply, I'm really happy with the support so far! Awesome work.

Ah, this does mean I have to get Enterprise then (I have Pro) if I want it to be a seamless experience. I imagine I can do it in Pro with VBS but that won't be a seamless experience.

Cheers,
Frank

Catalin
Posts: 6544
Joined: Wed Jun 13, 2018 7:49 am

Re: Suite installer questions

Wed May 13, 2020 2:16 pm

Hello Frank,

Thank you for your kind words!

I am really glad you are pleased by our support.

Indeed, the "Dialog Editor" feature, which we have used, requires an "Enterprise" license or above.

Please let me know if there is anything else I could help you with and I will be glad to assist.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

frankmanguiob
Posts: 10
Joined: Fri May 08, 2020 6:46 pm

Re: Suite installer questions

Thu May 14, 2020 10:25 pm

Hi Catalin,

Actually I do.

So if I create subsequent versions of this Suite installer, I would need retain the path the user picked initially. I tried it and it doesn't "remember". I tried the following.
1. Added registry entry to store initial APPDIR, let installer search for this entry and overwrite APPDIR with it using a custom action - did not work, got unsupported type error. The "end on failure" option was unchecked yet it still did not proceed.
2. Made APPDIR in config the result property from the registry search. Assigned a default value ([|ProgramFilesFolder][Manufacturer]) to search variable in Properties. Installer took the path in registry, but had problems in cases the registry entry did not exist (1st install scenario).

Either there's a bug in #1, or I did something wrong in #2, as we're not supposed to use fixed properties as values for other properties?

Thanks!

Catalin
Posts: 6544
Joined: Wed Jun 13, 2018 7:49 am

Re: Suite installer questions

Fri May 15, 2020 2:22 pm

Hello Frank,

If you want the installer to "remember" the original installation path, you can go to "Upgrades" page and check the "Use original installation path when upgrading" option.

Normally, this is our default behavior (unless you have changed it) - in a newly created project, this option is automatically checked.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”