在不同上下文下以普通用户身份从 MSI (wix) 执行进程

发布于 2024-07-10 07:19:10 字数 655 浏览 3 评论 0原文

我正在尝试为我们在公司内使用的某些软件配置安装程序。

安装程序通过 SMS 推送到目标计算机,并执行以下步骤:

  1. 终止应用程序的所有当前正在运行的实例(该应用程序是一个实用程序,因此不会对用户产生影响)。
  2. 删除以前的版本。
  3. 安装更新版本。

我们希望它做的是在步骤 3 完成后启动已安装的可执行文件(作为当前登录的用户,而不是运行 SMS 作业的系统帐户)。

我尝试添加自定义操作,如下所示:

<CustomAction Id="Relaunch" Impersonate="yes" Return="asyncNoWait" FileKey="AppExeFile" Execute="commit" ExeCommand="acm" />

InstallExecuteSequence 元素中,我有以下内容:

<Custom Action="Relaunch" OnExit="success" />

但是,当我们尝试此操作时,无论是作为 SMS 作业还是以管理员身份执行,都不会发生任何情况(例如,应用程序没有重新启动)。

有什么建议么?

I'm trying to configure an installer for some software we use within the company.

The installer is pushed out to target machines via SMS, and it performs the following steps:

  1. Terminate any currently running instances of the app (the app is a utility, so this isn't an impact on the user).
  2. Remove the previous version.
  3. Install the updated version.

What we want it to do is launch the installed executable (as the currently logged in user, not the system account which the SMS job runs as) once step 3 is completed.

I've tried adding a custom action as follows:

<CustomAction Id="Relaunch" Impersonate="yes" Return="asyncNoWait" FileKey="AppExeFile" Execute="commit" ExeCommand="acm" />

And in the InstallExecuteSequence element I have the following:

<Custom Action="Relaunch" OnExit="success" />

However when we try this, either as a SMS job or executing as an administrator nothing happens (e.g. the app isn't relaunched).

Any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

爱殇璃 2024-07-17 07:19:10

我提出的解决方案是在登录时使用“运行”注册表项启动我们的实用程序,并防止在安装过程中启动该实用程序(如果当前用户是“SYSTEM”) - 这不是专门针对 SMS 的,而是使用 AD/GPO部署。 然而,我们的一些客户正在使用短信,这是适合他们的解决方案。

Vista/Server 2008 UAC 也存在类似问题,我提出的唯一可靠的解决方案是安排重新启动,以便当用户重新登录时,该实用程序会在正确的用户上下文下启动。

我做了相当多的研究并浏览了 MSI 文档,似乎取消提升权限以作为另一个用户启动后台实用程序实际上是不可能的。

The solution I've come up with is to start our utility using the Run registry key at login, and to prevent launching the utility during install if the current user is "SYSTEM" - this wasn't specifically with SMS but using AD/GPO deployment. However some of our customers are using SMS and this was the solution that worked for them.

Similar issues with Vista/Server 2008 UAC, the only reliable solution I've come up with there is to schedule a reboot so that when the user logs back in the utility is launched under the correct user context.

I've done a fair bit of research and looking through MSI documentation and it seems that de-elevating privileges to launch a background utility as another user is not really possible.

一身骄傲 2024-07-17 07:19:10

不幸的是,这似乎是不可能的 - 我想这可能是一个为 MSI 编写扩展的选项,它以某种方式在代码中完成我需要的工作 - 尽管这似乎需要做很多工作才能获得一点回报。

我们决定做的是使用 SMS 发送一个链接包 - 执行我们的应用程序的主要包,它首先取决于正在运行的安装程序。

希望这对其他人有帮助:)

Unfortunately it would seem this isn't possible - I suppose it might be an option to write an extension for the MSI which does what I need in code some how - although it seems like a lot of work for a little reward.

What we've decided to do is use SMS to send out a chained package - the primary one which executes our application, which first depends on the installer being run.

Hope this helps someone else :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文