1
votes

I want to backup the folder before the new files are overwritten using WIX control.

Example: My installation folder is "Ifolder", I upgraded my product with the latest changes and created the setup files. I have to install my latest set up in the same "Ifolder". For this case I want to take a backup of "Ifolder" before the new files are overwritten into the same folder at the time of installation.

Please add your points in this case.

1
Usually this is done through a custom action (custom code): wix.sourceforge.net/manual-wix2/authoring_custom_actions.htm - rmrrm
@Cosmin: You should convert you comment to an answer. - Rob McCready
How will those backed up files be used? You upgraded a previous version of your product to a newer version, this process overwrites old files with new ones. To return to a previous state you just need to install the previous version of your product. - Alexey Ivanov
Hi Alexey, Thanks for your reply.the old installation files should be available in the same place for my clients quick reference,so this bacup the folder will help me to refer those scenarios.Please share your idea abourt how to copy a folder and paste it into another folder.thanks - santhoshkumar
Hi All, I have reached this implementation using createfolder functionality and now i have an another problem. I want to add the condition checkbox to take the backup .During the installation i need to add a checkbox to ask the installer to take a backup or not. based on the checkbox only i need to take the backup. thanks - santhoshkumar

1 Answers

2
votes

You can try to use the open source SystemTools wix extension here: http://msiext.codeplex.com.

An example, from the Demo:

<!-- copy all the files to a subdirectory, delete them on uninstall -->
<AppSecInc:CopyFiles Id="CopyAll" CopyOnInstall="yes" Recurse="yes" Source="[INSTALLLOCATION]" Overwrite="yes" Target="[INSTALLLOCATION]\CopyOfAllFiles" Wildcard="*.*" />
<AppSecInc:DeleteFiles Id="DeleteAll" DeleteOnUnInstall="yes" Recurse="yes" Path="[INSTALLLOCATION]\CopyOfAllFiles" Wildcard="*.*" DeleteEmptyDirectories="yes" />