Page 1 of 1

Copy Local Files - Can't get to work, please help

Posted: Sat May 17, 2008 5:49 pm
by CBiggerstaff
I've spent hours trying to get Copy Local Files to work.. I can't figure out what I'm doing wrong and would really appreciate any help. My current attempt is:
Copy Local Files $SFXPATH$\\*.id to $TARGETDIR$\\*.id
I'm trying to copy a file in the same folder as the sing file compressed setup.exe into the install directory.
Originally I tried:
Copy Local Files $SFXPATH$\\Setup.ini to $TARGETDIR$\\Vendor.id
I've also tried:
Copy Local Files $SFXPATH$\\Vendor.id to $TARGETDIR$\\Vendor.id
Not to mention the dozen attempts before I figured out to use SFXPATH.
The file never gets copied into the install directory.

Posted: Tue May 20, 2008 5:55 pm
by LarsS
Hi,

First of all make sure that you copy the file after the "Apply install" command. Until this point TARGETDIR will not have been created.

Second, you cannot use $SFXPATH$ in the "Source files" field as it does not accept variables.
Why this is so is a mystery to me and should be rectified asap.

Unbeleivable

Posted: Tue May 20, 2008 6:58 pm
by CBiggerstaff
Wow, that would explain things then as I have always used variables in the Source Files field. How else am I to know what folder the user ran the exe from?
Do relative paths work.. hmm guess that wouldn't work on a single file install though cause the path wouldn't be for the setup.exe but rather the temp extracted folder. This has been a real challenge and I was certain it would only take minutes. Seems like a simple task get path of setup.exe and copy file from that folder.
I hope they add support for variables soon.. I thought it even popped up a baloon saying that I could use them (guess I got that confused with another script).
Thank you for your reply.

Posted: Wed May 21, 2008 9:15 am
by Mateo
I ran into this same problem. I got around it by writing a function in C and compiling it into a dll then calling it with Call DLL Function. It's not pretty but it works. I can post the code if you want but be warned, I'm not a C programmer and the code is UGLY.

Posted: Wed May 21, 2008 1:33 pm
by jimo
Copy local files does accept variables. I do it in most of my scripts.
Copy Local Files $MASTER_SHARED_FOLDER$\\BooksOnline\\*.* to $TARGETDIR$\\MDPM\\BooksOnline\\*.*

Posted: Thu May 22, 2008 6:25 pm
by LarsS
Just wanted to point out a few corrections to myself:

1. You should actually use it BEFORE Apply Install, but make sure the folder exits before calling it.

2. Its the source file name that does not accept variables. Not the folder.

3. You can use the "Call DLL" function and call CopyFileA in kernal32.dll instead of using Copy Local file.

Back to question

Posted: Thu May 22, 2008 6:54 pm
by CBiggerstaff
Guess that puts me back to my original question, why doesn't this script work (copied from Installaware):
Copy Local Files $SFXPATH$\\*.id to $TARGETDIR$\\*.id
I want it to take a file I have in the same folder as setup.exe named vendor.id and copy it into the program files\\myprogram folder. It isn't copying my vendor.id file, any ideas/suggestions?

Posted: Sun May 25, 2008 5:36 pm
by jimo
Make sure your copy local files command is before Apply Install.