How do I copy a \"local\" file selected by the user?

Got a problem you cannot solve? Try here.
Post Reply
LarsS
Posts: 18
Joined: Mon Nov 19, 2007 8:03 pm

How do I copy a \"local\" file selected by the user?

Post by LarsS »

I have created a dialog where the user can find/select a license code file for my product. The file path/name is then stored in a variable.

After "Apply install" I want to copy this file to a folder in my target dir.

Something like this:

Copy file $LICENSFILENAME$ to $TARGETDIR$\\BinHowever the "Copy local file" action does not accept variables in the "Source files" field.

How do I do this?
jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Post by jimo »

Copy local files does accept variables. However in this case I would use Call DLL and make a call to CopyFileA in kernel32.dll
Jim Oswell
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com
Alex_Ronquillo
Site Admin
Posts: 364
Joined: Mon Jul 30, 2007 11:51 am
Location: USA
Contact:

Post by Alex_Ronquillo »

LarsS,

Jimo is right. You need to use CopyFileA from kernel32.dll because the "Copy/Move Local Files" command is one of those commands that need the apply install to take place, and if you are placing it after the apply install, then it will never occur.
Alejandro Ronquillo
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
LarsS
Posts: 18
Joined: Mon Nov 19, 2007 8:03 pm

Post by LarsS »

Thanks for the info. Will use Call DLL.

If the Source field in Copy local files does accept variables then please update the displayed dialog for the next release. Currently it specifically states that you cannot use variables.
jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Post by jimo »

LarsS,

You are correct, I misread your original post. No you can not use variables in the Source Files or the target Files Fields.

I apologize for misreading.
Jim Oswell
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com
Post Reply