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
- :
- IIS 7 and AppCmd.exe
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
‎Jun 16, 2010
04:09 PM
Installscript Project and IIS 7
I use Installscript projects for my installations of IIS web sites. I use WMI/ADSI to create sites, application pools etc. All works find in IIS 6. In IIS 7 (Windows server 2008), these methods no longer work during installation unless the server has IIS6 Management Compatibility enables and installed on the server. I would prefer not to have that as a requirement. I am willing to update/enhnce my InstallScript for IIS 7 and use the Microsoft.Web.Administration toolset (ServerManager) but I am not sure how I invoke this toolset in an InstallShield script in my project. Here is a snippet of what I use for IIS6. Anyone have an example for IIS 7?
if svIISVer = "6" then
svAppPool = "M5WebServices";
set objIIS_Root = CoGetObject("IIS://localhost/W3SVC/AppPools", "");
if (IsObject(objIIS_Root)) then
try
set objAppPool = objIIS_Root.GetObject("IISApplicationPool", svAppPool);
svPoolStatus = TRUE;
catch
set objAppPool = objIIS_Root.Create("IISApplicationPool", svAppPool);
svPoolStatus = FALSE;
svLine = "Creating new App Pool";
nResult = WriteLine(nvLogFileHandle, svLine);
objAppPool.SetInfo();
endcatch;
if (IsObject(objAppPool)) then
// In minutes
objAppPool.PeriodicRestartTime = 120;
// In number of events
objAppPool.PeriodicRestartRequests = 4000;
// In bytes
objAppPool.PeriodicRestartMemory = 512000;
// In bytes
objAppPool.PeriodicRestartPrivateMemory = 196608;
endif;
set objAppPool = NOTHING;
set objIIS_Root = NOTHING;
endif;
if svIISVer = "6" then
svAppPool = "M5WebServices";
set objIIS_Root = CoGetObject("IIS://localhost/W3SVC/AppPools", "");
if (IsObject(objIIS_Root)) then
try
set objAppPool = objIIS_Root.GetObject("IISApplicationPool", svAppPool);
svPoolStatus = TRUE;
catch
set objAppPool = objIIS_Root.Create("IISApplicationPool", svAppPool);
svPoolStatus = FALSE;
svLine = "Creating new App Pool";
nResult = WriteLine(nvLogFileHandle, svLine);
objAppPool.SetInfo();
endcatch;
if (IsObject(objAppPool)) then
// In minutes
objAppPool.PeriodicRestartTime = 120;
// In number of events
objAppPool.PeriodicRestartRequests = 4000;
// In bytes
objAppPool.PeriodicRestartMemory = 512000;
// In bytes
objAppPool.PeriodicRestartPrivateMemory = 196608;
endif;
set objAppPool = NOTHING;
set objIIS_Root = NOTHING;
endif;
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 17, 2010
12:57 AM
Hi,
There is one inbuilt tool "AppCmd.exe" available in IIS 7 using which you ca mange your website from commandline.
Reference : http://learn.iis.net/page.aspx/114/getting-started-with-appcmdexe/
I used the following command from installscript to create website on IIS 7.
"AppCmd.exe" "add site /name:\""+szWebsite+"\" /bindings:http/*:"+szTCPPort+":,https/*:"+szSSLPort+": /physicalPath:\""+szWWWRootPath+"\""
Hope, this will help you.
There is one inbuilt tool "AppCmd.exe" available in IIS 7 using which you ca mange your website from commandline.
Reference : http://learn.iis.net/page.aspx/114/getting-started-with-appcmdexe/
I used the following command from installscript to create website on IIS 7.
"AppCmd.exe" "add site /name:\""+szWebsite+"\" /bindings:http/*:"+szTCPPort+":,https/*:"+szSSLPort+": /physicalPath:\""+szWWWRootPath+"\""
Hope, this will help you.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 17, 2010
07:22 AM
Thanks. This should work for me. It would be nice if there where InstallShield native IIS scripting methods instead.