Page 1 of 1

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

Posted: Tue May 20, 2008 6:03 pm
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?

Posted: Wed May 21, 2008 1:57 pm
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

Posted: Thu May 22, 2008 1:54 pm
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.

Posted: Thu May 22, 2008 6:16 pm
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.

Posted: Sun May 25, 2008 5:45 pm
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.