如何在具有提升权限的WiX中创建的MSI中运行自定义操作? [英] How to run a Custom Action inside an MSI created in WiX with elevated privileges?

查看:69
本文介绍了如何在具有提升权限的WiX中创建的MSI中运行自定义操作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个安装程序,需要访问注册表并使用自定义操作复制和删除文件。
在Windows XP中,安装程序运行良好,但在Vista和7中,安装程序显示错误,因为它无法访问文件夹,但是如果我以管理员身份运行安装程序,则一切正常。

I have an installer that needs to access the registry and copy and remove files using custom actions. In Windows XP the installer works just fine, but in Vista and 7, the installer shows an error because it cannot access a folder, but if I run the installer as administrator everything works.

因此,即使MSI不是这样运行的,我也需要安装程序才能以管理员身份运行自定义操作(需要安装程序由常规用户运行)。我尝试在安装开始时使用EXE修改注册表并允许MSI正常运行,但我认为这不是一个很好的解决方案。

So, I need the installer to be able to run the custom action as administrator even if the MSI wasnt run this way (need the installer to be run by regular users). I tried using an EXE at the beginning of my installation to modify the registry and allow the MSI to run normally but I dont think that's a very good solution.

PS。由于客户的要求,Bootstrapper不能选择:S
我所有的自定义操作都被推迟并冒充= no

PS. Bootstrapper is not an option due to client requirements :S All my custom Actions are deferred and impersonate="no"

有什么想法吗?
谢谢

Any ideas? Thank you

推荐答案

请确保:


  • 它是在InstallInitialize之后计划的时间

  • 执行属性设置为递延

  • 模拟属性设置为

  • it's scheduled after InstallInitialize
  • "Execute" attribute is set to deferred
  • "Impersonate" attribute is set to no

请注意,延迟的自定义操作无法访问安装会话,因此您无法直接访问安装程序属性。

Please note that deferred custom actions cannot access the installation session, so you cannot access installer properties directly.

这篇关于如何在具有提升权限的WiX中创建的MSI中运行自定义操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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