On application Uninstall I need to remove all the msi files that I have in a folder. Currently I have a custom action that calls an executable and it goes throw all the msi files in that directory and starts a new Process to remove each msi. When i do this, I see the console window of my executable but when I check the control panel, it does not remove those msi's.
Any idea on how I can perform these application removal during my Uninstall?
Here is what's done in the executable:
foreach (string updaterFile in Directory.GetFiles(updatesDirectory))
{
try
{
string args = string.Format("/x \"{0}\" /passive", updaterFile);
var process = new Process();
process.StartInfo = new ProcessStartInfo
{
WorkingDirectory = Environment.SystemDirectory,
FileName = "msiexec.exe",
Arguments = args,
CreateNoWindow = true,
WindowStyle = ProcessWindowStyle.Normal
};
process.Start();
process.WaitForExit();
}
catch(Exception ex)
{
throw new Exception("ERROR: " + ex.Message);
}
}
FOLLOW US
Get the latest news in Application Packaging