views:

110

answers:

1

Im using inno setup 5.3 latest to package my vb.net application. Im setting Environment variables during installation to the windows system. It needs a reboot of the system to implement the changes made in the Environment variables. How do i prompt the user to reboot the system so as to implement changes ( as done in many applications). Is there any sample iss code for reference.

+1  A: 

You may use the [Setup]: AlwaysRestart setting.

[Setup]
AlwaysRestart = yes    

Alternativly you could use the ChangesEnvironment setting in the [Setup] section which may be more adequate in your case. The advantage is, that the user doesn't need to restart the system.

[Setup]: ChangesEnvironment
When set to yes, at the end of the installation Setup will notify other running applications (notably Windows Explorer) that they should reload their environment variables from the registry.

splash
Always restart works for me fine individually, but when i use it with dotnetfx setup installer which includes code to install dot net 3.5 if not there in the system, AlwaysRestart does not have any effect. Is there any other code which will override AlwaysRestart.
Naresh
Maybe you have `RestartIfNeededByRun=false` somewhere in your code. Have you tried to set `UseSetupLdr=false`?
Vantomex