setup and deployment
-
Hello friends, I am developing an windows application setup project using setup wizard. now what i want to add uninstall feature in setup application. So how can i add uninstall feature to setup project...
Add the Following to the beginning of your Applications Main()
# region For UnInstaller string[] arguments = Environment.GetCommandLineArgs(); foreach (string argument in arguments) { if (argument.Split('=')[0].ToLower() == "/u") { string guid = argument.Split('=')[1]; string path = Environment.GetFolderPath(Environment.SpecialFolder.System); ProcessStartInfo si = new ProcessStartInfo(path + "\\msiexec.exe", "/x " + guid); Process.Start(si); Application.Exit(); Environment.Exit(0); } } # endregion
Go to the Installer project and add a shortcut to the Primary output and rename it to Uninstall <Application Name> Go to the Properties of the newly added shortcut and Set the Arguments property to "/u=[ProductCode]" Place the shortcut in the user's programs menu. Create a build and your application is ready with Uninstaller. thankskss