Wix IIS的CustomAction错误:UnauthorizedAccessException

Wix IIS的CustomAction错误:UnauthorizedAccessException,wix,Wix,当我双击我的MSI包时,我得到以下异常 CustomActionException: System.UnauthorizedAccessException: Filename: redirection.config Error: Cannot read configuration file due to insufficient permissions at Microsoft.Web.Administration.Interop.AppHostWritableAdminManager

当我双击我的MSI包时,我得到以下异常

CustomActionException: System.UnauthorizedAccessException: Filename: redirection.config
Error: Cannot read configuration file due to insufficient permissions


   at Microsoft.Web.Administration.Interop.AppHostWritableAdminManager.GetAdminSection(String bstrSectionName, String bstrSectionPath)
   at Microsoft.Web.Administration.Configuration.GetSectionInternal(ConfigurationSection section, String sectionPath, String locationPath)
   at Microsoft.Web.Administration.ServerManager.get_SitesSection()
   at Microsoft.Web.Administration.ServerManager.get_Sites()
...
它这样做是因为它试图从自定义操作中访问路径C:\Windows\System32\inetsrv\config

现在,如果我从PowerShell运行MSI,您将以管理员身份运行,它似乎工作正常,但默认的双击调用不起作用

除了将自己添加到该文件夹的UAC之外,是否还有其他方法可以让我的CustomActions以提升的权限运行


我尝试了InstallPrivileges=“hiveled”的包级属性,但没有效果

默认情况下,您需要使用引导程序在管理模式下运行msi。您可以使用Wix引导程序来实现这一点。或者您可以使用任何第三方工具,如或来运行msi文件。它将始终以管理员身份运行msi