Ärger mit msi Exit-Code 1625, wenn msi programmatisch ausgeführt
-
08-10-2019 - |
Frage
Exit-Code 1625 ist "Diese Installation von Systemrichtlinie verboten ist. Ihr Systemadministrator."
Was ich tue, ist es auf diese Weise aufrufen:
Process installProcess = Process.Start(msiPath, "/quiet");
Ich kann die msi gut laufen, wenn ich es manuell öffnen. Dies ist auf Windows Server 2008 ...
Die Absicht ist dies automatisch mein .net Formen Programm mit der neuesten Version zu aktualisieren. Jedes hat eine Ahnung, welche Art von Einstellung ist der Grund dafür? Ich meine, werden die Kunden mit Vista / 7 / XP werden, aber ich muss noch wissen, was Art von Sicherheitseinstellungen mein Plan ruinieren.
Lösung
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.Arguments = "/i " + "\""+Directory.GetCurrentDirectory()+"\\"+msiPath +"\"" +" /q";
startInfo.FileName = "msiexec.exe";
startInfo.Verb = "runas";
Process installProcess = Process.Start(startInfo);
Calling the msi this way did the trick.
Turned out to be some kind of UAC issue I think. The runas verb somehow elevates the permissions the program has. Even though my UAC prompts were disabled on server 2008 I still had to do this to get around it.. strange huh?