Archive: Self-destruction?


Self-destruction?
Hi everyone~
i'm novice at programing or languge stuff.
and I like to make Self-Destructioning Install file.
(Install and delete itself)
do you have any experience?
plz, let me know.
I wish NSIS team make a option to makensis.exe something like
/selfkill , in future release...:D

TIA, and sorry for my poor English.
= CoffeeGhost =


I don't think that it is possible. But why do you want to do this anyway? :confused:


I dont like to leave installer on user's hdd.
cause it's some kind of private contents.

I think it's possible, but it's too difficult and dizy stuff to me.
(make copy to temp, run that, delete orginal leave xxx.bat del all)

but i wish, future or other release of NSIS have
a password protection or self-destruction. :)

= CoffeeGhost =


Your situation may be special, but it is generally a bad idea for installers to self-destruct. Here's a possible technique you can use to workaround:

First prepare a "Self-Destruct" temporary NSIS program. Write a script that starts by reading from a specific spot in the registry, this will be the location of your installer. Then tell it to delete the string you just read.

In your real installer, write the installer directory and name to the registry in the main section of your script. Include the pre-compiled "Self-Destruct" installer in your script and extract it to temp, then run it at the end of your script.

-=G=-


Sorry, it is impossible to (executable) files to commit suicide (self-destruct) under Windows OSes.


Thanks a lot, Gonzoek.
probably, my head will be overheat, today :)

also thanks, Repzion.
but maybe it can possible by installer in installer,
or making something like batch file to delete installer,
or combination of both.

welcome any new idea
= CoffeeGhost =


Here try this:

After the Installer is created ...


Section Uninstall
;Uninstaller stuff
Section end

Section -post
;post install
Section End

Function .onInstSuccess
Delete $EXEDIR\exeinstaller.exe
FunctionEnd


-Duane
P.s. Windows DOES have a way for EXEs to delete them selves or an Uninstaller (Not the NSIS uninstallers) wouldn't work.

Hi DuaneJeffers

I'm agree, but unfortunately that was not worked.
and finally I made 3 seperate nsi.
#1 for extract #2 & #3 to temp dir and excute #3,
#2 for pure installing my apps &
#3 for excute #2 and delete #1 & #2.
(#3 remains in temp dir. (but I dont care.))
It's really dirty way :D

grateful to all of you
= CoffeeGhost =


.bat
wouldnt it be easier to try and write a batch file to do all this dirty work?