简体   繁体   中英

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 application 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

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM