Old 20th April 2011, 19:43   #1
Gridly
Junior Member
 
Join Date: Apr 2011
Posts: 2
Problem with Delete

I am trying to backup some files that my install clobbers, and then restore them on uninstall. In the main section (where all the files are added) I do a bunch of:

CopyFiles "$INSTDIR/my/dir/my.fil" "$INSTDIR/my/dir/my.fil.bak"

In the Uninstall section, I do a bunch of:

CopyFiles "$INSTDIR/my/dir/my.fil.bak" "$INSTDIR/my/dir/my.fil"
..
..

followed by:

Delete "$INSTDIR/my/dir/my.fil.bak"
..
..

After the install is done, the .bak files are all still there. The copies work, but the Deletes fail, even though the Deletes that uninstall the installed files work fine.

I tried putting "sleep 5000" between the copies and the deletes. I tried moving the deletes to the un.onUninstSuccess function. No luck.

Is this a known issue? Something silly I may be doing? I am using NSIS 2.46 on WinXP Pro.

Thanks,
Gridly
Gridly is offline   Reply With Quote
Old 20th April 2011, 21:39   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Check the paths with a MessageBox. Also I assume you're using backstrokes not forward strokes in your paths. This is Windows not Unix.

Stu
Afrow UK is offline   Reply With Quote
Old 21st April 2011, 18:10   #3
Gridly
Junior Member
 
Join Date: Apr 2011
Posts: 2
I was using the Unix style path separator. Old habits die hard. That seems to have fixed it. Odd that they work with CopyFiles, but not with Delete. I moved to the "copy->delete" model after Rename failed. Maybe that was the slashes too and it will work now.

Thanks for catching that. It was something silly I was doing after all.

Gridly
Gridly is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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