dotnetinstaller configuration to continue with MSI installation even if prerequisites fail

135 views Asked by At

I have a setup for a VC++ application built with dotnetinstaller. Being a native application, the VC++ redistributables are a prerequisite. However, nowadays these change very often (every 6-8 weeks). This means we release a new version of the application, but newer version of the redistributables are also released and installed on a customer machine before the customer actually installs our application. The result is the old redistributables from our setup will fail to install, since a newer version exists. This, in turn, results in the failure of the setup, therefore the application MSI will not be executed.

Currently, the workaround is to open a command prompt elevated as administrator and run the msiexec with the right parameters. I want to find a better experience for the customers.

The VC++ redistributables are added as required prerequisites. That means the required_install property is set to true. The result of this is that failure to install the prerequisite means installation failure. Although allow_continue_on_error and default_continue_on_error are set to true, the user is informed about the failure and can continue with other prerequisites, but the setup fails in the end and the MSI execution does not start.

I have tried making the VC++ redistributable optional prerequisites by setting the required_install property to false. However, this leads to another undesired behavior. If any required prerequisite is missing, then the dialog of prerequisites is displayed and I can check/uncheck the optional ones (and therefore skip them if I don't want them). However, if all required prerequisites are found and only the optional ones are missing, the setup does not display the prerequisites dialog and go straight to execute the MSI.

I need an option to make these pre-requisites optional in the sense that failure to install them will not stop the execution of the MSI; however, I do want the users to see they are missing, if the case, and have the option to install them.

Is this possible in some way with dotnetintaller?

1

There are 1 answers

0
Marius Bancila On

It seems there is a key where the version of the VC++ redistributables are installed, which is HKEY_LOCAL_MACHINE\SOFTWARE[\Wow6432Node]\Microsoft\VisualStudio\14.0\VC\Runtimes\{x86|x64|ARM}. This is documented here: https://learn.microsoft.com/en-us/cpp/windows/redistributing-visual-cpp-files?view=msvc-160

However, the version is stored in a string with the form v14.28.29913.00 as seen here: enter image description here There are also DWORD values for Minor, Major, Build, and Revision.

One solution using dotnetinstaller is to combine installedcheck operations, using installedcheckoperator. An example can be found here.

The latest version of dotnetinstaller, 3.1.415, supports parsing strings in the form v[version] such as v14.28.29913.00, making it, therefore, simpler to check for the VC++ redistributables version.