From d77e30386a099aa11502e2c7b62418a85bbbf537 Mon Sep 17 00:00:00 2001
From: joostverburg
If you want a certain value (e.g. a text) to be language-specific, set a language string (using LangString) and define $(STRINGNAME) as value. Use a license language string (LicenseLangString) for the license text.
-When adding " or ` to a Modern UI string, you should always escape ($\" or $\`), because the -Modern UI macros use " and ` to separate parameters.
+If you want to add " to a Modern UI string, you should always escape it: $\" because the Modern +UI macros use " separate parameters.
!include "MUI.nsh" @@ -335,15 +335,18 @@ multiple folders).!insertmacro MUI_PAGE_LICENSE "License.rtf" !insertmacro MUI_PAGE_COMPONENTS -!insertmacro MUI_PAGE_STARTMENU "Application" ;Unique ID for page + +Var STARTMENU_FOLDER +!insertmacro MUI_PAGE_STARTMENU "Application" $STARTMENU_FOLDER-You need the page ID for the Start Menu Folder page when using the Start Menu Folder macros.
+You need the page ID for the Start Menu Folder page when using the Start Menu Folder macros. The +Start Menu Forder will be stored in the specified variable.
Installer Pages
MUI_PAGE_WELCOME
MUI_PAGE_LICENSE text/rtf_file
MUI_PAGE_COMPONENTS
MUI_PAGE_DIRECTORY
-MUI_PAGE_STARTMENU page_id
+MUI_PAGE_STARTMENU page_id variable
MUI_PAGE_INSTFILES
MUI_PAGE_FINISHUninstaller Pages
+
@@ -354,9 +357,17 @@ MUI_UNPAGE_COMPONENTS
MUI_UNPAGE_DIRECTORY
MUI_UNPAGE_INSTFILES
MUI_UNPAGE_FINISHPage Settings apply to a single page and should be set before inserting a page macro. Example:
++;Add a directory page to let the user specify a plug-ins folder +;Store the folder in $PLUGINS_FOLDER + +Var PLUGINS_FOLDER +!define MUI_DIRECTORYPAGE_VARIABLE $PLUGINS_FOLDER +!insertmacro MUI_PAGE_DIRECTORY +Page Settings
-Page Settings apply to a single page and should be set before inserting a page macro.
General Page Settings
MUI_PAGE_HEADER_TEXT text
Text to display on the top of the page.
@@ -437,9 +448,6 @@ shortcuts you want to write.MUI_STARTMENUPAGE_TEXT_CHECKBOX text
-
Text to display next to the checkbox to disable the Start Menu folder creation.MUI_STARTMENUPAGE_VARIABLE variable
-Variable to store the current Start Menu Folder. You cannot use this variable in your script (or -you should Push/Pop it), therefore using a user variable is recommended.MUI_STARTMENUPAGE_DEFAULTFOLDER folder
The default Start Menu Folder.MUI_STARTMENUPAGE_NODISABLE
@@ -720,7 +728,7 @@ FunctionEndIf you need the InstallOptions return value (success, back, cancel, error), use the MUI_INSTALLOPTIONS_DISPLAY_RETURN or MUI_INSTALLOPTIONS_SHOW_RETURN macro. The return value will be added to the stack, so you can use the Pop command to get it.
-Use these macros to read or write INI file values.
+Use these macros to read or write INI file values:
!insertmacro MUI_INSTALLOPTIONS_READ $VAR "ioFile.ini" "Field #" "Value Name" !insertmacro MUI_INSTALLOPTIONS_WRITE "ioFile.ini" "Field #" "Value Name" "Value" diff --git a/Contrib/Modern UI/System.nsh b/Contrib/Modern UI/System.nsh index f522fbb2..2590ff57 100644 --- a/Contrib/Modern UI/System.nsh +++ b/Contrib/Modern UI/System.nsh @@ -774,7 +774,7 @@ Var MUI_TEMP2 !macroend -!macro MUI_PAGE_STARTMENU ID +!macro MUI_PAGE_STARTMENU ID VAR !verbose push !verbose 3 @@ -786,12 +786,8 @@ Var MUI_TEMP2 !insertmacro MUI_DEFAULT MUI_STARTMENUPAGE_DEFAULTFOLDER "$(^Name)" !insertmacro MUI_DEFAULT MUI_STARTMENUPAGE_TEXT_TOP "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_STARTMENU_TOP)" !insertmacro MUI_DEFAULT MUI_STARTMENUPAGE_TEXT_CHECKBOX "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}INNERTEXT_STARTMENU_CHECKBOX)" - - !ifndef MUI_STARTMENUPAGE_VARIABLE - Var MUI_STARTMENU_FOLDER - !define MUI_STARTMENUPAGE_VARIABLE "$MUI_STARTMENU_FOLDER" - !endif + !define MUI_STARTMENUPAGE_VARIABLE "${VAR}" !define "MUI_STARTMENUPAGE_${ID}_VARIABLE" "${MUI_STARTMENUPAGE_VARIABLE}" !define "MUI_STARTMENUPAGE_${ID}_DEFAULTFOLDER" "${MUI_STARTMENUPAGE_DEFAULTFOLDER}" !ifdef MUI_STARTMENUPAGE_REGISTRY_ROOT diff --git a/Examples/Modern UI/StartMenu.nsi b/Examples/Modern UI/StartMenu.nsi index 7af28e21..2e0acea3 100644 --- a/Examples/Modern UI/StartMenu.nsi +++ b/Examples/Modern UI/StartMenu.nsi @@ -39,12 +39,11 @@ !insertmacro MUI_PAGE_DIRECTORY ;Start Menu Folder Page Configuration - !define MUI_STARTMENUPAGE_VARIABLE "$STARTMENU_FOLDER" !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Modern UI Test" !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" - !insertmacro MUI_PAGE_STARTMENU Application + !insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER !insertmacro MUI_PAGE_INSTFILES