Copy/move an installed file during uninstallation - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

redseujac
Posts: 32
Joined: Thu Feb 10, 2011 7:16 pm

Copy/move an installed file during uninstallation

During uninstallation (silent while upgrading or launched by the user) the user should have the choice (prompted) to move/copy or not an installed file (license key) to the desktop. How can I do this practically in Advanced Installer (Enterprise)?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Copy/move an installed file during uninstallation

Hello,

You can try to add a "New File Operation" -> "File Move/Copy" to your installed file from the Files and Folders Page by right clicking on the file. After this, from the Organization Page, you will need to move the file into a new component along with its operation. Then, from the Custom Action Page you can schedule a "Message Box" custom action after the Install standard action. This message box should have a "Yes" and a "No" button and its text set to something like "Would you like to copy our license file to the Desktop?". Also, its execute condition should be set to:

Code: Select all

REMOVE="ALL"
so that it's triggered only during the uninstall.
In the end simply add this condition to your file's component in the Organization Page:

Code: Select all

YOUR_RESULT_PROPERTY = "IDYES"
where YOUR_RESULT_PROPERTY is the OutputPropertyName from the message box tutorial.

If you need a more advanced approach you can implement the functionality from within your own custom action.

Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
redseujac
Posts: 32
Joined: Thu Feb 10, 2011 7:16 pm

Re: Copy/move an installed file during uninstallation

Thank you very much.

I'm so sorry. I'm afraid I did not explain the problem correctly.

The file that should be copied/moved is NOT installed during installation with AI and does NOT belong to the Files and Folders. The file is placed manually by the user in the Application Folder. The purpose is to let the uninstaller remove ALL the files from the Application Folder even those not installed during setup, but give the user the opportunity during uninstallation to save the license key file to the desktop for safety reasons.

Is this possible and how to do it?
octavian.vasilovici
Posts: 51
Joined: Tue Jan 25, 2011 2:43 pm

Re: Copy/move an installed file during uninstallation

Hello,

Unfortunatelly Advanced Installer does not provide this kind of functionality as it is not recommended by Microsoft. By default Windows Installer can copy, remove(delete) only those files that where installed by it in the first place. However in order to achive the behavior explained by you earlier you can use your own custom action to copy/move the file you want. Also be sure to set the condition to

Code: Select all

REMOVE="ALL"
for this custom action.

If you have any other questions, please don't hesitate to contact us.

Best Regards,
Octavian
_______________________________________________________________________________________________________________________________________________
Octavian Vasilovici
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”