;NSIS Modern User Interface version 1.70 ;Basic Example Script ;Written by Joost Verburg ;-------------------------------- ;Include Modern UI !include "MUI.nsh" ;-------------------------------- ;General ;Name and file Name "Modern UI Test 1.70" OutFile "Basic.exe" ;Default installation folder InstallDir "$PROGRAMFILES\Modern UI Test" ;Get installation folder from registry if available InstallDirRegKey HKCU "Software\Modern UI Test" "" ;-------------------------------- ;Interface Settings !define MUI_ABORTWARNING ;-------------------------------- ;Pages !insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Contrib\Modern UI\License.txt" !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !define MUI_FINISHPAGE_SHOWREADME "http://www.google.com" !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED !define MUI_FINISHPAGE_SHOWREADME_TEXT "Here is the text" !define MUI_PAGE_CUSTOMFUNCTION_PRE SetFinshPageRunText !define MUI_PAGE_CUSTOMFUNCTION_SHOW SetFinishPageOptions !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES ;-------------------------------- ;Languages !insertmacro MUI_LANGUAGE "English" ;-------------------------------- ;Functions Function SetFinishPageOptions StrCpy $2 0 ; 1 = show and 0 = hide StrCmp $2 0 0 show GetDlgItem $2 $MUI_HWND "1203" ; $MUI_HWND is defined for us by the MUI macros as the inner dialog hwnd SendMessage $2 ${WM_LBUTTONDOWN} 0 0 ; uncheck it ;SendMessage $2 ${WM_LBUTTONUP} 0 0 ; check it ShowWindow $2 ${SW_HIDE} show: !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Text" "Some new text or use variable here." FunctionEnd Function SetFinshPageRunText !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Text" "Some new text or use variable here." FunctionEnd ;-------------------------------- ;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