Custom msiexec.exe parameters

Dec 15, 2011 at 7:01 PM

Hello and great work on the software!

I use dotNetInstaller for to download and install an msi file.

I unfortunately released a "bad" msi recently that will not uninstall, and in order to fix that I've created a working msi but it needs to be installed like this:

msiexec.exe /fvecmus myinstaller.msi

So for my MSI file and cmdparameters I enter /fvecmus. The problem is this:

2011-12-15 10:39:32 *** Component 'myinstaller': SKIPPING DOWNLOAD/COPY2011-12-15 10:39:32 -- Package: C:\Users\Dan\AppData\Local\Temp\myInstaller\myinstaller.msi2011-12-15 10:39:32 -- Additional command-line parameters: /fvecmus
2011-12-15 10:39:32 Executing: msiexec /i "C:\Users\Dan\AppData\Local\Temp\ezvidInstaller\myinstaller.msi" /fvecmus
2011-12-15 10:39:37 --- Component 'myinstaller (myinstaller.msi): DIALOG CLOSED
2011-12-15 10:39:37 *** Component 'myinstaller' (myinstaller.msi): ERROR - Error executing 'myinstaller' (myinstaller.msi): 1639 (0x667)


So instead of this format which I need:

msiexec.exe /fvecmus myinstaller.msi

I end up with:

msiexec.exe /i myinstaller.msi /fvecmus

Is there any work around for this without getting in to the source of dotNetInstaller and rebuilding it? Maybe a custom command of some sorts would work?



Dec 15, 2011 at 7:39 PM

I think you should just add a command line component that checks whether you have that specific broken version of the MSI and execute whatever you want (like msiexec /xyz...). In the UI we typically called these things patches - "Patch for version XYZ". Then your actual MSI would run its upgrade and probably do nothing since it just installed itself properly as a patch. 

Dec 15, 2011 at 7:49 PM

That makes perfect sense, thank you. 

In this case I would need to download the MSI but not immediately execute it and instead run a command. If I want to do that, how would I tell the msi to not run after the download finishes (or is already downloaded)? Do I set required_install to false?

Thank you so much for the great project and support.

Dec 15, 2011 at 7:58 PM

It's just a normal cmd component with a download and a proper install check. It should be required - if the check says you have a busted version, you must install it.

Jan 2, 2012 at 11:42 PM


I'm having conceptual trouble with this. My understanding based on this:

"Remember that the check tests whether the component is installed and a component appears in the boostrapper at setup time only if it is not installed. When combining component operators this behavior may require some mental gymnastics."

is that if I detect a previous version, then the component will be detected as installed and the command that we talk about using to execute the msi will not be included in the bootstrapper.

So how do I reverse this, in other words how do I force a command to execute if it detects something as installed?

Sorry if I'm missing something obvious, I've read the documentation for this about 5 times and I just haven't found a way to do this. Thanks anyone, dblock, for your help.

Jan 2, 2012 at 11:54 PM

As soon as I post I figured this out but I end up with another question

-- In the check I set comparison to version_gt and in fileversion I put the new installer's version.  --

Essentially DNI sees that my file exists, but returns false because its version number is not as high as the current version. It then executes my custom command. However, when it DNI moves right on to the next component which in my case is the regular msi for first time users.

So then the normal msi component executes on top of my custom command.

My question now becomes, how I do stop the bootstrapper after the first command? If there is no built in way to do this I suppose I could change the command to exectue a batch file that kills the installer after my custom msiexec but that doesn't seem good for obvious reasons.

Jan 3, 2012 at 1:10 PM

The bootstrapper needs to decide upfront what to install. So you have two options: prevent the MSI from being installed in this specific condition with an AND/OR logic or, maybe, make your second MSI do nothing when the same version is already installed. Since it's a patch, I think that's an OK solution.