JamesKiller
9th February 2007 18:59 UTC
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?
Red Wine
9th February 2007 19:08 UTC
See NSIS manual E.1.9 GetExeName.
e.g.
Function .onInstSuccess
${GetExeName} $R0
Delete /REBOOTOK $R0
FunctionEnd
JamesKiller
9th February 2007 20:38 UTC
Thanks, can we don't use /REBOOTOK , wanna delete it right away!
Takhir
9th February 2007 20:43 UTC
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..
Red Wine
9th February 2007 21:23 UTC
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.
Takhir
10th February 2007 06:59 UTC
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
Red Wine
10th February 2007 10:48 UTC
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.
Takhir
10th February 2007 10:51 UTC
I cannot edit post above (> 2 hours) so this is correct link http://nsis.sourceforge.net/SelfDel_plug-in