如何为所有用户安装程序快捷方式?
我正在使用 Windows Installer XML 工具包创建安装程序 msi 文件。 安装创建的 msi 文件时,放置在 ProgramMenuFolder 文件夹下的快捷方式将产生仅供管理员用户使用的快捷方式。 如何让安装程序在“所有用户”配置文件下创建快捷方式,以便计算机上的每个人都拥有该快捷方式?
I'm creating an installer msi file using the Windows Installer XML toolkit. When installing the created msi file, a shortcut placed under the ProgramMenuFolder folder results in a shortcut for the Administrator user only. How do I let the installer create a shortcut under the All Users profile, so that everyone on the machine has the shortcut?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
在 Package 元素 中,添加一个 InstallScope 属性,如下所示:
In the Package element, add an InstallScope attribute like this:
基于 WIX 教程中的 SampleFirst.wxs http://www.tramontana.co.hu /wix/lesson1.php 我更改了两部分。
首先,添加属性 ALLUERS = 1 ""。 正如其他人所指出的,这将安装所有用户配置文件的快捷方式。
其次,将组件“ProgramMenuDir”的注册表值的根更改为 HKMU。 安装程序将根据 ALLUSERS 属性决定在安装时是否应使用 HKLM(本地计算机)或 HKCU(当前用户)。
然后,您应该能够添加对话框来修改 ALLUSERS 属性,注册表根目录也会相应更改。
Based on the SampleFirst.wxs in the WIX Tutorial http://www.tramontana.co.hu/wix/lesson1.php there were two parts that I changed.
First, add the property ALLUERS = 1 "". That installs the shortcut to the all users profile as others have noted.
Second, change the root for the registry value for Component 'ProgramMenuDir' to HKMU. The installer will decide if it should use HKLM (Local Machine) or HKCU (Current User) at install time, based on the on the ALLUSERS property.
You should then be able to add dialogs to modify the ALLUSERS property, with the registry root changing accordingly.
Stuart Preston 的博客很好地描述了如何执行此操作:
为“所有用户”安装快捷方式(通过 Wayback Machine)
编辑:
概要是:
Stuart Preston's blog has a good description of how to do this:
Installing a shortcut for "All Users" (via Wayback Machine)
Edit:
The synopsys is:
鲍勃·阿恩森有一个博客文章,介绍如何在 Wix 中设置用户与机器。
快速的答案是将 Package 元素的 InstallScope 属性设置为“perMachine”。
Bob Arnson has a blog entry that covers how to set User vs. Machine in Wix.
The quick answer is to set the Package element's InstallScope attribute to "perMachine".
简单定义 ALLUSERS=1 即可强制按机器安装。
Simple define ALLUSERS=1 to force a per-machine installation.