Repair removes folders with data

mduvee's picture

Hello,

I have an installer that installs a program that creates a bunch of folders.  Subsequent use of the application will add sub sirectories and files into the created folders.

Repair worked fine in the past until I had a new requirement that on UNINSTALL the program was to remove all the folders (empty or not)

So... I add the following custom action after the RemoveFiles line in the Execute Deffered Tab of the MSI Script:
Execute Program From Destination cmd.exe /MIN /Q /C "rd /S /Q "[INSTALLDIR]"" Default Directory EFB [Uninstall]

This worked fine for UNISTALL, but now my REPAIR function is deleting files/folder too!?

Confused!

Mike

AngelD's picture

Add a condition for the

Add a condition for the custom action so it only executes during uninstall ex. REMOVE~="ALL"

mduvee's picture

thanks.  I "think" I

thanks.  I "think" I understand what your telling me...

Are you saying I need to add the "If" Statement to my custom action? Or is there some other way to add a condition to a "Execute Program From Destination" custom action?

Sorry for the question.  Still a newbie on Windows Installer...

AngelD's picture

Yes, you could call it that

Yes, you could call it that or in the CustomAction table you'll find your action and set the Condition column value to whatever condition you would like to set.