new langdll macro / registry system, startmenu registry system, write instdir to registry
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2264 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
a1ff4f5102
commit
39d58a46d2
9 changed files with 157 additions and 83 deletions
|
@ -15,6 +15,9 @@
|
|||
|
||||
;Folder selection page
|
||||
InstallDir "$PROGRAMFILES\${MUI_PRODUCT}"
|
||||
|
||||
;Remember install folder
|
||||
InstallDirRegKey HKCU "Softare\${MUI_PRODUCT}" ""
|
||||
|
||||
;--------------------------------
|
||||
;Modern UI Configuration
|
||||
|
@ -54,6 +57,9 @@ Section "modern.exe" SecCopyUI
|
|||
SetOutPath "$INSTDIR"
|
||||
File "${NSISDIR}\Contrib\UIs\modern.exe"
|
||||
|
||||
;Store install folder
|
||||
WriteRegStr HKCU "Softare\${MUI_PRODUCT}" "" $INSTDIR
|
||||
|
||||
;Create uninstaller
|
||||
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
||||
|
||||
|
@ -82,6 +88,8 @@ Section "Uninstall"
|
|||
|
||||
RMDir "$INSTDIR"
|
||||
|
||||
DeleteRegKey /ifempty HKCU "Software\${MUI_PRODUCT}"
|
||||
|
||||
;Display the Finish header
|
||||
!insertmacro MUI_UNFINISHHEADER
|
||||
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
|
||||
;Folder selection page
|
||||
InstallDir "$PROGRAMFILES\${MUI_PRODUCT}"
|
||||
|
||||
;Remember install folder
|
||||
InstallDirRegKey HKCU "Softare\${MUI_PRODUCT}" ""
|
||||
|
||||
;--------------------------------
|
||||
;Modern UI Configuration
|
||||
|
@ -56,6 +59,9 @@ Section "modern.exe" SecCopyUI
|
|||
SetOutPath "$INSTDIR"
|
||||
File "${NSISDIR}\Contrib\UIs\modern.exe"
|
||||
|
||||
;Store install folder
|
||||
WriteRegStr HKCU "Softare\${MUI_PRODUCT}" "" $INSTDIR
|
||||
|
||||
;Create uninstaller
|
||||
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
||||
|
||||
|
@ -84,6 +90,8 @@ Section "Uninstall"
|
|||
|
||||
RMDir "$INSTDIR"
|
||||
|
||||
DeleteRegKey /ifempty HKCU "Software\${MUI_PRODUCT}"
|
||||
|
||||
;Display the Finish header
|
||||
!insertmacro MUI_UNFINISHHEADER
|
||||
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
|
||||
;Folder selection page
|
||||
InstallDir "$PROGRAMFILES\${MUI_PRODUCT}"
|
||||
|
||||
;Remember install folder
|
||||
InstallDirRegKey HKCU "Softare\${MUI_PRODUCT}" ""
|
||||
|
||||
;--------------------------------
|
||||
;Modern UI Configuration
|
||||
|
@ -89,6 +92,9 @@ Section "modern.exe" SecCopyUI
|
|||
SetOutPath "$INSTDIR"
|
||||
File "${NSISDIR}\Contrib\UIs\modern.exe"
|
||||
|
||||
;Store install folder
|
||||
WriteRegStr HKCU "Softare\${MUI_PRODUCT}" "" $INSTDIR
|
||||
|
||||
;Read a value from an InstallOptions INI File
|
||||
!insertmacro MUI_INSTALLOPTIONS_READ ${TEMP} "ioC.ini" "Field 2" "State"
|
||||
StrCmp ${TEMP} "1" "" +2
|
||||
|
@ -150,6 +156,8 @@ Section "Uninstall"
|
|||
|
||||
RMDir "$INSTDIR"
|
||||
|
||||
DeleteRegKey /ifempty HKCU "Software\${MUI_PRODUCT}"
|
||||
|
||||
!insertmacro MUI_UNFINISHHEADER
|
||||
|
||||
SectionEnd
|
|
@ -15,6 +15,14 @@
|
|||
|
||||
;Folder selection page
|
||||
InstallDir "$PROGRAMFILES\${MUI_PRODUCT}"
|
||||
|
||||
;Remember install folder
|
||||
InstallDirRegKey HKCU "Softare\${MUI_PRODUCT}" ""
|
||||
|
||||
;Remember the installer language
|
||||
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
|
||||
!define MUI_LANGDLL_REGISTRY_KEY "Software\${MUI_PRODUCT}"
|
||||
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
|
||||
|
||||
;--------------------------------
|
||||
;Modern UI Configuration
|
||||
|
@ -133,8 +141,8 @@ Section "modern.exe" SecCopyUI
|
|||
SetOutPath "$INSTDIR"
|
||||
File "${NSISDIR}\Contrib\UIs\modern.exe"
|
||||
|
||||
;Write language to the registry (for the uninstaller)
|
||||
WriteRegStr HKCU "Software\${MUI_PRODUCT}" "Installer Language" $LANGUAGE
|
||||
;Store install folder
|
||||
WriteRegStr HKCU "Softare\${MUI_PRODUCT}" "" $INSTDIR
|
||||
|
||||
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
||||
|
||||
|
@ -149,46 +157,7 @@ SectionEnd
|
|||
|
||||
Function .onInit
|
||||
|
||||
;Language selection
|
||||
|
||||
;Font
|
||||
Push Tahoma
|
||||
Push 8
|
||||
|
||||
;Languages
|
||||
!insertmacro MUI_LANGDLL_PUSH "English"
|
||||
!insertmacro MUI_LANGDLL_PUSH "French"
|
||||
!insertmacro MUI_LANGDLL_PUSH "German"
|
||||
!insertmacro MUI_LANGDLL_PUSH "Spanish"
|
||||
!insertmacro MUI_LANGDLL_PUSH "SimpChinese"
|
||||
!insertmacro MUI_LANGDLL_PUSH "TradChinese"
|
||||
!insertmacro MUI_LANGDLL_PUSH "Japanese"
|
||||
!insertmacro MUI_LANGDLL_PUSH "Korean"
|
||||
!insertmacro MUI_LANGDLL_PUSH "Italian"
|
||||
!insertmacro MUI_LANGDLL_PUSH "Dutch"
|
||||
!insertmacro MUI_LANGDLL_PUSH "Danish"
|
||||
!insertmacro MUI_LANGDLL_PUSH "Greek"
|
||||
!insertmacro MUI_LANGDLL_PUSH "Russian"
|
||||
!insertmacro MUI_LANGDLL_PUSH "PortugueseBR"
|
||||
!insertmacro MUI_LANGDLL_PUSH "Polish"
|
||||
!insertmacro MUI_LANGDLL_PUSH "Ukrainian"
|
||||
!insertmacro MUI_LANGDLL_PUSH "Czech"
|
||||
!insertmacro MUI_LANGDLL_PUSH "Slovak"
|
||||
!insertmacro MUI_LANGDLL_PUSH "Croatian"
|
||||
!insertmacro MUI_LANGDLL_PUSH "Bulgarian"
|
||||
!insertmacro MUI_LANGDLL_PUSH "Hungarian"
|
||||
!insertmacro MUI_LANGDLL_PUSH "Thai"
|
||||
!insertmacro MUI_LANGDLL_PUSH "Romanian"
|
||||
!insertmacro MUI_LANGDLL_PUSH "Macedonian"
|
||||
!insertmacro MUI_LANGDLL_PUSH "Turkish"
|
||||
|
||||
Push 25F ;25 = number of languages, F = change font
|
||||
|
||||
LangDLL::LangDialog "Installer Language" "Please select a language."
|
||||
|
||||
Pop $LANGUAGE
|
||||
StrCmp $LANGUAGE "cancel" 0 +2
|
||||
Abort
|
||||
!insertmacro MUI_LANGDLL_DISPLAY
|
||||
|
||||
FunctionEnd
|
||||
|
||||
|
@ -210,8 +179,8 @@ Section "Uninstall"
|
|||
Delete "$INSTDIR\Uninstall.exe"
|
||||
|
||||
RMDir "$INSTDIR"
|
||||
|
||||
DeleteRegValue HKCU "Software\${MUI_PRODUCT}" "Installer Language"
|
||||
|
||||
DeleteRegKey /ifempty HKCU "Software\${MUI_PRODUCT}"
|
||||
|
||||
;Display the Finish header
|
||||
!insertmacro MUI_UNFINISHHEADER
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
;Folder selection page
|
||||
InstallDir "$PROGRAMFILES\${MUI_PRODUCT}"
|
||||
|
||||
;Remember install folder
|
||||
InstallDirRegKey HKCU "Softare\${MUI_PRODUCT}" ""
|
||||
|
||||
;$9 is being used to store the Start Menu Folder.
|
||||
;Do not use this variable in your script (or Push/Pop it)!
|
||||
|
||||
|
@ -69,6 +72,9 @@ Section "modern.exe" SecCopyUI
|
|||
SetOutPath "$INSTDIR"
|
||||
File "${NSISDIR}\Contrib\UIs\modern.exe"
|
||||
|
||||
;Store install folder
|
||||
WriteRegStr HKCU "Softare\${MUI_PRODUCT}" "" $INSTDIR
|
||||
|
||||
!insertmacro MUI_STARTMENU_WRITE_BEGIN
|
||||
|
||||
;Create shortcuts
|
||||
|
@ -76,9 +82,6 @@ Section "modern.exe" SecCopyUI
|
|||
CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Modern UI.lnk" "$INSTDIR\modern.exe"
|
||||
CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
|
||||
|
||||
;Write shortcut location to the registry (for Uninstaller)
|
||||
WriteRegStr HKCU "Software\${MUI_PRODUCT}" "Start Menu Folder" "${MUI_STARTMENUPAGE_VARIABLE}"
|
||||
|
||||
!insertmacro MUI_STARTMENU_WRITE_END
|
||||
|
||||
;Create uninstaller
|
||||
|
@ -108,7 +111,7 @@ Section "Uninstall"
|
|||
Delete "$INSTDIR\Uninstall.exe"
|
||||
|
||||
;Remove shortcut
|
||||
ReadRegStr ${TEMP} HKCU "Software\${MUI_PRODUCT}" "Start Menu Folder"
|
||||
ReadRegStr ${TEMP} "${MUI_STARTMENUPAGE_REGISTRY_ROOT}" "${MUI_STARTMENUPAGE_REGISTRY_KEY}" "${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}"
|
||||
|
||||
StrCmp ${TEMP} "" noshortcuts
|
||||
|
||||
|
@ -119,8 +122,8 @@ Section "Uninstall"
|
|||
noshortcuts:
|
||||
|
||||
RMDir "$INSTDIR"
|
||||
|
||||
DeleteRegValue HKCU "Software\${MUI_PRODUCT}" "Start Menu Folder"
|
||||
|
||||
DeleteRegKey /ifempty HKCU "Software\${MUI_PRODUCT}"
|
||||
|
||||
;Display the Finish header
|
||||
!insertmacro MUI_UNFINISHHEADER
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
|
||||
;Folder selection page
|
||||
InstallDir "$PROGRAMFILES\${MUI_PRODUCT}"
|
||||
|
||||
;Remember install folder
|
||||
InstallDirRegKey HKCU "Softare\${MUI_PRODUCT}" ""
|
||||
|
||||
;--------------------------------
|
||||
;Modern UI Configuration
|
||||
|
@ -63,6 +66,9 @@ Section "modern.exe" SecCopyUI
|
|||
|
||||
SetOutPath "$INSTDIR"
|
||||
File "${NSISDIR}\Contrib\UIs\modern.exe"
|
||||
|
||||
;Store install folder
|
||||
WriteRegStr HKCU "Softare\${MUI_PRODUCT}" "" $INSTDIR
|
||||
|
||||
;Create uninstaller
|
||||
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
||||
|
@ -88,6 +94,8 @@ Section "Uninstall"
|
|||
|
||||
RMDir "$INSTDIR"
|
||||
|
||||
DeleteRegKey /ifempty HKCU "Software\${MUI_PRODUCT}"
|
||||
|
||||
!insertmacro MUI_UNFINISHHEADER
|
||||
|
||||
SectionEnd
|
Loading…
Add table
Add a link
Reference in a new issue