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

Got a problem you cannot solve? Try here.
Post Reply
CBiggerstaff
Posts: 6
Joined: Thu Sep 29, 2005 3:00 am
Contact:

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

Post 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.
LarsS
Posts: 18
Joined: Mon Nov 19, 2007 8:03 pm

Post 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.
CBiggerstaff
Posts: 6
Joined: Thu Sep 29, 2005 3:00 am
Contact:

Unbeleivable

Post 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.
Mateo
Posts: 20
Joined: Tue Aug 21, 2007 10:15 am

Post 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.
jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Post 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\\*.*
Jim Oswell
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com
LarsS
Posts: 18
Joined: Mon Nov 19, 2007 8:03 pm

Post 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.
CBiggerstaff
Posts: 6
Joined: Thu Sep 29, 2005 3:00 am
Contact:

Back to question

Post 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?
jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Post by jimo »

Make sure your copy local files command is before Apply Install.
Jim Oswell
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com
Post Reply