Page 1 of 1

Delete Files usage

Posted: Wed Jul 04, 2007 5:54 pm
by Ryan Lee
When my application runs it creates some files in the target directory (myFile1.txt and myFile2.txt). When uninstalling I want to delete those files. I am currently trying the following with no success.

Code: Select all

DEFINE REGION: Perform Uninstallation
 if Variable REMOVE equals TRUE
   Delete Files $TARGETDIR$\\myFile1.txt (when uninstalling)
   Delete Files $TARGETDIR$\\myFile2.txt (when uninstalling)
   Apply Uninstall (get result into variable SUCCESS)
   Set Variable PROGRESS to 100
 else
  .......

Posted: Thu Jul 05, 2007 2:23 am
by MichaelNesmith
There's a help file article on this in the help file, titled setup commands preceding apply uninstall. That will help you.

Posted: Thu Jul 05, 2007 6:00 pm
by get101
It goes in as part of the install section rather than the uninstall section.

Look for this line:

Code: Select all

 Comment: TO-DO: Insert any additional install commands here
and put your delete lines there.

Posted: Thu Jul 05, 2007 6:40 pm
by Ryan Lee
Thanks, I got it working.