Hi Sue,
This can be done by using
xcopy.exe as a custom action (this file is in the "C:\Windows\system32" folder). Here are the steps:
- go to the
Custom Actions page and create a "New Attached Custom Actions"
- when prompted for the source of the custom action, select the "xcopy.exe" file
- set the "Command Line" field to something like this:
Code: Select all
<source_folder> <target_folder> /s /e /y /q /I
Here is a sample command line for the custom action:
Code: Select all
"C:\Original Folder" "C:\Temporary Folder" /s /e /y /q /I
Since you want to run this custom action before the installation updates the old package, you can schedule it under the "InstallExecuteSequence" -> "CostFinalize" standard action. Note that you can show a standard action by using the "Show Standard Action" button on the toolbar of the "Custom Actions" page.
In order to copy the folder back in the original location, you can use another custom action similar to this one. This custom action can be scheduled under "InstallExecuteSequence" -> "InstallFinalize". Also, in order to delete the temporary folder, you can use another custom action like explained in the
Remove a file or a folder during installation how-to.
Regards,
Cosmin
FOLLOW US
Get the latest news in Application Packaging