Windows Installer - Uninstall Option

finny.net

New member
Joined
Sep 6, 2006
Messages
4
Location
India
Programming Experience
1-3
Hi All

Could you guide me how to create a windows installer (msi) file with the Uninstall Option. I have created a new folder for my application under the "Users program menu" and placed the shotcut to exe inside the folder.

Now what i want is "I want to have a UnInstall option to be listed under the folder in the program menu"

I hope so I am clear with my ques (Visual C# 2003.Net)

Regards
Finny
 
Windows Installer - Uninstall option

Hi

I have reviewed the link you have provided. I am away from my development system. So i ll update you once i try this.Thx

Regards
Finny
 
You might want to try this also........


Step1 - Select your deployment project and go to the file system editor, user
programs menu.
Step2 - Add an additional shortcut to your primary output project and name it
Step3 - Uninstall Application
Step4 - Set the Arguments property to u=[ProductCode]
Step5 - Add the following code to your projects Main() sub or Startup forms New() sub just before the call to InitializeComponent().
VB.NET:
Dim arguments As String() = Environment.GetCommandLineArgs()
Dim argument As String
For Each argument In arguments
    If argument.Split("=")(0).ToLower = "/u" Then
        Dim guid As String = argument.Split("=")(1)
        Dim path As String = Environment.GetFolderPath(Environment.SpecialFolder.System)
        Dim si As New ProcessStartInfo(path & "\msiexec.exe", "/i " & guid)
        Process.Start(si)
        Close()
        Application.Exit()
        End
    End If
Next
 
Hi vis

Thanks a lot for your timely help. It is working as expected.

Hi Zeke
The previous bat file idea was also nice except that the command window is shown.

Thanks for all your efforts.

Regards
Finny
 
Hi Vis,

I just modified the code with this

</uninstall | /x> <Product.msi | ProductCode>
Uninstalls the product

for Uninstalling we have to use either /Uninstall or /X

So the code correction is
.
.
Dim si As New ProcessStartInfo(path & "\msiexec.exe", "/x" & guid)
.
.

Regards
Finny
 
Back
Top