1
votes

I have an InstallScript function that runs fine when running during the install that I need to run during an uninstall. It is backing up the existing applications. I created a Custom Action for it and added it to the Execute Sequence after InstallValidate.

There is no log file generated, as far as I can tell for uninstalls, so I am having trouble figuring out why it fails with a "Feature Transfer Error" -1603.

I am pretty sure the function is not being called as I put a MessageBox as the first thing.

2

2 Answers

0
votes

To run a custom action during uninstall, set its condition to REMOVE="ALL" in Install UI Condition or Install Exec Condition, which ever is applicable in your case.

To run a custom action when a product is already installed, the condition should be set to Installed.

To run a custom action when a product is not installed, the condition should be set to Not Installed.

I believe you can use the following msiexec command to log the uninstall:

msiexec /x YourProduct.msi /L*v logfile.txt

or

msiexec /x {Your Product/Package Code} /L*v logfile.txt
0
votes

You should set the Install UI Condition or Install Exec Condition to

(REMOVE="ALL")OR(REMOVE="<feature_being_uninstalled>")

just in case you have or will in the future have multiple features being installed. (Unless of course, you only want to run the Custom Action in the case where the whole product is being uninstalled)