Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 9th February 2007, 17:59   #1
JamesKiller
Senior Member
 
Join Date: Jan 2007
Posts: 125
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?
JamesKiller is offline   Reply With Quote
Old 9th February 2007, 18:08   #2
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
See NSIS manual E.1.9 GetExeName.

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

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 9th February 2007, 19:38   #3
JamesKiller
Senior Member
 
Join Date: Jan 2007
Posts: 125
Thanks, can we don't use /REBOOTOK , wanna delete it right away!
JamesKiller is offline   Reply With Quote
Old 9th February 2007, 19:43   #4
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
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..
Takhir is offline   Reply With Quote
Old 9th February 2007, 20:23   #5
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
Quote:
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.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS

Last edited by Red Wine; 9th February 2007 at 20:54.
Red Wine is offline   Reply With Quote
Old 10th February 2007, 05:59   #6
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
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

Last edited by Takhir; 10th February 2007 at 08:23.
Takhir is offline   Reply With Quote
Old 10th February 2007, 09:48   #7
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
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.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 10th February 2007, 09:51   #8
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
I cannot edit post above (> 2 hours) so this is correct link http://nsis.sourceforge.net/SelfDel_plug-in
Takhir is offline   Reply With Quote
Reply
Go Back   Winamp 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