updated reserve file macros

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3003 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
joostverburg 2003-10-08 15:28:44 +00:00
parent 5eff3bd5da
commit aaf63af9f6
9 changed files with 47 additions and 107 deletions

View file

@ -520,7 +520,21 @@ FunctionEnd
Always show the language selection dialog, even if a language has been stored in the registry.
The language stored in the registry will be selected by default.</p>
</div>
<p class="subheader">6. Set the descriptions for the sections</p>
<p class="subheader">6. Reserve files</p>
<p class="text">If you are using BZIP2 (solid) compression, it's important that
files which are being extracted in init- or page functions function are located
before other files in the data block, because this will make your installer faster.</p>
<p class="text">If there are File commands in your sections or functions above
the init- or page functions, add the reserve file macros above your sections and
functions.</p>
<pre class="margin">ReserveFile "ioFile.ini" ;Your own InstallOptions INI files
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;InstallOptions plug-in
!insertmacro MUI_RESERVEFILE_LANGDLL ;Language selection dialog
</pre>
<p class="subheader">7. Your own sections and functions</p>
<p class="text">Add your installer sections and functions.
See the NSIS Users Manual for details.</p>
<p class="subheader">8. Set the descriptions for the sections</p>
<p class="text">The descriptions of sections will be displayed on the
components page, when the user hovers the mouse over a section.
If you don't want to use descriptions, use the MUI_COMPONENTSPAGE_NODESC
@ -545,9 +559,15 @@ LangString DESC_Section2 ${LANG_ENGLISH} "Description of section 2."
</pre>
<p class="text">For the uninstaller, use the MUI_UNFUNCTION_DESCRIPTION_BEGIN
and MUI_UNFUNCTIONS_DESCRIPTION_END macros</p>
<p class="subheader">7. Reserve Files</p>
<p class="text">If you are using BZIP2 (solid) compression, you might need to
insert ReserveFile commands. <a href="#ReserveFile">More info...</a></p>
<pre class="margin">
ReserveFile "ioFile.ini" ;Your own InstallOptions INI files
ReserveFile "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp" ;Your header bitmap
!insertmacro MUI_RESERVEFILE_WELCOMEFINISHPAGE ;Welcome- or Finish page
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;InstallOptions
!insertmacro MUI_RESERVEFILE_LANGDLL ;LangDLL (language selection dialog)
!insertmacro MUI_RESERVEFILE_STARTMENU ;Start Menu Folder page
</pre>
<p class="header"><a name="customPages">Custom pages</a></p>
<p class="subheader">Custom page commands</p>
<p class="text">If you want add custom pages to your installer, you should insert your
@ -634,23 +654,6 @@ to get the user input:</p>
<pre class="margin">!insertmacro MUI_INSTALLOPTIONS_READ $R0 "ioFile.ini" "Field 1" "State"</pre>
<p class="text">For more details about InstallOptions, validation of user input etc., check the
<a href="..\InstallOptions\Readme.html">InstallOptions documentation</a>.</p>
<p class="header"><a name="ReserveFile">Reserve files</a></p>
<p class="text">If you are using BZIP2 compression, it's important that
files which are being extracted in init- or page functions functions are first in
the data block, because this will make your installer start faster.</p>
<p class="text">If there are File commands in your script above Modern UI settings
or above your own init- or page functions, you have to reserve files.</p>
<pre class="margin">
ReserveFile "ioFile.ini" ;Your own InstallOptions INI files
ReserveFile "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp" ;Your header bitmap
ReserveFile "${NSISDIR}\Contrib\Graphics\Wizard\win.bmp" ;Special bitmap
!insertmacro MUI_RESERVEFILE_WELCOMEFINISHPAGE ;Welcome- or Finish page
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;InstallOptions
!insertmacro MUI_RESERVEFILE_LANGDLL ;LangDLL (language selection dialog)
!insertmacro MUI_RESERVEFILE_STARTMENU ;Start Menu Folder page
</pre>
<p class="header"><a name="examples">Examples</a></p>
<p class="text">Basic: <a href="../../Examples/Modern UI/Basic.nsi">Basic.nsi</a><br />
Welcome/Finish page: <a href="../../Examples/Modern UI/WelcomeFinish.nsi">WelcomeFinish.nsi</a><br />

View file

@ -1982,18 +1982,6 @@ Var MUI_TEMP2
;--------------------------------
;RESERVE FILES
!macro MUI_RESERVEFILE_WELCOMEFINISHPAGE
!verbose push
!verbose 3
!insertmacro MUI_RESERVEFILE_SPECIALINI
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
!verbose pop
!macroend
!macro MUI_RESERVEFILE_INSTALLOPTIONS
!verbose push
@ -2005,17 +1993,6 @@ Var MUI_TEMP2
!macroend
!macro MUI_RESERVEFILE_SPECIALINI
!verbose push
!verbose 3
ReserveFile "${NSISDIR}\Contrib\Modern UI\ioSpecial.ini"
!verbose pop
!macroend
!macro MUI_RESERVEFILE_LANGDLL
!verbose push
@ -2027,17 +2004,6 @@ Var MUI_TEMP2
!macroend
!macro MUI_RESERVEFILE_STARTMENU
!verbose push
!verbose 3
ReserveFile "${NSISDIR}\Plugins\StartMenu.dll"
!verbose pop
!macroend
;--------------------------------
;INSERT ALL CODE

View file

@ -21,7 +21,7 @@
InstallDirRegKey HKCU "Software\Modern UI Test" ""
;--------------------------------
;Modern UI Configuration
;Interface Settings
!define MUI_ABORTWARNING

View file

@ -42,14 +42,6 @@
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Reserve Files
;Things that need to be extracted on first (keep these lines before any File command!)
;Only for BZIP2 compression
ReserveFile "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp"
;--------------------------------
;Installer Sections

View file

@ -20,11 +20,6 @@
;Get install folder from registry if available
InstallDirRegKey HKCU "Software\Modern UI Test" ""
;--------------------------------
;Variables
Var MUI_TEMP
;--------------------------------
;Pages
@ -40,7 +35,7 @@
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Modern UI Configuration
;Interface Settings
!define MUI_ABORTWARNING
@ -52,14 +47,20 @@
;--------------------------------
;Reserve Files
;Things that need to be extracted on first (keep these lines before any File command!)
;Only for BZIP2 compression
;These files should be inserted before other files in the data block
;Keep these lines before any File command
;Only for BZIP2 (solid) compression
ReserveFile "ioA.ini"
ReserveFile "ioB.ini"
ReserveFile "ioC.ini"
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
;--------------------------------
;Variables
Var INI_VALUE
;--------------------------------
;Installer Sections
@ -76,10 +77,10 @@ Section "Dummy Section" SecDummy
WriteUninstaller "$INSTDIR\Uninstall.exe"
;Read a value from an InstallOptions INI file
!insertmacro MUI_INSTALLOPTIONS_READ $MUI_TEMP "ioC.ini" "Field 2" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $INI_VALUE "ioC.ini" "Field 2" "State"
;Display a messagebox if check box was checked
StrCmp $MUI_TEMP "1" "" +2
StrCmp $INI_VALUE "1" "" +2
MessageBox MB_OK "You checked the check box, here is the MessageBox..."
SectionEnd

View file

@ -21,12 +21,7 @@
InstallDirRegKey HKCU "Software\Modern UI Test" ""
;--------------------------------
;Modern UI Configuration
;Remember the installer language
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "Software\Modern UI Test"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
;Interface Settings
!define MUI_ABORTWARNING
@ -78,8 +73,9 @@
;--------------------------------
;Reserve Files
;Things that need to be extracted on first (keep these lines before any File command!)
;Only for BZIP2 compression
;These files should be inserted before other files in the data block
;Keep these lines before any File command
;Only for BZIP2 (solid) compression
!insertmacro MUI_RESERVEFILE_LANGDLL
;--------------------------------
@ -104,6 +100,11 @@ SectionEnd
Function .onInit
;Remember the installer language
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "Software\Modern UI Test"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd

View file

@ -26,7 +26,7 @@
Var MUI_TEMP
;--------------------------------
;Modern UI Configuration
;Interface Settings
!define MUI_ABORTWARNING
@ -54,13 +54,6 @@
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Reserve Files
;Things that need to be extracted on first (keep these lines before any File command!)
;Only for BZIP2 compression
!insertmacro MUI_RESERVEFILE_STARTMENU
;--------------------------------
;Installer Sections

View file

@ -21,7 +21,7 @@
InstallDirRegKey HKCU "Software\Modern UI Test" ""
;--------------------------------
;Modern UI Configuration
;Interface Settings
!define MUI_ABORTWARNING
@ -43,15 +43,6 @@
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Reserve Files
;Things that need to be extracted on first (keep these lines before any File command!)
;Only for BZIP2 compression
!insertmacro MUI_RESERVEFILE_WELCOMEFINISHPAGE
ReserveFile "${NSISDIR}\Contrib\Graphics\Wizard\win.bmp"
;--------------------------------
;Installer Sections

View file

@ -72,13 +72,6 @@ Caption "NSIS ${VER_DISPLAY} Setup"
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Reserve Files
!insertmacro MUI_RESERVEFILE_WELCOMEFINISHPAGE
ReserveFile "${NSISDIR}\Contrib\Graphics\Wizard\win.bmp"
ReserveFile "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp"
;--------------------------------
;Installer Sections