Visual Studio 安装项目 - 同一 MSI 文件中的系统和用户安装程序

发布于 2025-01-19 20:34:33 字数 1335 浏览 0 评论 0 原文

我正在使用Microsoft Visual Studio 2019和

我知道如何生成一个系统宽安装程序:

  • 安装AltinalLusers 设置项目的属性设置为true。
  • 安装alluservisible 安装文件夹的属性用户界面设置为false。
  • 应用程序文件夹的DefaultLocation 设置为 [ProgramFilesFolder] [Manufacturer] [Manufacturer] \ [ProductName]

而且,我也很清楚如何在不需要管理高程的情况下生成用户安装程序

  • 安装程序设置项目的属性设置为false。
  • 安装alluservisible 安装文件夹的属性用户界面设置为false。
  • 应用程序文件夹的DefaultLocation 设置为 [LocalAppDataFolder] \ Program \ [Manufacturer] \ [ProductName]
  • Postbuildevent:“%programFiles%\ Windows套件\ 10 \ bin \ x86 \ msiinfo.exe”“ $(hiNdouputpath)”/w 10

请参阅 https://stackoverflow.com/a/a/55700346/75556646

现在我问自己以下问题:

  1. 有可能在同一MSI文件中和同一设置项目中安装程序和用户安装程序?

  2. 是否有可能基于应用程序文件夹的 是基于 installallusers 属性设置的? installAllusers 可以在安装文件夹中更改属性用户界面时 installAlluserVisible 属性设置为true。

  3. 上面的后构建事件会成为系统范围安装的问题吗?

I'm using Microsoft Visual Studio 2019 and Microsoft Visual Studio Installer Projects V1.0.2.

I'm aware how to generate a system wide installer:

  • InstallAllUsers property of the setup project is set to true.
  • InstallAllUserVisible property of the Installation Folder user interface is set to false.
  • The DefaultLocation of the Application Folder is set to [ProgramFilesFolder][Manufacturer]\[ProductName].

and I'm as well aware how to generate a user installer where no admin elevation is needed:

  • InstallAllUsers property of the setup project is set to false.
  • InstallAllUserVisible property of the Installation Folder user interface is set to false.
  • The DefaultLocation of the Application Folder is set to [LocalAppDataFolder]\Programs\[Manufacturer]\[ProductName].
  • PostBuildEvent: "%ProgramFiles%\Windows Kits\10\bin\x86\MsiInfo.exe" "$(BuiltOuputPath)" /w 10

See https://stackoverflow.com/a/55700346/7556646 and https://superuser.com/a/1633474/738960.

Now I'm asking myself the following questions:

  1. is the possibility to have the system installer and the user installer in the same msi-file and in the same setup project?

  2. Is it possible that the DefaultLocation of the Application Folder is set based on the InstallAllUsers property? The InstallAllUsers property can be changed in the Installation Folder user interface when the InstallAllUserVisible property is set to true.

  3. Would the above post build event a problem for system wide install?

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

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

发布评论

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

评论(1

莫多说 2025-01-26 20:34:33
  1. 是的,实际上,这是构建MSI软件包的正常方法,以便系统管理员可以选择适合其环境的安装类型。在安装程序的初始UI阶段,或通过无人值守的安装属性,如果他们想要“仅我”或“所有用户”安装,则将选择。尽管很少使用其他安装选项,例如基于网络的管理安装点安装,管理员也可能希望看到您支持。

  2. 是的,但不要那样做。目标文件夹应通过命令行或UI设置,而不是由您的软件包设置。请参阅 targetDir> targetDir 属性文档以获取更多详细信息。默认情况下,Windows Installer将从软件包中已经存在的属性中构造合适的位置。

请注意,targetDir属性的值通常设置在
命令行或通过用户界面。设置targetDir
不建议使用一条路径,因为
计算机在本地驱动器的设置中不同。

  1. 不,如果您打算将偏好设置为每个用户安装,则您已经正确完成了此操作。通常,您会提出一个UI对话框以选择安装类型,然后将其设置为安装的执行阶段的Allusers属性。管理员非常熟悉仅设置钓鱼剂以选择所需的安装类型。通过在构建中为他们执行此操作,您正在为每个用户安装进行默认和掩盖,即(大概是)通过命令行支持了所有用户的安装。 还有有关抑制UAC提示的步骤的其他信息,从而增强了使用者安装体验。

要在安装应用程序时抑制UAC对话框的显示,包装的作者应执行以下操作:

使用窗口安装程序4.0或以后在Windows Vista上安装应用程序。
不依赖于使用高架系统特权在>计算机上安装应用程序。

在每个用户上下文中安装应用程序,并使该应用程序成为软件包的默认安装上下文。如果未设置Allusers属性,则>安装程序将在每个用户上下文中安装软件包。如果您不在属性表中包含&​​gt; Allusers属性,则安装程序不会设置此属性>,因此每个用户安装成为默认安装上下文。您可以通过在命令行上设置Allusers属性来覆盖此默认值。
在单词计数摘要属性中设置位3,以表明不需要安装升高的特权>

  1. Yes, in fact that is the normal way to build an MSI package so that the system administrator can choose what type of installation is appropriate for their environment. During the initial UI phase of the installer, or by properties on an unattended installation, the administrator will pick if they want a "Only Me" or a "All Users" installation. Although rarely used there are other installation options like network based administrative installation point installations that an admin may like to also see you supporting.

  2. Yes, but don't do that. The target folder should be set by command line or by the UI, not by your package. Refer to the TARGETDIR property documentation for more detail. By default Windows Installer will construct a suitable location from properties already present in your package.

Note that the value of the TARGETDIR property is typically set at the
command line or through a user interface. Setting TARGETDIR by
authoring a path into the Property table is not recommended because
computers differ in the set up of the local drive.

  1. No, you've done this correctly if you are intending to set a preference for per-user installation. Typically you would present a UI dialog to choose the installation type, this then sets the ALLUSERS property for the execute phase of the installation. Admins are very familiar with just setting ALLUSERS themselves to pick what type of installation they want. By doing this for them in the build you are making a per-user installation the default and masking that a All Users installation is (presumably) supported through the command line. The documentation has additional info on steps required to suppress the UAC prompt, enhancing the per-user installation experience.

To suppress the display of the UAC dialog box when installing the application, the >author of the package should do the following:

Install the application using Window Installer 4.0 or later on Windows Vista.
Do not depend on using elevated system privileges to install the application on the >computer.

Install the application in the per-user context and make this the default >installation context of the package. If the ALLUSERS property is not set, the >installer installs the package in the per-user context. If you do not include the >ALLUSERS property in the Property table, the installer does not set this property >and so per-user installation becomes the default installation context. You can >override this default by setting the ALLUSERS property on the command line.
Set Bit 3 in the Word Count Summary property to indicate that elevated privileges >are not required to install the application.

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