Archive: After installation, want to delete the setup.exe file


After installation, want to delete the setup.exe file
Hi All,

Our installer is just for upgrading our software, so it requires to be run in silent mode.
After installing it, we do want to delete the setup file ( for example : setup.exe [outfile "setup.exe] in .nsi file).
The question is how i can detect where this file (setup.exe) is? this file will be copied in some locations in hard drive.
is it possible to detect this file first, then get the path of this file and delete it?


See NSIS manual E.1.9 GetExeName.

e.g.
Function .onInstSuccess
${GetExeName} $R0
Delete /REBOOTOK $R0
FunctionEnd


Thanks, can we don't use /REBOOTOK , wanna delete it right away!


I see the same question only few lines below http://forums.winamp.com/showthread....hreadid=265448 - how to delete itself without reboot. Not tested on Vista yet..


Originally posted by Takhir
I see the same question only few lines below http://forums.winamp.com/showthread....hreadid=265448 - how to delete itself without reboot. Not tested on Vista yet..
I've seen the mentioned thread too and I noticed a strange behaviour.
Anyway, it doesn't even work in silent mode.

Looks like I must add plug-in description to wiki with good samples :)
I wrote earlier that in the silent mode installer not creates GUI and not calls .onGuiEnd. Last hidden section with the only line can work in both modes, but cursor on the finish page becomes 'waiting'. Finally I see that .onInstSuccess is a very simple solution :) Works in all modes (incl. MUI and silent). wiki archive SelfDel
Edited: SelfDel plug-in page


Cool! .onInstSuccess works fine and also covers the posted query on the top of the thread about how to self delete a silent installer.
However the link is an empty page on wiki.


I cannot edit post above (> 2 hours) so this is correct link http://nsis.sourceforge.net/SelfDel_plug-in