initplugins, start menu folder selection, new paging system, fixes

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1644 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
joostverburg 2002-11-09 17:58:22 +00:00
parent 02e181ca0f
commit 4103e6cd77
6 changed files with 123 additions and 59 deletions

View file

@ -1,10 +1,12 @@
NSIS Modern User Interface - VERSION HISTORY
1.5 - Novermber 8, 2002
1.5 - Novermber 9, 2002
* New language file format
* Language strings can be changed in the script without editing language files
* Install Options macro's updated. MUI_INSTALLOPTIONS_DISPLAY is the standard macro now.
Use MUI_INSTALLOPTIONS_INITDIALOG and MUI_INSTALLOPTIONS_SHOW if you want to customize dialog controls.
* Start Menu Folder selection page
* Compatible with new paging system
* Renamed macro's and defines
* Some small fixes

View file

@ -34,6 +34,11 @@
!insertmacro MUI_LANGUAGEFILE_STRING MUI_TEXT_FINISHED_TITLE "Finished"
!insertmacro MUI_LANGUAGEFILE_STRING MUI_TEXT_FINISHED_SUBTITLE "Setup was completed successfully."
!insertmacro MUI_LANGUAGEFILE_STRING MUI_TEXT_STARTMENU_WINDOWTITLE "Start Menu Folder"
!insertmacro MUI_LANGUAGEFILE_STRING MUI_TEXT_STARTMENU_TITLE "Choose Start Menu Folder"
!insertmacro MUI_LANGUAGEFILE_STRING MUI_TEXT_STARTMENU_SUBTITLE "Choose a Start Menu folder for the program's shortcuts."
!insertmacro MUI_LANGUAGEFILE_STRING MUI_INNERTEXT_STARTMENU "Select the Start Menu folder in which you would like to create the program's shotcuts. You can also enter a name to create a new folder. Click Install to start the installation."
!insertmacro MUI_LANGUAGEFILE_STRING MUI_TEXT_ABORTWARNING "Are you sure you want to quit ${MUI_PRODUCT} Setup?"
!insertmacro MUI_LANGUAGEFILE_STRING MUI_TEXT_WINDOWTITLE "${MUI_NAME} Setup"

View file

@ -137,14 +137,17 @@ with a custom user interface.</p>
!define MUI_COMPONENTSPAGE ;Component-selection page
!define MUI_DIRECTORYPAGE ;Directory-selection page
!define MUI_LICENSEPAGE ;License page
!define MUI_STARTMENUPAGE ;Start Menu-selection page
!define MUI_ABORTWARNING ;Abort warning messagebox
!define MUI_INSTALLOPTIONS ;Install Options
!define MUI_CUSTOMPAGECOMMANDS ;Use customized pages
!define MUI_WINDOWTITLE ;Insert string for the window title
!define MUI_UNINSTALLER ;Uninstaller
!define MUI_UNINSTALLOPTIONS ;Install Options in Uninstaller
!define MUI_CUSTOMPAGECOMMANDS ;Use customized uninstaller pages
!define MUI_UNCUSTOMPAGECOMMANDS ;Use customized uninstaller pages
</pre>
<p class="text">MUI_WINDOWTITLE is required by MUI_(UN)INSTALLOPTIONS_WRITETITLE.
<p class="subheader">4. Insert language files</span></p>
<p class="text">Insert the Modern UI language files for the languages you are using:</p>
<pre class="margin">!insertmacro MUI_LANGUAGE "English"</pre>
@ -158,6 +161,11 @@ with a custom user interface.</p>
</pre>
<p class="text">Have a look at the language files for a complete list of all the
names.
<p class="text"><span class="bold">NOTE:</span> Not all language files contain strings for the
new Start Menu-selection page yet. If you are using a language file which does not contain
these strings, you should always define them.<br>Please help to translate the new strings and
post them at the <a href="http://forums.winamp.com/forumdisplay.php?forumid=65">NSIS
Forum</a>.</p>
<p class="subheader">5. Define interface settings (optional)</span></p>
<p class="text">You can change the settings of the interface by usings defines:</p>
<pre class="margin">!define MUI_UI "${NSISDIR}\Contrib\UIs\modern2.exe"</pre>
@ -217,9 +225,8 @@ SectionEnd
<p class="text">Have a look at the <a href="..\InstallOptions\Install Options.html">
Install Options documentation</a> for info about creating Install Options INI Files.</p>
<p class="subheader">Custom page commands</p>
<p class="text">If you want add custom pages to your installer using Install Options,
you should insert you own page commands to set the order of the pages and the names
of the page functions.</p>
<p class="text">If you want add custom pages to your installer, you should insert you
own page commands to set the order of the pages and the names of the page functions.</p>
<pre class="margin">
!insertmacro MUI_PAGECOMMAND_LICENSE
!insertmacro MUI_PAGECOMMAND_COMPONENTS
@ -242,19 +249,23 @@ LangString TEXT_IO_TITLE ${LANG_ENGLISH} "Install Options Page"
LangString TEXT_IO_SUBTITLE ${LANG_ENGLISH} "Create your own dialog!"
Function [function name]
!insertmacro MUI_HEADER_TEXT $(TEXT_IO_TITLE) $(TEXT_IO_SUBTITLE)
!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"
!insertmacro MUI_INSTALLOPTIONS_SHOW "ioFile.ini"
FunctionEnd
</pre>
<p class="subheader">Write title and abortwarning</p>
<p class="subheader">Write title to Install Options INI Files</p>
<p class="text">Use these macro's in .onInit to write the page
title and abortwarning to an INI File.</p>
title to an Install Options INI File.</p>
<pre class="margin">
LangString TEXT_IO_PAGETITLE ${LANG_ENGLISH} "Page Title"
!insertmacro MUI_INSTALLOPTIONS_WRITETITLE "ioFile.ini" "$(TEXT_IO_PAGETITLE)"
!insertmacro MUI_INSTALLOPTIONS_WRITEABORTWARNING "ioFile.ini" \
"$(TEXT_IO_PAGETITLE)"
</pre>
<p class="text">For the uninstaller, use:</p>
<pre class="margin">
LangString UNTEXT_IO_PAGETITLE ${LANG_ENGLISH} "Uninstaller Page Title"
!insertmacro MUI_UNINSTALLOPTIONS_WRITETITLE "ioFile.ini" "$(UNTEXT_IO_PAGETITLE)"
</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>
@ -283,7 +294,7 @@ The 'verifying installer' and 'unpacking data' texts are defined in
To change them, you need to edit this file and recompile NSIS.</p>
<p class="header">Version history</p>
<ul>
<li class="changelog">1.5 - November 8, 2002
<li class="changelog">1.5 - November 9, 2002
<ul>
<li>New language file format
<li>Language strings can be changed in the script without editing
@ -291,6 +302,8 @@ The 'verifying installer' and 'unpacking data' texts are defined in
<li>Install Options macro's updated. MUI_INSTALLOPTIONS_DISPLAY is
the standard macro now. Use MUI_INSTALLOPTIONS_INITDIALOG and
MUI_INSTALLOPTIONS_SHOW if you want to customize dialog controls.
<li>Start Menu Folder selection page
<li>Compatible with new paging system
<li>Renamed macro's and defines
<li>Some small fixes
</ul>

View file

@ -228,6 +228,7 @@
!insertmacro MUI_PAGECOMMAND_LICENSE
!insertmacro MUI_PAGECOMMAND_COMPONENTS
!insertmacro MUI_PAGECOMMAND_DIRECTORY
!insertmacro MUI_PAGECOMMAND_STARTMENU
!insertmacro MUI_PAGECOMMAND_INSTFILES
!endif
@ -272,6 +273,18 @@
!macroend
!macro MUI_PAGECOMMAND_STARTMENU
!verbose 3
!ifdef MUI_STARTMENUPAGE
Page custom SetStartmenu
!endif
!verbose 4
!macroend
!macro MUI_PAGECOMMAND_INSTFILES
!verbose 3
@ -337,8 +350,7 @@
;Init plugin system
!ifndef MUI_INSTALLOPTIONS_INITPLUGINS
!define MUI_INSTALLOPTIONS_INITPLUGINS
Call Initialize_____Plugins
SetDetailsPrint both
InitPluginsDir
!endif
File "/oname=$PLUGINSDIR\${FILE}" "${FILE}"
@ -354,8 +366,7 @@
;Init plugin system
!ifndef MUI_INSTALLOPTIONS_UNINITPLUGINS
!define MUI_INSTALLOPTIONS_UNINITPLUGINS
Call un.Initialize_____Plugins
SetDetailsPrint both
InitPluginsDir
!endif
File /oname=$PLUGINSDIR\${FILE} "${FILE}"
@ -367,21 +378,10 @@
!macro MUI_INSTALLOPTIONS_DISPLAY FILE
!verbose 3
Push ${MUI_TEMP1}
InstallOptions::dialog "$PLUGINSDIR\${FILE}"
Pop ${MUI_TEMP1}
StrCmp ${MUI_TEMP1} "cancel" "" +2
Quit
StrCmp ${MUI_TEMP1} "back" "" +3
Pop ${MUI_TEMP1}
Abort
Pop ${MUI_TEMP1}
!verbose 4
!macroend
@ -455,18 +455,18 @@
!macroend
!macro MUI_INSTALLOPTIONS_WRITEABORTWARNING FILE
!macro MUI_UNINSTALLOPTIONS_WRITETITLE FILE TITLE
!verbose 3
!ifdef MUI_ABORTWARNING
Push ${MUI_TEMP1}
!insertmacro MUI_INSTALLOPTIONS_WRITE "${FILE}" "Settings" "CancelConfirm" "$(MUI_TEXT_ABORTWARNING)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "${FILE}" "Settings" "CancelConfirmCaption" "$(MUI_TEXT_WINDOWTITLE)"
StrCpy ${MUI_TEMP1} "$(MUI_UNTEXT_WINDOWTITLE)"
StrCpy ${MUI_TEMP2} "${MUI_TEMP1}: ${TITLE}"
!insertmacro MUI_INSTALLOPTIONS_WRITE "${FILE}" "Settings" "Title" "${MUI_TEMP1}"
!endif
!verbose 4
Pop ${MUI_TEMP1}
!macroend
@ -519,6 +519,10 @@
!insertmacro MUI_FUNCTIONS_DIRECTORYPAGE SetDirectory SetDirectoryDialog
!endif
!ifdef MUI_STARTMENUPAGE
!insertmacro MUI_FUNCTIONS_STARTMENUPAGE SetStartmenu
!endif
!insertmacro MUI_FUNCTIONS_INSTFILESPAGE SetInstFiles
!verbose 4
@ -558,15 +562,15 @@
!macroend
!macro MUI_FUNCTIONS_DIRECTORYPAGE SETDIRECTORYPAGE SETDIRECTORYDIALOGPAGE
!macro MUI_FUNCTIONS_DIRECTORYPAGE SETDIRECTORY SETDIRECTORYDIALOG
!verbose 3
Function "${SETDIRECTORYPAGE}"
Function "${SETDIRECTORY}"
!insertmacro MUI_HEADER_TEXT $(MUI_TEXT_DIRECTORY_TITLE) $(MUI_TEXT_DIRECTORY_SUBTITLE)
FunctionEnd
Function "${SETDIRECTORYDIALOGPAGE}"
Function "${SETDIRECTORYDIALOG}"
!insertmacro MUI_INNERDIALOG_TEXT 1041 $(MUI_INNERTEXT_DIRECTORY_DESTINATION)
FunctionEnd
@ -574,6 +578,42 @@
!macroend
!macro MUI_FUNCTIONS_STARTMENUPAGE SETSTARTMENU
!verbose 3
;Check defines
!ifndef MUI_STARTMENU_VARIABLE
!define MUI_STARTMENU_VARIABLE "$9"
!endif
!ifndef MUI_STARTMENU_DEFAULTFOLDER
!define MUI_STARTMENU_DEFAULTFOLDER "${MUI_PRODUCT}"
!endif
Function "${SETSTARTMENU}"
!insertmacro MUI_HEADER_TEXT $(MUI_TEXT_STARTMENU_TITLE) $(MUI_TEXT_STARTMENU_SUBTITLE)
Push ${MUI_TEMP1}
Push ${MUI_TEMP2}
StrCpy ${MUI_TEMP1} "$(MUI_TEXT_WINDOWTITLE)"
StrCpy ${MUI_TEMP2} "$(MUI_TEXT_STARTMENU_WINDOWTITLE)"
SendMessage $HWNDPARENT ${WM_SETTEXT} 0 "STR:${MUI_TEMP1}: ${MUI_TEMP2}"
StartMenu::Select /noicon /autoadd /text "$(MUI_INNERTEXT_STARTMENU)" /lastused "${MUI_STARTMENU_VARIABLE}" "${MUI_STARTMENU_DEFAULTFOLDER}"
Pop "${MUI_STARTMENU_VARIABLE}"
Pop ${MUI_TEMP1}
Pop ${MUI_TEMP2}
FunctionEnd
!verbose 4
!macroend
!macro MUI_FUNCTIONS_INSTFILESPAGE SETINSTFILES
!verbose 3
@ -766,6 +806,12 @@
!macro MUI_LANGUAGEFILE_END
!ifdef MUI_STARTMENUPAGE
!ifndef MUI_WINDOWTITLE
!define MUI_WINDOWTITLE
!endif
!endif
!insertmacro MUI_LANGUAGEFILE_DEFINE "MUI_${LANGUAGE}_LANGNAME" "MUI_LANGNAME" "${MUI_LANGNAME}"
!insertmacro MUI_LANGUAGEFILE_NSISCOMMAND Name MUI_NAME "${MUI_NAME}"
@ -792,6 +838,13 @@
!insertmacro MUI_LANGUAGEFILE_LANGSTRING MUI_INNERTEXT_DIRECTORY_DESTINATION "${MUI_INNERTEXT_DIRECTORY_DESTINATION}"
!endif
!ifdef MUI_STARTMENUPAGE
!insertmacro MUI_LANGUAGEFILE_LANGSTRING "MUI_TEXT_STARTMENU_WINDOWTITLE" "${MUI_TEXT_STARTMENU_WINDOWTITLE}"
!insertmacro MUI_LANGUAGEFILE_LANGSTRING "MUI_TEXT_STARTMENU_TITLE" "${MUI_TEXT_STARTMENU_TITLE}"
!insertmacro MUI_LANGUAGEFILE_LANGSTRING "MUI_TEXT_STARTMENU_SUBTITLE" "${MUI_TEXT_STARTMENU_SUBTITLE}"
!insertmacro MUI_LANGUAGEFILE_LANGSTRING "MUI_INNERTEXT_STARTMENU" "${MUI_INNERTEXT_STARTMENU}"
!endif
!insertmacro MUI_LANGUAGEFILE_LANGSTRING "MUI_TEXT_INSTALLING_TITLE" "${MUI_TEXT_INSTALLING_TITLE}"
!insertmacro MUI_LANGUAGEFILE_LANGSTRING "MUI_TEXT_INSTALLING_SUBTITLE" "${MUI_TEXT_INSTALLING_SUBTITLE}"
@ -802,7 +855,7 @@
!insertmacro MUI_LANGUAGEFILE_LANGSTRING "MUI_TEXT_ABORTWARNING" "${MUI_TEXT_ABORTWARNING}"
!endif
!ifdef MUI_INSTALLOPTIONS
!ifdef MUI_WINDOWTITLE
!insertmacro MUI_LANGUAGEFILE_LANGSTRING "MUI_TEXT_WINDOWTITLE" "${MUI_TEXT_WINDOWTITLE}"
!endif
@ -818,7 +871,7 @@
!insertmacro MUI_LANGUAGEFILE_UNLANGSTRING "MUI_UNTEXT_FINISHED_TITLE" "${MUI_UNTEXT_FINISHED_TITLE}"
!insertmacro MUI_LANGUAGEFILE_UNLANGSTRING "MUI_UNTEXT_FINISHED_SUBTITLE" "${MUI_UNTEXT_FINISHED_SUBTITLE}"
!ifdef MUI_UNINSTALLOPTIONS
!ifdef MUI_UNWINDOWTITLE
!insertmacro MUI_LANGUAGEFILE_UNLANGSTRING "MUI_UNTEXT_WINDOWTITLE" "${MUI_UNTEXT_WINDOWTITLE}"
!endif
!endif

View file

@ -10,13 +10,13 @@
;--------------------------------
;Configuration
!define MUI_INSTALLOPTIONS
!define MUI_LICENSEPAGE
!define MUI_COMPONENTSPAGE
!define MUI_DIRECTORYPAGE
!define MUI_ABORTWARNING
!define MUI_UNINSTALLER
!define MUI_WINDOWTITLE
!define TEMP1 $R0
!define TEMP2 $R1
@ -114,25 +114,20 @@ Function .onInit
!insertmacro MUI_INSTALLOPTIONS_WRITETITLE "ioB.ini" "$(TEXT_IO_PAGETITLE_B)"
!insertmacro MUI_INSTALLOPTIONS_WRITETITLE "ioC.ini" "$(TEXT_IO_PAGETITLE_C)"
;Abort warnings for Install Options dialogs
!insertmacro MUI_INSTALLOPTIONS_WRITEABORTWARNING "ioA.ini"
!insertmacro MUI_INSTALLOPTIONS_WRITEABORTWARNING "ioB.ini"
!insertmacro MUI_INSTALLOPTIONS_WRITEABORTWARNING "ioC.ini"
FunctionEnd
Function SetCustomA
!insertmacro MUI_HEADER_TEXT $(TEXT_IO_TITLE) $(TEXT_IO_SUBTITLE)
!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioA.ini"
FunctionEnd
Function SetCustomB
!insertmacro MUI_HEADER_TEXT $(TEXT_IO_TITLE) $(TEXT_IO_SUBTITLE)
!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioB.ini"
FunctionEnd
Function SetCustomC
!insertmacro MUI_HEADER_TEXT $(TEXT_IO_TITLE) $(TEXT_IO_SUBTITLE)
!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioC.ini"
FunctionEnd

View file

@ -101,15 +101,11 @@ Section $(TITLE_SecCopyUI) SecCopyUI
SetOutPath "$INSTDIR"
File "${NSISDIR}\Contrib\UIs\modern.exe"
WriteUninstaller "$INSTDIR\Uninstall.exe"
SectionEnd
Section ""
;Invisible section to write the language to the registry
;Write language to the registry (for the uninstaller)
WriteRegStr HKCU "Software\${MUI_PRODUCT}" "Installer Language" $LANGUAGE
WriteUninstaller "$INSTDIR\Uninstall.exe"
SectionEnd
!insertmacro MUI_SECTIONS_FINISHHEADER ;Insert this macro after the sections