Hi Hong,
Please note that you are using an incorrect command line for xcopy.exe:
1) The source of a custom action is never used in the command line of the custom action. Therefore, if you add "xcopy.exe" as an Attached custom action, the "Command Line" field in the
Custom Action Properties page will contain only the parameters used by "xcopy.exe".
2) When running a custom action during an installation, most likely the path ".\Sample Templates" will not be resolved correctly. If the folder "Sample Templates" is next to the MSI package, you can use this path for the source folder:
The "SourceDir" property is resolved automatically to the path of the folder which contains the MSI file.
3) The "APPDIR" property is automatically ended with a "\" character. Therefore, if you use "[APPDIR]\\Sample Templates" as the destination folder and APPDIR="C:\MyApp" (for example), the path of the destination folder would be "C:\MyApp\\\Sample Templates". The correct parameter for the destination folder is:
Here are the steps for using "xcopy.exe" as a custom action:
- go to the
Custom Actions page
- create a "New Attached Custom Action" under "InstallExecuteSequence" -> "Install"
- make sure it is set as "
Immediate" in the "Execution Options" section
- set the "Expression" field to "NOT Installed" (in order to execute it only during the installation)
- set the "Command Line" field to:
Code: Select all
"[SourceDir]Sample Templates" "[APPDIR]Sample Templates" /s /e /y /q /I
Let me know if the problem persists after performing the necessary modifications.
Regards,
Cosmin