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"
Archive: CopyFile problems
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"
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.
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.
CopyFiles "$INSTDIR\IWARN.bat" "$DESKTOP\IWARN.bat"
Or
Rename "$INSTDIR\IWARN.bat" "$DESKTOP\IWARN.bat"
-Stu
Looking at the docs, CopyFiles shouldn't need you to specify a destination file name (just the folder). Have I missed something?
:confused:
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.