简体   繁体   English

如何在NSIS中创建模拟安装程序?

[英]How to create a mock installer in NSIS?

I want to make a mock installer using NSIS so we can demo what our final install process will look like when it's done. 我想使用NSIS制作一个模拟安装程序,以便我们演示最终安装过程的外观。

I've gone through the wizard using the Eclipse plugin to create a classic installer. 我已经使用Eclipse插件创建了经典的安装程序,完成了向导。 I want to add additional screens that have no back-end functionality but that would display a description of the data the user needs to input (such as the path to the JRE), a textbox + browse button to input it, and a next button. 我想添加其他屏幕,这些屏幕没有后端功能,但将显示用户需要输入的数据的描述(例如JRE的路径),输入文本框和浏览按钮以及下一个按钮。 How can I do this? 我怎样才能做到这一点?

An exact answer will depend on which user interface you're using. 确切答案取决于您使用的用户界面。

If you're using the Modern User Interface , this might be of some help: 如果您使用的是现代用户界面 ,这可能会有所帮助:

!define MUI_DIRECTORYPAGE_VARIABLE $InstallDirectory
!insertmacro MUI_PAGE_DIRECTORY

!define MUI_DIRECTORYPAGE_VARIABLE $JRE_InstallDirectory
!define MUI_PAGE_HEADER_TEXT "Choose JRE Location"
!define MUI_PAGE_HEADER_SUBTEXT "Choose an installation path for the JRE."
!define MUI_DIRECTORYPAGE_TEXT_TOP "This program will install the JRE to the following directory.  To use a different path, click Browse and select another directory. Click Next to continue."
!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "JRE Path"
!insertmacro MUI_PAGE_DIRECTORY

That will display the standard Directory page with all the default text (asking for the installation path of your program) and store it in the $InstallDirectory variable. 这将显示带有所有默认文本的标准“目录”页面(询问程序的安装路径)并将其存储在$ InstallDirectory变量中。

The following page will have the same layout but with custom text to ask for the JRE install directory, which will be stored in the $JRE_InstallDirectory variable. 接下来的页面将具有相同的布局,但是带有用于请求JRE安装目录的自定义文本,该目录将存储在$ JRE_InstallDirectory变量中。 For more information, see the documentation . 有关更多信息, 请参见文档

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

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