Wixsharp: How to pass command line arguments to uninstall actions?

Created on 24 Mar 2020  路  4Comments  路  Source: oleg-shilo/wixsharp

Hi,

I have an msi that checks for a condition before installation, if the condition is not valid, it will stop the installation unless a FORCE parameter is provided. In that case, it will kill whatever process invalidates the installation and continue.

The problem happens when I have an installed version and I want to upgrade. So when starting the installation, the RemoveExistingProducts step kicks in and it runs the uninstall custom actions from the _old msi_, but it does not pass the arguments ( FORCE ) to these custom actions.

How can I make it so that the uninstall custom actions of the old msi get the command line arguments/parameters as well?

All installation/uninstallation happens silently without any UI.

help wanted question

Most helpful comment

Oh, I understand you. I came across this, and for a long time I was looking for an answer, but I could not find it. It seems that it is impossible to pass any parameters to the old msi. All that remains is to not start the CA.

All 4 comments

Oh, I understand you. I came across this, and for a long time I was looking for an answer, but I could not find it. It seems that it is impossible to pass any parameters to the old msi. All that remains is to not start the CA.

I did a workaround by adding a file in a specific location in the machine and all installations/uninstallations check for this file. Before triggering the msi, I create the file if I need to FORCE. It is not the nicest solution, but it works.

@oleg-shilo if there are no available solutions or nothing on your mind to pass the parameters, please feel free to close the issue.

The only work around I can come up with is really inelegant approach when you write your parameters to some well known location (file system, registry) from your before-LaunchConditions CA and then your old MSI reads them and acts accordingly.

Yeah, that's basically the gist of what I'm doing now, I'll close the issue then.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

meytes picture meytes  路  3Comments

UweKeim picture UweKeim  路  5Comments

yfnfif picture yfnfif  路  3Comments

mattias-symphony picture mattias-symphony  路  3Comments

kain64 picture kain64  路  4Comments