cminorm
Posts: 30
Joined: Mon Jan 23, 2012 4:13 pm

How do I copy a file called Replisapi.dll?

I need to search for a file called REPLISAPI.DLL and copy it to the folder C:\INETPUB\WWWROOT\WEBSYNC if it exists.
I have done a search and found the file, the problem is the PROPERTY has the file path and not a folder path. How do you copy a file when i have its path in a property?
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How do I copy a file called Replisapi.dll?

Hi,

In order to achieve what you want you should proceed as follows:
- Create a "New file search" (i.e SOURCE_FILE) that searches for your file.
- Create a "New Search" (i.e. DESTINATION_FOLDER) and from its context menu choose "Add Location" -> "Folder" option. Set the "Path" field from "Directory Properties" right pane with your destination folder path:

Code: Select all

C:\INETPUB\WWWROOT\WEBSYNC
- Go to "Custom Action" page and add a "Launch File and Open URL" custom action with sequence. Set the "Command" field from "Custom Action Properties" right pane with the following value:

Code: Select all

xcopy [SOURCE_FILE] [DESTINATION_FOLDER]
- From "Execution Options" group choose "Deferred with no impersonation" option.
- From "Execution Stage Condition" group uncheck "Uninstall" and "Maintenance" and in the "Condition" field use the following condition:

Code: Select all

DESTINATION_FOLDER AND SOURCE_FILE
- Build and run your package application.

If you have any questions let me know.

Regards,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
cminorm
Posts: 30
Joined: Mon Jan 23, 2012 4:13 pm

Re: How do I copy a file called Replisapi.dll?

I tried what you said and i'm getting an error. Here is what the log is showing:

xcopy "c:\program files (x86)\microsoft sql server\100\com\replisapi.dll\" "c:\inetpub\wwwroot\websync\"

The file search is adding a \ at the very end which is causing an error.
cminorm
Posts: 30
Joined: Mon Jan 23, 2012 4:13 pm

Re: How do I copy a file called Replisapi.dll?

It looks like when you use a property as a Folder, it adds the \ at the end. Once i removed the property as a folder, the slash disappeared.
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How do I copy a file called Replisapi.dll?

Hi,

If you want to remove the related backslash you should use a simple VBScript custom action that will do that. You should take a look on our "How do I remove a trailing backslash from the value of a property" FAQ.

If you have any questions let me know.

Regards,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”