Create MSI and Enforce All Users with Visual Studio

一世执手 提交于 2019-11-28 14:20:32

The project Properties window (NOT properties) can be shown by selecting the project in Solution Explorer, and then F4. You can set InstallAllUsers to True there.

The Properties window of the InstallFolder dialog has a settting InstallAllUsersVisible, so just set that to False.

I don't use that particular tool. There might be a better way to achieve what you want than the below "hack". Adding since you got no other answers (yet).

UPDATE: Go with Phil's answer. I don't have the tool to check but it looks good. Leaving in this answer just for the record. Not recommended unless you have other things you want to change.

Post-Process MSI

Hiding Control: Not ideal, but if you don't mind post-processing the MSI (can be automated with MSI API coding) you could insert a row into the ControlCondition table to hide the whole dialog control in question.

Ad-hoc sample: Hiding the "Back" button from a setup's LicenseAgreementDlg - just add this row (I guess events defined elsewhere could show it again):

.


Dialog at runtime: Below is the actual dialog at runtime.


MSI API

To automate the above. Get hold of WiRunSQL.vbs - part of the Windows SDK - just search your SDK folder if you have Visual Studio installed. Also plenty of copies on github.

In a batch file:

cscript.exe "%~dp0"\WiRunSQL.vbs "MySetup.msi" "INSERT INTO `ControlCondition` (`Dialog_`, `Control_`, `Action`, `Condition`) VALUES ('LicenseAgreementDlg', 'Back', 'Hide', '1')"    
pause

I honestly might hard code ALLUSERS=1 in the Property table as well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!