This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- How to restart IIS7 automatically in install?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Oct 19, 2009
01:31 PM
How to restart IIS7 automatically in install?
After I create my applications in IIS, my webservice is failing to pickup a dll in the GAC. The webservice doesn't start to work until I restart IIS. Is there a way to do this automatically in the install?
I see there is the "Restart Web Server After Configuring IIS" but it says "IIS 6 or earlier only"
I see there is the "Restart Web Server After Configuring IIS" but it says "IIS 6 or earlier only"
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Oct 19, 2009
01:54 PM
I use this in a InstallScript custom action:
function IISReset(hMSI)
STRING szProgram, szArgs;
NUMBER nvExitCode, nvResult, nvSize;
begin
if(GetEnvVar("windir", szProgram) < 0) then
MessageBox ("Environment variable windir not found.", SEVERE);
abort
endif;
// Declare paths
szProgram = szProgram^"system32\\iisreset.exe";
szArgs = "/RESTART";
//MessageBox (szProgram + "\n" + szArgs, INFORMATION); /* DEBUG */
nvResult = LaunchAppAndWait(szProgram, szArgs, WAIT);
nvExitCode = LAAW_PARAMETERS.nLaunchResult;
if (nvResult < ISERR_SUCCESS) then
MessageBox("iisreset.exe could not be launched",SEVERE);
else
if (nvExitCode != 0) then
MessageBox("iisreset.exe could not reset IIS",SEVERE);
endif;
endif;
end;