I have created an install project for my application and need to have the PC reboot after the install is complete (user must be allowed to choose to reboot now or later). Anyone know how to do this???
Printable View
I have created an install project for my application and need to have the PC reboot after the install is complete (user must be allowed to choose to reboot now or later). Anyone know how to do this???
If your setup needs the user to reboot, it'll prompt him/her to do it.
It's up to MSI to decide whether system needs to reboot or not, not you
Why would the system need to reboot anyway? The only time that is needed is when you're installing a driver that needs to be initialized before everything else (if it's something like a USB device it shouldn't need to reboot) or if you're doing an update/replace of major system file(s).
Well the install needs to reboot because we have found issues when environment variables are set Windows does not always make them available. We have noticed if we reboot manually after every install the applications are able to get at the environment variables.
What version(s) of windows have you had this issue with and how are you setting up the environment vars? With my experimentation with install GCC and other components, I was constantly changing the environment variables and never had an issue where I had to restart before I could use them.
The issue could be something else...
I am using a custom action when the install is finished and adding the values to the registy. The OS is Win2k.
(Ya I know this is C# code so no one has to tell me.)
Code:RegistryKey envKey = Registry.LocalMachine.OpenSubKey("System\\CurrentControlSet\\Control\\Session Manager\\Environment", true);
//Add the new environment variables.
//
envKey.SetValue("VAR1","Value1");
envKey.SetValue("VAR2","Value2");
envKey.SetValue("DIR", this.Context.Parameters["TargetDir"].ToString());
envKey.Close();