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
- :
- Activating Windows features (IIS) from InstallScript Project
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
‎Feb 20, 2013
06:00 AM
Activating Windows features (IIS) from InstallScript Project
Hello,
I'm working on an InstallScript project and I need to set as prerequisite that the user must have the IIS installed and activated.
Is there a way to achive this from inside the project?
Otherwise, which would be the correct way to do this?
Thanks in advance.
Alejandro
I'm working on an InstallScript project and I need to set as prerequisite that the user must have the IIS installed and activated.
Is there a way to achive this from inside the project?
Otherwise, which would be the correct way to do this?
Thanks in advance.
Alejandro
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 22, 2013
08:20 AM
Alejandro,
With InstallScript, you could try something like this:
To verify that the IIS Admin and W3SVC services are not disabled, check these registry keys. A "Start" value of 0x00000004 means the service's startup type is Disabled. You can test the value by just comparing it to "4".
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\IISAdmin
[Start]
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W3SVC
[Start]
HTH
With InstallScript, you could try something like this:
OBJECT objIISRoot;
...
// Check for IIS
try
set objIISRoot = CoGetObject("IIS://Localhost/W3svc", "");
if IsObject( objIISRoot ) then
//IIS is installed; might want to check version number
else
//error: Couldn't verify IIS (couldn't get root virtual directory)"
endif;
catch
//error: Unable to verify the existence of IIS on this system.
endcatch;
To verify that the IIS Admin and W3SVC services are not disabled, check these registry keys. A "Start" value of 0x00000004 means the service's startup type is Disabled. You can test the value by just comparing it to "4".
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\IISAdmin
[Start]
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W3SVC
[Start]
HTH
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 22, 2013
10:17 AM
Thank you ch_eng for the answer!
Where should I put this code? I mean, in which event would it be the best place to make this validation?
On the other hand, is there a way to install or activate IIS by code in case he doesn't have it?
Thanks!
Alejandro
Where should I put this code? I mean, in which event would it be the best place to make this validation?
On the other hand, is there a way to install or activate IIS by code in case he doesn't have it?
Thanks!
Alejandro
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 22, 2013
10:20 AM
Alejandro,
I would recommend checking for this near the beginning of:
Sorry, I do not know how to install or activate IIS if it is missing.
HTH
I would recommend checking for this near the beginning of:
function OnFirstUIBefore()
Sorry, I do not know how to install or activate IIS if it is missing.
HTH
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 22, 2013
02:40 PM
what version of IIS are you using? Or rather, what server? For IIS 6 (Windows Svr 03) you can use
Sysocmgr.exe /i:[WindowsFolder]inf\sysoc.inf /u:[SUPPORTDIR]\IISAnswer.txt
I haven't yet looked into the IIS 7/Svr08 method, but whoever gets to it first should update this post. I think Svr08 comes with the IIS role already enabled, but it's been a while since I last set a Svr08 machine up, that I don't remember.
Oh, as for detection, look in
HKLM\System\CurrentControlSet\Services\W3Svc\Parameters
Name: MajorVersion
if you find a 6, then IIS 6 is already set up.
Sysocmgr.exe /i:[WindowsFolder]inf\sysoc.inf /u:[SUPPORTDIR]\IISAnswer.txt
I haven't yet looked into the IIS 7/Svr08 method, but whoever gets to it first should update this post. I think Svr08 comes with the IIS role already enabled, but it's been a while since I last set a Svr08 machine up, that I don't remember.
Oh, as for detection, look in
HKLM\System\CurrentControlSet\Services\W3Svc\Parameters
Name: MajorVersion
if you find a 6, then IIS 6 is already set up.
