Making Your Own Uninstall (Since there is no way to get a shortcut in your Setup)
Let's you launch the uninstall for your application from within your app
AI
AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Source Code
For better/easyer reading, i just zipped a text file with some better fortmatting. Article below:
I have been searching my a-s-s off to get a nice uninstall shortcut in my start menu for my own programs. But the setup and deployment does not allow me to.
Here is what i did:
Make a setup for your program with the .NET tool, in it's properties, you see a product code (for my prog it's {75FE729D-69D4-4B86-9010-052770DE341F} for example).
In the add/remove programs window in your software window, your app is listed, and if you click remove, it's launched this way:
system32 dir \ MsiExec.exe /I{product code}
so, to do this yourself, in your application, you can do this:
Private Sub Uninstall()
Dim myProcess As Process = New Process
Dim s As String
' get the System path
Dim sysFolder As String = _
System.Environment.GetFolderPath _
(Environment.SpecialFolder.System)
' set the file name and the command line args
myProcess.StartInfo.FileName = "cmd.exe"
myProcess.StartInfo.Arguments = "/C cd " & _
sysFolder & " && MsiExec.exe /I{75FE729D-69D4-4B86-9010-052770DE341F} && exit"
' start the process in a hidden window
myProcess.StartInfo.WindowStyle = _
ProcessWindowStyle.Hidden
myProcess.StartInfo.CreateNoWindow = True
myProcess.Start()
' if the process doesn't complete within
' 0.5 second, kill it
myProcess.WaitForExit(500)
If Not myProcess.HasExited Then
myProcess.Kill()
End If
myProcess.Close()
Me.Dispose()
End Sub
Now, you have launched a CMD windows, that launches the uninstall for your application.
Hope it helped.
CMG
Original Comments (3)
Recovered from Wayback Machine