|
|
#1 |
|
Junior Member
Join Date: Feb 2007
Posts: 19
|
delete setup.exe as last action?
Hi,
I need to delete my NSIS 'setup.exe' as last step of the setup itself. I can not use a BAT-file which calls setup.exe first and then deletes the file. Can a NSIS setup delete it's own setup.exe as last action? TIA, xirisone |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
|
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Feb 2007
Posts: 19
|
do I have to replace 'SelfDel' with the name of my MySetup.exe in your example.nsi?
!define APP_NAME SelfDel # old !define APP_NAME MySetup # new TIA, xirisone (newbie) |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Feb 2007
Posts: 19
|
@Takhir
got you dll working - nearly.... Problem: link and folder 'unsd' are not deleted. My script attached. Did I include the code from your example.nsi wrongly? TIA, xirisone |
|
|
|
|
|
#5 |
|
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
Included sample removes uninstaller, if you want to remove setup.exe use following code
but please note that in the silent mode this may not work (no function call in NSIS). The same line at the end of last mandatory section should work always, but cursor on the finish page will be with 'waiting'.code: |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Feb 2007
Posts: 19
|
@Takhir
removing the setup.exe works fine with you example, the link and the folder 'unsd' are not deleted. Could you check my test.nsi? That would be VERY nice. TIA, xirisone |
|
|
|
|
|
#7 |
|
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
I guess you don't need to create links at all. The sample included to SelfDel.zip describes the most complex situation - uninstaller deletion inplace. To simulate uninstall it creates subdir, writes uninstaller and creates link (simulating start menu). You don't need this, just add the only line from my post above after # prepare automatic delete of Installer....
BTW I re-tested included to zip sample and it worked as requested. Uninstaller auto deletes itself, this not require a plug-in. |
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Feb 2007
Posts: 19
|
@Takhir
You're right!!!! Just using: Function .onGUIEnd SelfDel::del FunctionEnd does the job. Thank you VERY much! xirisone |
|
|
|
|
|
#9 | |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
Quote:
It deletes the installer and nothing is installed. Compile the following example and hit cancel on some page. Not the best behaviour if I've downloaded a large (e.g. 100 mb) installer on a slow internet connection and I have to download again and perhaps I'll get again the same strange result. Perhaps you should add a messagebox informing users not to click cancel otherwise they have to re-download the installer. code: 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 |
|
|
|
|
|
|
#10 |
|
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
Just to keep xirisone informed: SelfDel plug-in page
Last edited by Takhir; 10th February 2007 at 09:47. |
|
|
|
|
|
#11 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
@ Takhir,
probably you need to update the above provided link, currently it is a link to page that doesn't exist. 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 |
|
|
|
|
|
#12 |
|
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
Thanks, Red Wine. Updated.
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|