how_fun
Posts: 5
Joined: Tue Jun 03, 2008 8:53 pm

Re: Copying folders

cosmin wrote:Hi Hong,

I'm not sure I understand what you mean. Can you please give me more details about this?

Regards,
Cosmin

Let me explain more in detail. We don't want to put those template file in the setup file. Therefore, we have to copy a folder after the installation. So our artist can put new template file in the folder after the setup file has been built.


Thanks again,

Hong
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Copying folders

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:

Code: Select all

"[SourceDir]Sample Templates"
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:

Code: Select all

"[APPDIR]Sample Templates"
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
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
how_fun
Posts: 5
Joined: Tue Jun 03, 2008 8:53 pm

Re: Copying folders

[quote="cosmin"]Hi Hong,

Please note that you are using an incorrect command line for xcopy.exe:
.......


Now it is ok, But the command line still need write XCOPY. also igonore return has to be selected . this is the command line i wrote:

xcopy "[SETUPEXEDIR]Sample Templates" "[APPDIR]Sample Templates" /s /e /y /q /I

I also trace the event log, it can show the command.

XCOPY "C:\Documents and Settings\dave\Application Data\ImprintPlus\NamePrint Graphics 2.06.000\install\Sample Templates" "C:\Program Files\NamePrint Graphics 2.06.000\Sample Templates" /s /e /y /q /I

that means sourceDir = C:\Documents and Settings\dave\Application Data\ImprintPlus\NamePrint Graphics 2.06.000\install\Sample Templates

Thanks alot,


Hong
untitled.GIF
untitled.GIF (140.95 KiB) Viewed 2463 times

Return to “Common Problems”