How to modify IIS handler mapping permissions via Wix or a Custom Action
I'm using Wix to create an installer for a Silverlight application.
When I install the application the virtual directory that has been created has the execute permission checked for the *.dll handler mapping (IIS 7 > Web site > VDir > Handler Mappings > *.dll > Edit Feature Permissions > Execute).
When I browse to the application it cannot download its satellite assemblies in ClientBin. If I uncheck the execute permission in IIS the handler becomes disabled and the app开发者_开发技巧lication now works.
I don't want to have to do this manually. Does anybody know how to modify the handler mapping permissions in Wix or a Custom Action?
Thanks
You can do this in a VBScript Custom Action.
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:{authenticationLevel=pktPrivacy}\\" _
& strComputer & "\root\microsoftiisv2")
vdir = "W3SVC/1/ROOT"
Set colItems = objWMIService.ExecQuery _
("Select * from IIsWebVirtualDirSetting WHERE Name = '" & vdir & "'")
For Each objItem in colItems
''WScript.Echo objItem.AppRoot
objItem.AccessExecute = "False"
objItem.Put_()
Next
According to this post, it is not possible directly from WiX. However you could write a managed custom action and use the IIS7 .net API to edit the mapping.
精彩评论