I can successfully uninstall a third-party application through the command line and through the special Inno Setup installer.
Command line execution:
MSIEXEC.exe /x {14D74337-01C2-4F8F-B44B-67FC613E5B1F} /qn
Inno Installation Command:
[Run]
Filename: msiexec.exe; Flags: runhidden waituntilterminated;
Parameters: "/x {{14D74337-01C2-4F8F-B44B-67FC613E5B1F} /qn";
StatusMsg: "Uninstalling Service...";
I can also uninstall the application programmatically while executing the following C # code in debug mode.
C # code:
string fileName = "MSIEXEC.exe";
string arguments = "/x {14D74337-01C2-4F8F-B44B-67FC613E5B1F} /qn";
ProcessStartInfo psi = new ProcessStartInfo(fileName, arguments)
{
CreateNoWindow = true,
UseShellExecute = false,
RedirectStandardOutput = true
};
Process process = Process.Start(psi);
string errorMsg = process.StandardOutput.ReadToEnd();
process.WaitForExit();
However, the same C # code produces the following error output when starting as a compiled deployed Windows service:
"This action is only valid for products that are currently installed."
Additional comments:
- The Windows service that issues the delete command runs the same computer as in debug mode. Windows Service starts / registers as a local system account.
- I consulted application logs and I confirmed that the command's executable arguments are the same in both debug and release modes.
- .
? . .