欢迎来到山村网

如何编写NSIS自定义界面脚本

2019-03-02 14:41:54浏览:976 来源:山村网   
核心摘要:  微软公司推出的近两款操作系统Windows 8和windows 10都采用了向导界面样式,其实ModernUI(新式用户界面)中有与此类似的界面

  微软公司推出的近两款操作系统Windows 8和windows 10都采用了向导界面样式,其实Modern UI(新式用户界面)中有与此类似的界面样式,如果用户设计一个欢迎页面,可以在上面添加安装介绍、是否立即执行等选项。下面我们就具体看看它的实现代码。

如何编写NSIS自定义界面脚本 山村

  ;NSIS Modern User Interface

  ;Basic Example script

  ;Written by Joost Verburg

  ;--------------------------------

  ;Include Modern UI

  !include "MUI2.nsh"

  ;--------------------------------

  ;General

  ;Name and file

  Name "Modern UI Test"

  OutFile "Basic.exe"

  ;Default installation folder

  InstallDir "$LOCALAPPDATAModern UI Test"

  ;Get installation folder from registry if available

  InstallDirRegKey HKCU "SoftwareModern UI Test" ""

  ;Request application privileges for Windows Vista

  RequestExecutionLevel user

  ;--------------------------------

  ;Interface Settings

  !define MUI_ABORTWARNING

  ;--------------------------------

  ;Pages

  !insertmacro MUI_PAGE_LICENSE "${NSISDIR}DocsModern UILicense.txt"

  !insertmacro MUI_PAGE_COMPONENTS

  !insertmacro MUI_PAGE_DIRECTORY

  !insertmacro MUI_PAGE_INSTFILES

  !insertmacro MUI_UNPAGE_/confirm/i

  !insertmacro MUI_UNPAGE_INSTFILES

  ;--------------------------------

  ;Languages

  !insertmacro MUI_LANGUAGE "English"

  ;--------------------------------

  ;Installer Sections

  Section "Dummy Section" SecDummy

  SetOutPath "$INSTDIR"

  ;ADD YOUR OWN FILES HERE...

  ;Store installation folder

  WriteRegStr HKCU "SoftwareModern UI Test" "" $INSTDIR

  ;Create uninstaller

  WriteUninstaller "$INSTDIRUninstall.exe"

  SectionEnd

  ;--------------------------------

  ;Descriptions

  ;Language strings

  LangString DESC_SecDummy ${LANG_ENGLISH} "A test section."

  ;Assign language strings to sections

  !insertmacro MUI_FUNCTION_DEscriptION_BEGIN

  !insertmacro MUI_DEscriptION_TEXT ${SecDummy} $(DESC_SecDummy)

  !insertmacro MUI_FUNCTION_DEscriptION_END

  ;--------------------------------

  ;Uninstaller Section

  Section "Uninstall"

  ;ADD YOUR OWN FILES HERE...

  Delete "$INSTDIRUninstall.exe"

  RMDir "$INSTDIR"

  DeleteRegKey /ifempty HKCU "SoftwareModern UI Test"

  SectionEnd

(责任编辑:豆豆)
下一篇:

设置utorrent开机自启方法

上一篇:

编写NSIS脚本语言实现超级按钮

  • 信息二维码

    手机看新闻

  • 分享到
打赏
免责声明
• 
本文仅代表作者个人观点,本站未对其内容进行核实,请读者仅做参考,如若文中涉及有违公德、触犯法律的内容,一经发现,立即删除,作者需自行承担相应责任。涉及到版权或其他问题,请及时联系我们 xfptx@outlook.com