View Full Version : reading global variable (contain file path) and copy file to TARGETDIR during install

08-18-2005, 09:44 AM
I need some help.

i'm working with installscript project (not msi).

I'm using CtrlGetText to store a control string variable.
(user browse for file in dialog).
this string variable contain path of a file. i.e. c:\temp\temp.txt
i'm storing this string as a global variable (in seperate variable.rul file).

now, i want during installation of files (during copy of file at the end of installation), to take this global string variable and to copy the actual
file temp.text to a folder in TARGETDIR (maybe using xcopy?).

i looked into get/set properties (but i know msisetproperty doesn't work with installscript. i'm getting error for decleration although .h file exist and declare).

anyone knows what method i should use?

Thanks a lot in advance.

08-23-2005, 11:12 AM
Hi Zachi -

I wonder if you are making this more difficult for yourself than it has to be. If the value of the global variable is important to save, you can assign the value of the global variable to a temporary variable in the subroutine you are working in and work with the temporary variable.

1. Make sure that you have #include variable.rul at the bottom of Setup.rul and #include the .h file at the begining.
2. Once the user has selected the directory/file location, use
ParsePath to extract the PATH if this includes a filename (not clear from your thread) and assign it to a temporary variable (szTempPath).
3. Now go back and use ParsePath to extract your file name from the global variable to a different temp variable(szTempFile).
4. szTarget = szTempPath^szTempFile;
5.CopyFile (szSrc, szTarget); (szSrc=your global variable?)

Hope this helps.