- NSIS Discussion
- ~nsu.tmp directory in $TEMP
Archive: ~nsu.tmp directory in $TEMP
sebarnolds
15th February 2007 09:06 UTC
~nsu.tmp directory in $TEMP
Hi.
I noticed something strange about the uninstaller. When I run it, it copies itself to "$TEMP\~nsu.tmp\Au_.exe", run it and exit itself. By doing so it allows the removal of the "official" uninstaller executable.
I noticed that the "$TEMP\~nsu.tmp\Au_.exe" file is only removed after reboot. However the "$TEMP\~nsu.tmp" directory is not removed. Is it normal ? I guess it shouldn't be too annoying to stay with an empty temp directory but it would be much cleaner to delete it.
Any idea / remarks about this ?
Thanks,
Sebastien
Red Wine
15th February 2007 09:16 UTC
This is the way that uninstaller is programed to operate, not a big deal I guess leaving an empty dir into $TEMP.
sebarnolds
15th February 2007 09:18 UTC
Yeah, but it would be cleaner if the uninstaller copied itself to something like "$TEMP\$name.exe" instead of in a directory of his own... where $name is the result of a call to GetTempFileName. No ?
Sebastien
Red Wine
15th February 2007 09:37 UTC
I couldn't say, being open source, NSIS offers abilities to modify it in the way it suits your needs, moreover if you have added a feature yourself, you can post the source code in the patch tracker,
http://sourceforge.net/tracker/?atid...49&func=browse
sebarnolds
15th February 2007 09:59 UTC
Maybe we could have some input from NSIS developers as the case may have been thought and they could have thought of potential problems with that approach ?
Sebastien
{_trueparuex^}
15th February 2007 11:53 UTC
Originally posted by sebarnolds
Yeah, but it would be cleaner if the uninstaller copied itself to something like "$TEMP\$name.exe" instead of in a directory of his own... where $name is the result of a call to GetTempFileName. No ?
Sebastien
In older NSIS versions it worked just like that. I don't know why it was changed, but I bet there is a reason for it.
onad
15th February 2007 11:56 UTC
Yes there is a reason for it. From top of my head I do not recall why, only I remember was involved back then in some scenario's that benefited having a separate directory.
pengyou
15th February 2007 12:38 UTC
From the Changelog for NSIS 2.08 (released on July 23rd, 2005):
Made uninstallers copy themselves into a subdirectory of the temporary directory to avoid DLLs left in the temporary directory from being loaded by the uninstaller (patch #1214319)
sebarnolds
15th February 2007 13:52 UTC
Hey.
Yeah, thanks for your remarks.
I wrote a patch to remove the directory too. The description can be found here :
https://sourceforge.net/tracker/?func=detail&atid=373087&aid=1660626&group_id=22049
Hope it will be useful,
Sebastien