1. Create simple project UninstallApp.
2. Add in Main()
{
string[] arguments = Environment.GetCommandLineArgs();
foreach(string argument in arguments)
{
string[] parameters = argument.Split('=');
if (parameters[0].ToLower() == "/u")
{
string productCode = parameters[1];
string path = Environment.GetFolderPath(Environment.SpecialFolder.System);
Process proc = new Process();
proc.StartInfo.FileName = string.Concat(path,"\\msiexec.exe");
proc.StartInfo.Arguments = string.Concat(" /i ", productCode);
proc.Start();
}
}
3. Create new setup project
4. Add UninstallApp.exe to "Application Folder" in 'File System' part
5. In "User's Program menu" create shortcut to UninstallApp.exe and in properties of this shortcut in parameter 'arguments' insert value "/u=[ProductCode]".
6.Rebuild deployment project.
Good luck ;)
8 comments:
Nice code.
Thanks to Gloria!
i think at line code
proc.StartInfo.Arguments = string.Concat(" /i ", productCode);
if change to
proc.StartInfo.Arguments = string.Concat(" /x ", productCode);
then msiexec will remove your deployment automatic and i not reuses my setup.msi file for remove.
Im in Viet Nam and my English very bad!
iss.Giangnx@gmail.com
Great...just what I needed.
Thanks,
-Arlind
Great...just what I needed.
Thanks,
-Arlind
It worked exactly as described, thank you!
ak
Great
Thanks a lot Gloria
This help me a lot.
Thanks,
Ferdinand Talidong
Software Development Engineer
NCR - Cebu Development Center
Philippines
great tutorial
thanks
thanks very much ... usefull
Post a Comment