Team deletion is completed only in release mode

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.
  • .

? . .

+3
5

, . , -, . . , - - http://technet.microsoft.com/en-us/library/cc782435.aspx - t, , .

[. , LocalSystem , .]

+1

1: MSI

, LocalSystem.

, . , .

/ " " HKCU , dirs, c:\windows\temp

+2

, SYSTEM , , .

MSI , "", MSIINV.EXE , "", ( , ) http://blogs.msdn.com/brada/archive/2005/06/24/432209.aspx

, , , , Windows . , Vista UAC, ...

+2

. LocalSystem (, Windows Update Active Directory ), .

, , ?

0

@Paul Lalonde

InnoSetup. InnoSetup, , . , , Local System.

, -. , LocalSystem, , . . LocalSystem , . . !

0

Source: https://habr.com/ru/post/1696790/


All Articles