Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 18th August 2006, 13:20   #1
Potz
Member
 
Join Date: Jun 2006
Posts: 71
CopyFile problems

I am having trouble copying files. I have looked at help from the NSIS User Manual and this forum but it looks like I am doing the right thing. Here is my code for it.


!define FileCopy


CopyFiles "$INSTDIR\IWARN.bat" "$DESKTOP"
Potz is offline   Reply With Quote
Old 18th August 2006, 14:44   #2
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
Seems your code should work. But, a few things you might look at:
- Does the user have the ability to write to the desktop?
- Does the file "IWARN.BAT" exist in $INSTDIR? (you might want to place a messagebox just before the file copy as a troubleshooting step to make sure $INSTDIR and $DESKTOP are set to where you think they should be.)

And what is the purpose of having ${FileCopy}? It doesn't seem to be used in your example.
Comperio is offline   Reply With Quote
Old 18th August 2006, 15:00   #3
Potz
Member
 
Join Date: Jun 2006
Posts: 71
I know I have been moving things around with $INSTDIR and $DESKTOP so that shouldn't be a problem. I know the file exists and it is writable to desktop.

what I am trying to do is move a shortcut from the $INSTDIR and put it on the desktop. I was trying to figure out how to use the CreateShortCut option but I figured if I already have one I can just have it moved.
Potz is offline   Reply With Quote
Old 18th August 2006, 15:16   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,216
CopyFiles "$INSTDIR\IWARN.bat" "$DESKTOP\IWARN.bat"

Or

Rename "$INSTDIR\IWARN.bat" "$DESKTOP\IWARN.bat"

-Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 18th August 2006, 16:33   #5
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
Looking at the docs, CopyFiles shouldn't need you to specify a destination file name (just the folder). Have I missed something?
Comperio is offline   Reply With Quote
Old 18th August 2006, 16:43   #6
Potz
Member
 
Join Date: Jun 2006
Posts: 71
Ok it works now. I guess when I had the files unzip there were other folders made and I didn't realize it. Thanks for your help. you are right about not having to specify a destination file name. But I think you can if you want to rename it.
Potz is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump