wix - WIX 设置 perUser 或 perMachine 取决于当前用户
问题描述
我是 WIX 的新手。如果当前用户在本地管理员组(不是 runAsAdmin)或perMachine中,我需要将Installscope设置为perUser否则我知道ALLUSERS="2"和MSIINSTALLPERUSER="1|{}",但我不能在之前动态设置它们wix 决定它将如何运行 - 作为 perUser 或 perMachine 我使用 CustomAction 来检测当前用户是否在 Administrators 组中并设置ALLUSERS和MSIINSTALLPERUSER,放入 InstallExecuteSequence 中,但此操作始终在 wix 决定之后运行我如何实现动态设置InstallScope 的此属性取决于当前用户和管理员组?我的样品 WIX
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="SetupProject1" Language="1033" Version="1.0.0.0" Manufacturer="rrr" UpgradeCode="3664d946-e6b5-468f-8154-0506308d85ab">
<Package InstallerVersion="200" Compressed="yes" >
</Package>
<Binary Id="CustomActionBinary" SourceFile="$(var.CustomAction1.TargetDir)$(var.CustomAction1.TargetName).CA.dll"/>
<CustomAction Id="SampleAction" BinaryKey="CustomActionBinary" DllEntry="CustomAction1" Execute="immediate" Return="check"/>
<InstallExecuteSequence>
<Custom Action='SampleAction' Before='SetProps'/>
</InstallExecuteSequence>
</Product>
</Wix>
SetProps ALLUSERS 和MSIINSTALLPERUSER内部设置为 2 和 1 但是安装程序是通过 UAC 调用运行的(由于perMachine)
解决方案
问题已结束。我在 InstallUISequence 中使用自定义操作。
推荐阅读
- python - Discord.py 不识别成员
- azure-webjobs - 在 Webjobs SDK 3.x 中使用 ServiceBusTrigger,Singleton 属性可以使用 UserProperty 作为范围吗?
- python - 对 2d numpy 中的行求和
- java - 加密/解密 RSA 通信 Java-PHP
- excel - 用于 excel 输出的 Streamwriter
- python - 在 django 项目中创建新用户无法正常工作
- java - Java Scanner 在读取行时是否可以包含“\n”?
- java - android - java获取刚刚单击的项目的ID,而没有为该项目设置“onClick”
- postgresql - PostgreSQL - 关于 GENERATED ALWAYS AS IDENTITY 的冲突更新
- c# - 在存储库模式中使用 ApplicationDbContext