get paid to paste

nsis script2

;NSIS Modern User Interface
;Welcome/Finish Page Example Script
;Written by Joost Verburg
;--------------------------------
;Include Modern UI

  !include "MUI2.nsh"
  !include InstallOptions.nsh

;--------------------------------
Function .onInit

      !insertmacro INSTALLOPTIONS_EXTRACT_AS "assets\UserPass.ini" "UserPass"

FunctionEnd
;--------------------------------
;General

  ;Name and file
  Name "Modern UI Test"
  OutFile "WelcomeFinish.exe"

  ;Default installation folder
  InstallDir "$LOCALAPPDATA\Modern UI Test"

  ;Get installation folder from registry if available
  InstallDirRegKey HKCU "Software\Modern UI Test" ""

  ;Request application privileges for Windows Vista
  RequestExecutionLevel user

;--------------------------------
;Interface Settings

  !define MUI_ABORTWARNING
  !define MUI_CUSTOMFUNCTION_GUIINIT onGUIInit

;--------------------------------
;Custom Page

Function UsernamePasswordPage

   !insertmacro MUI_HEADER_TEXT "$(USERPASS_TITLE)" "$(USERPASS_SUBTITLE)"
   
   # Display the page.
   !insertmacro INSTALLOPTIONS_DISPLAY "UserPass"

   # Get the user entered values.
   !insertmacro INSTALLOPTIONS_READ $Username "UserPass" "Field 2" "State"
   !insertmacro INSTALLOPTIONS_READ $Password "UserPass" "Field 4" "State"

FunctionEnd

;--------------------------------
;Pages

  !insertmacro MUI_PAGE_WELCOME
  !insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"

   LangString USERPASS_TITLE ${LANG_ENGLISH} "Enter your Username and Password."
   LangString USERPASS_SUBTITLE ${LANG_ENGLISH} " "
   Page custom UsernamePasswordPage

  !insertmacro MUI_PAGE_COMPONENTS
  !insertmacro MUI_PAGE_DIRECTORY
  !insertmacro MUI_PAGE_INSTFILES
  !insertmacro MUI_PAGE_FINISH

  !insertmacro MUI_UNPAGE_WELCOME
  !insertmacro MUI_UNPAGE_CONFIRM
  !insertmacro MUI_UNPAGE_INSTFILES
  !insertmacro MUI_UNPAGE_FINISH

;--------------------------------
;Languages

  !insertmacro MUI_LANGUAGE "English"

;--------------------------------
;Installer Sections

Section "Dummy Section" SecDummy

  SetOutPath "$INSTDIR"

  ;ADD YOUR OWN FILES HERE...

  ;Store installation folder
  WriteRegStr HKCU "Software\Modern UI Test" "" $INSTDIR

  ;Create uninstaller
  WriteUninstaller "$INSTDIR\Uninstall.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 "$INSTDIR\Uninstall.exe"

  RMDir "$INSTDIR"

  DeleteRegKey /ifempty HKCU "Software\Modern UI Test"

SectionEnd

Pasted: Jun 27, 2011, 4:42:41 pm
Views: 18