3
我需要通過我的安裝程序設置dcom安全性,並且想知道在WiX中是否有本地方式來執行此操作。我期待授予我創建在安裝時訪問和啓動用戶,並通過下面的對話框激活權限:在WiX中設置DCom安全設置
我轉到控制面板 - >管理工具 - >組件服務訪問這個。右鍵單擊我的電腦 - >屬性,然後進入COM安全選項卡。
我必須創建一個自定義操作才能做到這一點嗎?
我需要通過我的安裝程序設置dcom安全性,並且想知道在WiX中是否有本地方式來執行此操作。我期待授予我創建在安裝時訪問和啓動用戶,並通過下面的對話框激活權限:在WiX中設置DCom安全設置
我轉到控制面板 - >管理工具 - >組件服務訪問這個。右鍵單擊我的電腦 - >屬性,然後進入COM安全選項卡。
我必須創建一個自定義操作才能做到這一點嗎?
我最終在平臺sdk中使用了一個名爲dcomperm的實用程序,並在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
希望有人認爲這很有用,考慮到我有一個困難的時間確切地跟蹤如何做到這一點。
我看過C++代碼在dll中這樣做 - 它非常複雜,我懷疑它存在於Wix中。添加這個解決方法很不錯。感謝與社區分享。 –