Reputation: 55
I have a problem starting a process to execute installation of specified installer in quiet mode with no restart.
This is my code:
public int InstallUpdate(string installerLocation)
{
Process p = new Process();
p.StartInfo.UseShellExecute = true;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.FileName = "msiexec";
p.StartInfo.Verb = "runas";
p.StartInfo.Arguments = "/i " + installerLocation + " /qn /norestart";
p.Start();
p.WaitForExit();
return p.ExitCode;
}
This is called from a dll loaded in AutoCAD (plugin). It used to work perfectly fine up until recently, but now when installation is finished AutoCAD shuts down, and the /norestart is ignored.
The idea is to execute installer from AutoCAD quietly and inform the user if installation is successful and that AutoCAD needs to be restarted in order for the changes to take place. But now, right after the successful installation AutoCAD is shut down, so it looks like it crashes.
These are few last messages from installation log:
MSI (s) (14:68) [11:18:20:810]: RESTART MANAGER: Will attempt to shut down and restart applications in no UI modes. MSI (s) (14:68) [11:18:20:810]: Note: 1: 2205 2: 3: Error MSI (s) (14:68) [11:18:20:810]: Note: 1: 2228 2: 3: Error 4: SELECT
Message
FROMError
WHEREError
= 1607 MSI (s) (14:68) [11:18:20:810]: Note: 1: 2205 2: 3: Error MSI (s) (14:68) [11:18:20:810]: Note: 1: 2228 2: 3: Error 4: SELECTMessage
FROMError
WHEREError
= 1607 MSI (s) (14:68) [11:18:20:827]: Note: 1: 2205 2: 3: ActionText MSI (c) (E8:DC) [11:18:20:812]: RESTART MANAGER: Session opened. MSI (s) (14:68) [11:18:20:951]: RESTART MANAGER: Successfully shut down all applications in the service's session that held files in use. MSI (c) (E8:DC) [11:18:20:952]: RESTART MANAGER: Successfully shut down all applications that held files in use.
When it was working OK, RESTART MANAGER messages didn't appear. Any ideas on how to fix this?
Upvotes: 0
Views: 85