以提升用户身份在 wix 中运行 CustomAction [英] Running CustomAction in wix as elevated user

查看:35
本文介绍了以提升用户身份在 wix 中运行 CustomAction的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知 - WiX 支持两种自定义操作:

As I see it - WiX supports two kinds of CustomActions:

  • 延迟 - 运行此操作的用户(默认情况下)被提升,但不是运行安装的用户(例如,LocalSystem 或类似的用户).

  • Deferred - The user running this action is (by default) elevated, but it is not the user who ran the install (for example, LocalSystem, or some user like that).

立即 - 运行此操作的用户(默认情况下)未提升 - 首先运行安装程序的用户.

Immediate - The user running this action is (by default) not elevated - it's the user who ran the installer in the first place.

我需要一些中间的东西 - 我想要运行安装程序的用户的提升形式 (UAC).

I need something quite in the middle - I want the elevated form (UAC) of the user who ran the installer.

我需要它的原因是访问只能由以提升的形式安装包的用户访问的数据库(LocalSystem 不可访问).

The reason I need this is to access databases that can only be accessed by the user installing the package in its elevated form (LocalSystem is not accessible).

推荐答案

这不存在.自定义操作只有两种可能的上下文运行.一种是启动用户(通常通过模拟).另一个是 Windows Installer 服务的提升上下文.在某些机器上(例如 Windows XP,或禁用了 UAC 的机器),或使用提升引导程序,启动用户是管理员用户;您可以结合 MSIUSEREALADMINDETECTIONAdminUser 属性.但在任何情况下都没有第三种情况.

This does not exist. There are only two possible contexts for custom actions to run in. One is the launching user (often via impersonation). The other is the elevated context of the Windows Installer service. On some machines (such as Windows XP, or machines with UAC disabled), or with elevating bootstraps, the launching user is an adminstrative user; you can check for this case with a combination of the MSIUSEREALADMINDETECTION and AdminUser properties. But in no case is there a third context.

这篇关于以提升用户身份在 wix 中运行 CustomAction的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆