简体   繁体   English

是否可以在 NSIS 中创建带有复选框的 window 页面?

[英]Is it possible to create a window page with checkboxes in NSIS?

I'd like to give the user the option of installing a custom selection of 4 apps.我想为用户提供安装自定义选择的 4 个应用程序的选项。

Is it therefore possible to add a page to an NSIS installer that contains 4 checkboxes?因此是否可以将页面添加到包含 4 个复选框的 NSIS 安装程序? This could then be used to create if statements based on the selection and install the selected apps.然后,这可用于根据选择创建 if 语句并安装所选应用程序。

Thanks in advance.提前致谢。

The easy solution is to just use the components page:简单的解决方案是只使用组件页面:

InstallDir $ProgramFiles\MyAppCollection
Page Components
Page InstFiles

Section "App 1"
SetOutPath $InstDir\App1
File app1.exe
SectionEnd

Section "App 2"
SetOutPath $InstDir\app2
File app2.exe
SectionEnd

Use the nsDialogs plug-in if you want to create a custom page.如果要创建自定义页面,请使用nsDialogs 插件 In the pages leave function you could use NSD_GetState to get the checkbox state and the Macros from Sections.nsh to toggle a hidden section.在离开 function 的页面中,您可以使用 NSD_GetState 获取复选框 state 和 Sections.nsh 中的宏来切换隐藏部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM