How to compile NSIS User-Defined Interface scripts

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.