Wix Burn Bundle-必须是管理员 [英] Wix Burn Bundle - Must be Administrator

查看:215
本文介绍了Wix Burn Bundle-必须是管理员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了WIX刻录包.在捆绑软件中,我安装.Net 4(如果未安装),然后再安装2个.msi文件. 1是msi的第三部分,另一部分是我使用WIX为我的软件创建的msi.我需要成为计算机上的管理员才能运行这些.msi文件.

I've created a WIX Burn Bundle. In the Bundle I install .Net 4 (if its not installed) then 2 more .msi files. 1 is a third part msi the other a msi I created for my software using WIX. I need to be an Administrator on the machine to run these the .msi files.

如果用户不是管理员,我希望Burn捆绑包不做任何事情,即不安装任何内容.在我的产品软件中,我可以轻松地使用以下内容-但是我不能在捆绑包中这样做.我读过很多类似的文章,但没有找到我想要做的可行的例子.

I want the Burn bundle to not do anything if the user is not an administartor i.e. install nothing. In my product software I can easily do do using below - however I cant do this in the bundle. I've read lots of similar posts but just didnt find a working example for what I want to do.

<CustomAction Id="IsPrivileged" Error="You must be an Administrator to install [ProductName]." />
  <InstallExecuteSequence>
     <Custom Action='IsPrivileged' Before='LaunchConditions'>
        Not Privileged
     </Custom>
  </InstallExecuteSequence>

推荐答案

您可以使用 WixBalExtension的Condition元素:

<bal:Condition Message="You can't elevate.">
  <![CDATA[Privileged <> 0]]>
</bal:Condition>

<bal:Condition Message="You're not elevated.">
  WixBundleElevated = 1
</bal:Condition>

这篇关于Wix Burn Bundle-必须是管理员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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