How to write a NSIs custom interface script

Source: Internet
Author: User

Microsoft's nearly two operating systems, Windows 8 and Windows 10, use the wizard interface style, in fact, the modern UI (new user interface) with this similar interface style, if the user design a welcome page, you can add the installation introduction, whether immediately to execute options. Let's take a look at its implementation code below.

; 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"

;D Efault 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

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

; Languages

!insertmacro mui_language "中文版"

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

; 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

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

;D escriptions

; 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.