Skip to content
⌘ NSIS Forum Archive

Copying files

5 posts

tieum#

Copying files

Hello,

I try to copy a file created on the desktop to the Start menu:

CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
DetailPrint "Copy: $DESKTOP\$LINK_NAME.lnk $SMPROGRAMS\$ICONS_GROUP"
CopyFiles '"$DESKTOP\$LINK_NAME.lnk"' '"$SMPROGRAMS\$ICONS_GROUP"'

Output shows

Create folder: C:\Documents and Settings\All Users\Start Menu\Programs\MyProgram
Copy: C:\Documents and Settings\All Users\Desktop\MyLink.lnk C:\Documents and Settings\All Users\Start Menu\Programs\MyProgram
Copy to "C:\Documents and Settings\All Users\Start Menu\Programs\MyProgram"
Copy failed

After installation, I verified and "C:\Documents and Settings\All Users\Desktop\MyLink.lnk" exists

What's wrong here? Why the file did not copy?

Thanks,


Tieum
Afrow UK#
With CopyFiles you must specify the file name for the distination path as well as the folder.

-Stu
tieum#
1. I tried with

CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
DetailPrint "Copy: $DESKTOP\$LINK_NAME.lnk $SMPROGRAMS\$ICONS_GROUP"
CopyFiles '"$DESKTOP\$LINK_NAME.lnk"' '"$SMPROGRAMS\$ICONS_GROUP\"$LINK_NAME.lnk'

and this does not work either

2. Doc example does not use filename

CreateDirectory $INSTDIR\backup
CopyFiles $INSTDIR\*.dat $INSTDIR\backup

Any other idea?

Thanks,

Tieum
Instructor#
CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
CopyFiles "$DESKTOP\$LINK_NAME.lnk" "$SMPROGRAMS\$ICONS_GROUP"
One quote
Afrow UK#
The documentation example you have posted does not specify the file name for the destination copy because the first parameter specifies any *.dat files rather than a single file to copy.

-Stu