我需要通过我的安装程序设置 dcom 安全性,并且想知道在 WiX 中是否有本地方式来执行此操作。我希望通过以下对话框授予我在安装时创建的用户访问和启动和激活权限:
我通过转到控制面板-> 管理工具-> 组件服务来访问它。右键单击我的电脑-> 属性并转到 COM 安全选项卡。
我必须创建一个自定义操作来执行此操作吗?
我最终使用了来自平台 sdk 的名为 dcomperm 的实用程序,并在 WiX 中使用自定义操作来执行此操作,因为我认为 WiX 中不存在此功能。它涉及几个步骤来执行此操作,因为实际下载已编译的工具似乎很困难。
我必须执行以下操作:
以下自定义操作是我添加到 WiX 的:
<CustomAction Id='GrantDcomAccessPermissions'
Directory='ToolsFolder'
Execute='deferred'
ExeCommand='[ToolsFolder]dcomperm.exe -da set ExactaMobile permit'
Return='ignore'/>
<CustomAction Id='GrantDcomLaunchAndActivatePermissions'
Directory='ToolsFolder'
Execute='deferred'
ExeCommand='[ToolsFolder]dcomperm.exe -dl set ExactaMobile permit'
Return='ignore'/>
<InstallExecuteSequence>
<Custom Action="GrantDcomAccessPermissions" After="InstallFiles">NOT Installed</Custom>
<Custom Action="GrantDcomLaunchAndActivatePermissions" After="InstallFiles">NOT Installed</Custom>
</InstallExecuteSequence>
以下是 dcomperm 更完整的使用列表:
Syntax: dcomperm <option> [...]
Options:
-da <"set" or "remove"> <Principal Name> ["permit" or "deny"]
-da list
Modify or list the default access permission list
-dl <"set" or "remove"> <Principal Name> ["permit" or "deny"]
-dl list
Modify or list the default launch permission list
-aa <AppID> <"set" or "remove"> <Principal Name> ["permit" or "deny"]
-aa <AppID> default
-aa <AppID> list
Modify or list the access permission list for a specific AppID
-al <AppID> <"set" or "remove"> <Principal Name> ["permit" or "deny"]
-al <AppID> default
-al <AppID> list
Modify or list the launch permission list for a specific AppID
-runas <AppID> <Principal Name> <Password>
-runas <AppID> "Interactive User"
Set the RunAs information for a specific AppID
Examples:
dcomperm -da set redmond\t-miken permit
dcomperm -dl set redmond\jdoe deny
dcomperm -aa {12345678-1234-1234-1234-00aa00bbf7c7} list
dcomperm -al {12345678-1234-1234-1234-00aa00bbf7c7} remove redmond\t-miken
dcomperm -runas {12345678-1234-1234-1234-00aa00bbf7c7} redmond\jdoe password
希望有人觉得这很有用,因为我很难准确地追踪到如何做到这一点。