How to make Uninstaller?
How to make Uninstaller?
Hi everyone!
I was not able to find a good way to delete a folder with a program where the program is running (under Windows 10).
I don't want to use a program like the Inno Setup (because I wrote already my own Installer)
I used to use a script but now the Windows defender reports that this is a virus and this way doesn't work any more.
I found a solution here but it requires an Administration mode, that is unacceptable for me.
Could anyone advice me something?
I was not able to find a good way to delete a folder with a program where the program is running (under Windows 10).
I don't want to use a program like the Inno Setup (because I wrote already my own Installer)
I used to use a script but now the Windows defender reports that this is a virus and this way doesn't work any more.
I found a solution here but it requires an Administration mode, that is unacceptable for me.
Could anyone advice me something?
Re: How to make Uninstaller?
You should be able to tell Windows that it is not a virus. I don't know where to report this.
Avira has a special page for reporting this and it has always worked so far.
Maybe extend the programme with some unnecessary function (e.g. image). Sometimes it also helps that the programme no longer displays a virus message.
Avira has a special page for reporting this and it has always worked so far.
Maybe extend the programme with some unnecessary function (e.g. image). Sometimes it also helps that the programme no longer displays a virus message.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: How to make Uninstaller?
Check NSIS and how they do it.
Re: How to make Uninstaller?
Did you try to copy your uninstaller.exe to GetTemporaryDirectory() and run it from there?
Re: How to make Uninstaller?
Yes, this is the right method, that's how the uninstaller works (since windows 3.x)
The program copies itself into %temp%, then terminates and starts its copy.
No security problem because the temporary directory is personal to each user (and to the admin) and is not on the network.
Re: How to make Uninstaller?
Last time i tried that, my windows AV blocked it and quarantined my exe - an exe that creates another exe and runs it, is a common trojan behaviour Sadly that is no joke.
Re: How to make Uninstaller?
Hi,
Yes, an EXE that creates an EXE is indeed seen as a virus, but an EXE that Copy itself elsewhere (on same disk) should not be seen as a virus since the original is already present on the disk (so already scanned)
(Change AV)
Re: How to make Uninstaller?
Inno Setup, NSIS, InstallShield, etc. are programs whose behavior is already known to Windows (and signed), which is why their operation does not trigger virus alerts, unlike the program that you create yourself and that seek to delete files and folders without manual intervention by the user.
It is very easy to make a setup with Inno Setup, there is a wizard for the basic operations.
Don't bother to create your own which will be blocked by users' AVs.
The latest version even allows you to create installers that do not require the administrator privilege (as long as you create standard programs)
It is very easy to make a setup with Inno Setup, there is a wizard for the basic operations.
Don't bother to create your own which will be blocked by users' AVs.
The latest version even allows you to create installers that do not require the administrator privilege (as long as you create standard programs)
Re: How to make Uninstaller?
I agree that Inno Setup, NSIS, InstallShield, msi,... are well proven and the way to do it safely
If you still want to do it yourself, defender or other AVs should not CRY out if you do it with a command line
Code: Select all
Define Program.s = ProgramFilename()
Define ProgramName.s = GetFilePart(Program)
Define ProgramPath.s = RTrim(GetPathPart(Program), "\")
Define Message.s = "This exe " +#DQUOTE$+ ProgramName +#DQUOTE$+ " will be deleted in 2 seconds." +#CRLF$+
"And the folder containing this exe will be deleted as well." +#CRLF$+#CRLF$+
"So be CAREFUL on the Path to avoid deleting other things accidentally!" +#CRLF$+#CRLF$+
"Path: " +#DQUOTE$+ ProgramPath +#DQUOTE$
If MessageRequester("Self Deleting Exe Example", Message, #PB_MessageRequester_YesNo) = #PB_MessageRequester_Yes
RunProgram(GetEnvironmentVariable("Comspec"),"/C Timeout 2 && Del /F /Q " +#DQUOTE$+ Program +#DQUOTE$+ " && Rd /S /Q " +#DQUOTE$+ ProgramPath +#DQUOTE$, GetEnvironmentVariable("Windir") + "\System32", #PB_Program_Hide)
EndIf
Re: How to make Uninstaller?
Thanks, I'll check this string, but I don't know why , but
Code: Select all
RunProgram(GetEnvironmentVariable("comspec"), "timeout 2 & /c del "+Chr(34)+ProgramFilename()+Chr(34),"", 2)
P.S. After a lot of hours of searching & creation my own installer&uninstaller I decided to return to Inno Setup
Re: How to make Uninstaller?
It's a good choice, it's proven and it's quite simple with the Inno Setup Script Wizard, you should like it. This is the installer used for PB.
- RichAlgeni
- Addict
- Posts: 914
- Joined: Wed Sep 22, 2010 1:50 am
- Location: Bradenton, FL
Re: How to make Uninstaller?
Not sure if you're still interested, but this may help: viewtopic.php?p=573461#p573461
Re: How to make Uninstaller?
I notice the same problems even using temp folder. Aggressive antivirus blocking.
It does not happen with "C:\MyApp\" folders though.
Only with "C:\Program Files\" and "C:\~Temp\" directories.
It does not happen with "C:\MyApp\" folders though.
Only with "C:\Program Files\" and "C:\~Temp\" directories.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum