How to compile NSIS User-Defined Interface scripts
Almost two Windows 8 and windows 10 Operating Systems launched by Microsoft Use Wizard interface styles. In fact, Modern UI (new user interface) has similar interface styles, if you want to design a welcome page, you can add options such as installation introduction and immediate execution on the page. Next, let's take a look at its implementation code.
; 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
! Insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
; Ages
! 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 "initialize 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