我正在使用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 和。
现在我问自己以下问题:
-
有可能在同一MSI文件中和同一设置项目中安装程序和用户安装程序?
-
是否有可能基于应用程序文件夹的
是基于 installallusers
属性设置的? installAllusers
可以在安装文件夹中更改属性
用户界面时 installAlluserVisible
属性设置为true。
-
上面的后构建事件会成为系统范围安装的问题吗?
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:
-
is the possibility to have the system installer and the user installer in the same msi-file and in the same setup project?
-
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.
-
Would the above post build event a problem for system wide install?
发布评论
评论(1)
是的,实际上,这是构建MSI软件包的正常方法,以便系统管理员可以选择适合其环境的安装类型。在安装程序的初始UI阶段,或通过无人值守的安装属性,如果他们想要“仅我”或“所有用户”安装,则将选择。尽管很少使用其他安装选项,例如基于网络的管理安装点安装,管理员也可能希望看到您支持。
是的,但不要那样做。目标文件夹应通过命令行或UI设置,而不是由您的软件包设置。请参阅 targetDir> targetDir 属性文档以获取更多详细信息。默认情况下,Windows Installer将从软件包中已经存在的属性中构造合适的位置。
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.
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.