Menu

#120 Delete "$TEMP\~nsu.tmp" directory on reboot

closed-accepted
NSIS (71)
5
2007-02-17
2007-02-15
sebarnolds
No

Hi.

I discovered that the Au_.exe file of $TEMP\~nsu.tmp directory was deleted on reboot after having uninstalled a program but the $TEMP\~nsu.tmp directory was not being removed.

It is not anything major but I think it would be cleaner to remove it on reboot too. I checked a bit the documentation and found out about MoveFileEx, the function your are using to remove the exe. It seems ti works also with directories and I checked : it works well. I applied my patch to my NSIS source, recompiled and tried my installer and the uninstaller temp directory is correctly removed.

You'll find my patch attached to this message. Note that I had to modify the MoveFileOnReboot function because you were using a special flag (OVERWRITE_EXISTING) when calling the Win API function MoveFileEx. When using this flag, it is impossible to rename a directory.

Hope it will be useful.

Sebastien

NB: Original thread about this:
http://forums.winamp.com/showthread.php?s=&postid=2130110

Discussion

  • sebarnolds

    sebarnolds - 2007-02-15

    Diffs against original source files

     
  • Amir Szekely

    Amir Szekely - 2007-02-17

    Logged In: YES
    user_id=584402
    Originator: NO

    Thanks, added the extra MoveFileOnReboot call. There is no need to remove OVERWRITE_EXISTING as deleting folders works with it. MSDN is probably referring to actually moving a file and not deleting it. And even if it doesn't work sometimes, I'm OK with leaving this folder as been done since the change mentioned in the forum thread.

     
  • Amir Szekely

    Amir Szekely - 2007-02-17
    • labels: --> NSIS
    • assigned_to: nobody --> kichik
    • status: open --> closed-accepted
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.