Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

Repair removes folders with data

Updated: 23 May 2010 | 3 comments
mduvee's picture
0 0 Votes
Login to vote

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

Comments

AngelD's picture
29
Oct
2009
0 Votes 0
Login to vote

Add a condition for the

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

mduvee's picture
09
Nov
2009
0 Votes 0
Login to vote

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
09
Nov
2009
0 Votes 0
Login to vote

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.