Dazzler5052
Posts: 5
Joined: Thu Mar 28, 2024 1:33 pm

Silent installation and prerequisities

Dear Advanced Installer community,

I am facing an issue when installing my MSI package via silent installation. The problem occurs after the installation finishes and I attempt to start a Windows Service that requires VCRedist to be present. It appears that the VCRedist prerequisite is either installed after the main silent installation process, causing the service to fail to start because the redistributable is installed afterwards, or it might be installed asynchronously. When the installation is performed through the GUI, it works perfectly fine.

Here are the installation steps:
1. Install VCRedist prerequisite.
2. Perform the main installation process.
3.Start Windows Service.
(During silent installation, at step 3, VCRedist is not installed yet, so the service fails to start.)

I recall seeing a thread a few months ago mentioning this as an MSI limitation, but I cannot find it anymore. The suggested workaround was to use a bootstrapper, which I would prefer to avoid.

Is there any solution to my problem other than using a bootstrapper? Another workaround I thought of is to install the prerequisites during the main installation using a normal command (PowerShell or a regular command) with a wait for the VCRedist installation to complete.

Thank you for your help!
Catalin
Posts: 7513
Joined: Wed Jun 13, 2018 7:49 am

Re: Silent installation and prerequisities

Hello,
I am facing an issue when installing my MSI package via silent installation. The problem occurs after the installation finishes and I attempt to start a Windows Service that requires VCRedist to be present. It appears that the VCRedist prerequisite is either installed after the main silent installation process, causing the service to fail to start because the redistributable is installed afterwards, or it might be installed asynchronously. When the installation is performed through the GUI, it works perfectly fine.
Really good catch here.

Indeed, prerequisites are usually handled when the user presses the Install button. This is happening exactly before the main package is installed and the reason for this is to avoid the OS limitation that does not allow two packages running at the same time.

On silent installations, this is impossible to achieve because you start directly from the "Install Execution" (where the actual install happens) stage on the main MSI (the dialogs are skipped) and therefore the only solution is to have the prerequisite installed after.

The only solution for this would be to set the prerequisite as "before main package" (turning the main into an EXE).

This helps because the we'll have the bootstrapper encapsulating both the main and the prerequisite and therefore we can control install the prerequisite first.

Hope this helps!

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

Return to “Common Problems”