I am creating an uninstall program, but I want to also remove the uninstaller. However, the uninstaller is currently running... How can I accomplish this?
Printable View
I am creating an uninstall program, but I want to also remove the uninstaller. However, the uninstaller is currently running... How can I accomplish this?
Why prevent people from uninstalling your application ( which is the way installing & uninstalling programs usually work ) ¿
I think he's talking about actually uninstalling the application...
Just a guess: You could add an item in the "RunOnce" registry key that will delete the uninstaller when the system reboots... I don't know if this would work, but the command seems to be pretty simple:
Code:del c:\path\app.exe /y
that command actually will flash a black command window on the screen, convincing a lot of users they have spyware. Not that it isn't mostly correct, but you "may" have to call cmd.exe and pass the rest as a parameter, as del doesn't actually exist as a file to run.
This mean? Mean that your program:
1 - get all References used by program that you want unistall?
2 - decrease the counter references correctly?
3 - un-register references if and only if no longer used by any other programs?
4 - delete references-file if and only if where no longer used (see 3)?
5 - save (not uninstall) references-file used by system?
6 - remove all files installed from original application setup?
7 - remove folder created from original application setup?
8 - ...........
:wave:
Yes. I have actually done all the dirty work. Now I just have one executable running. That is the uninstaller. I want to remove that uninstaller as well. This way ALL of the files are removed (even the uninstaller) So......
8 - Remove uninstaller executable by either registry 'RunOnce' of some other method.
If you use InnoSetup to create a Package then you don't need to create an uninstaller or worry about it being running after you uninstall it. It takes care of everything...Quote:
I am creating an uninstall program, but I want to also remove the uninstaller. However, the uninstaller is currently running... How can I accomplish this?
the correct way is placing a command the system itself will run when it feels like it. Runonce is usually the place and some programs such as spybot actually use a shelled del command. Personally i don't like that because of the black screen you get, but it doesn't leave ANY traces behind.
as for administrator privelages someone else was going on about... an uninstaller program MUST have admin privelages or windows won't let the program be uninstalled anyway. Prevents limited users from screwing up a system.
1) try to use a .BAT or
2) try to use something like "unlock opened files".
Good luck
Here's code that deletes an exe from the Form_Unload of that exe. You can probably adapt it to your purpose.
BTW, I sent you a PM yesterday that you haven't reponded to yet.
Code:Private Sub Form_Unload(Cancel As Integer)
Open App.Path & "\del.bat" For Output As #1
Print #1, ":start"
Print #1, "@echo off"
Print #1, "cls"
Print #1, "del " & Chr$(34) & App.Path & "\" & App.EXEName & ".exe" & Chr$(34)
Print #1, "if exist " & Chr$(34) & App.Path & "\" & App.EXEName & ".exe" & Chr$(34) & " goto start"
Print #1, "del " & Chr$(34) & App.Path & "\" & "del.bat" & Chr$(34)
Close #1
Shell App.Path & "\" & "del.bat"
End Sub
Thanks, I will try that!
Oh, and the PM... meant to take care of that... Sorry!:blush:
EDIT:
There you go!
Sorry for the initial confusion VBNetDude, I didn't read properly :)