Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Cannot save Changes made to IISAPPLICATIONPOOLS


4 replies to this topic

ironscripter

ironscripter
  • Full Members
  • 7 posts

Posted 26 July 2005 - 18:53

Hi All,
I'm trying to write a custom action for Installshield 10.5 to change the Application pool settings in IIS manager. But i'm not able to save the changes in the settings. Please help me.
On Error Resume Next
Const PropName = "IdleTimeout"
set providerObj = GetObject("winmgmts://localhost/root/MicrosoftIISv2")
set IIsApplicationPoolObj = providerObj.get("IIsApplicationPools='W3SVC/AppPools'")
set IIsApplicationPoolSettingObj = providerObj.get("IIsApplicationPoolsSetting='W3SVC/AppPools'")

For Each Property in IIsApplicationPoolObj.Properties_
Msgbox Property.Name & " = " & Property.Value
Next

For Each Property in IIsApplicationPoolSettingObj.Properties_
if Property.Name = PropName then
Msgbox Property.Name & " = " & Property.Value
Property.Value = 60
Property.SaveChanges --> This does not save the changes for me
Msgbox Property.Name & " = " & Property.Value

Exit For
End if
Next

Thanks
IRONSCRIPTER


Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 26 July 2005 - 22:36

Try writing a VBS script first - does that work?
If not, remove the error obfuscation ('on error resume next') and let the script tell you about the problem.

BTW: the script is not at all specific for custom actions, I suspect a general WMI problem (like insufficient access rights or incorrect impersonation).

ironscripter

ironscripter
  • Full Members
  • 7 posts

Posted 26 July 2005 - 22:46

I tested it, it seems the Property.Savechanges does not save the options for me. also wondering what will suffice "winmgmts://localhost/root/MicrosoftIISv2" in VB script.

ironscripter

ironscripter
  • Full Members
  • 7 posts

Posted 26 July 2005 - 22:48

What should i use to save the settings for applicationpools, also could you please tell me the best source for these type of custom actions in vbscript. Thanks a lottttttt

Ironscripter

Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 26 July 2005 - 23:03

I guess I wasn't clear enough on developing scripts:

Type the intended script in a text file and save it with the extension VBS. But leave out the line 'on error resume next' because it hides all errors that are encountered. You probably made one, so it shouldn't harm learning about it.
After saving, in a command prompt enter the command:
cscript.exe //x myscript.vbs
and use the debugger to see what's happening.
When you get it right, put the script in the Custom Action again.

About the CreateObject: it instantiates a Windows Management Instrumentation (WMI) -object. I don't know this particular one, try your favorite search engine.