thanasis0
Posts: 4
Joined: Tue Feb 24, 2009 10:55 am

Copy files from a paralel to SETUPEXEDIR folder

Hi

I've read many posts in this forum about a similar to mine problem but nothing could help.

Lets say I have a DVD with the following folders:
\Setup (has bootstrap exe, msi e.t.c)
\SomeOtherFiles (has some files)

A want to copy all files from SomeOtherFiles folder to APPDIR\AFolder.
In other words I'd like copy SETUPEXEDIR\..\SomeOtherFiles\*.* APPDIR\AFolder\

I cannot use the tricks I found in some topics here because of \..\
I've tried to make a property e.g. MYPROP = [|SETUPEXEDIR]..\SomeOtherFiles in order to make then a property based folder and copy the files, but the property SETUPEXEDIR is not resolved to its value.

How can I achieve the above?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Copy files from a paralel to SETUPEXEDIR folder

Hi,

In order to copy the files you can try using file copy operations. Please note that the User Guide contains the Install an user specific file how-to which may help you.

Instead of "SOURCEDIR" you can try using a custom property. This property can be created by using "SETUPEXEDIR" and the name of the folder which contains the files. Basically, SETUPEXEDIR will contain the path of the EXE bootstrapper ("..\Setup"). For this path you can get the root (it becomes "..\") and append the name of the folder with the files (it becomes "..\SomeOtherFiles"). This can be done only through a custom action.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
thanasis0
Posts: 4
Joined: Tue Feb 24, 2009 10:55 am

Re: Copy files from a paralel to SETUPEXEDIR folder

Well, I don't think I understand the proposed solution.

As I wrote, I've tried to use File Copy/Move as "Install an user specific file" says with a "Property-based Folder".
How can I combine a custom action (and which type of custom action) with the File Copy/Move dialog?
Do you mean that I have to write somehow a custom action to do the string handling in order to create something like "D:\SomeOtherFiles" and set it to a custom property that will be used then to create the "Property-based folder" in the File Copy/Move dialog?

If yes, how from a custom action can I set a value to a custom property?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Copy files from a paralel to SETUPEXEDIR folder

Hi,
How can I combine a custom action (and which type of custom action) with the File Copy/Move dialog?
For the file copy operations you can use a custom installer property, let's call it "SETUP_FILES_PATH". This property can be created in the "Install Parameters" page and used for a property-based folder in the "Files and Folders" page.

To set the path of this custom property you can use a custom action (VBScript or C++ DLL). Here is some sample VBScript code:

Code: Select all

Dim setupexedir
setupexedir = Session.Property("SETUPEXEDIR")

Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim parentFolderName
parentFolderName = objFSO.GetParentFolderName(setupexedir)
Session.Property("SETUP_FILES_PATH") = parentFolderName & "\" & "SomeOtherFiles"
For example, if SETUPEXEDIR is resolved to "D:\Setup", after the above custom action runs the SETUP_FILES_PATH property will be set to "D:\SomeOtherFiles". The VBScript code can be pasted into a .VBS file which can be added as an Attached custom action under "InstallUISequence" -> "Begin". You can drag this custom action over "InstallExecuteSequence" -> "Begin" while pressing the SHIFT key to make sure that it runs even for a silent install.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”