Support for multiple IO pages in a row
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1137 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
da90e3b389
commit
b743d6a2c4
5 changed files with 93 additions and 32 deletions
|
@ -1,5 +1,3 @@
|
|||
;STILL WORKING ON INSTALLOPTIONS INTEGRATION
|
||||
|
||||
;NSIS Modern Style UI version 1.19
|
||||
;InstallOptions Example Script
|
||||
;Written by Joost Verburg
|
||||
|
@ -12,6 +10,7 @@
|
|||
!include "ModernUI.nsh"
|
||||
!verbose 4
|
||||
|
||||
!define IO_NOSETDIRECTION $7
|
||||
!define IO_DIRECTION $8
|
||||
!define CURRENTPAGE $9
|
||||
|
||||
|
@ -79,6 +78,7 @@ Function .onInit
|
|||
!insertmacro MUI_INSTALLOPTIONS_INIT ;Call this when using no plugins before using Install Options (init plugin system)
|
||||
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "iniA.ini"
|
||||
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "iniB.ini"
|
||||
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "iniC.ini"
|
||||
|
||||
FunctionEnd
|
||||
|
||||
|
@ -90,14 +90,14 @@ Function .onInitDialog
|
|||
!insertmacro MUI_INNERDIALOG_TEXT 1033 1040 "If you accept all the terms of the agreement, choose I Agree to continue. If you choose Cancel, Setup will close. You must accept the agreement to install ${NAME}."
|
||||
!insertmacro MUI_INNERDIALOG_STOP 1
|
||||
|
||||
!insertmacro MUI_INNERDIALOG_START 3
|
||||
!insertmacro MUI_INNERDIALOG_START 4
|
||||
!insertmacro MUI_INNERDIALOG_TEXT 1033 1042 "Description"
|
||||
!insertmacro MUI_INNERDIALOG_TEXT 1033 1043 "Hover your mouse over a component to see it's description."
|
||||
!insertmacro MUI_INNERDIALOG_STOP 3
|
||||
!insertmacro MUI_INNERDIALOG_STOP 4
|
||||
|
||||
!insertmacro MUI_INNERDIALOG_START 4
|
||||
!insertmacro MUI_INNERDIALOG_START 5
|
||||
!insertmacro MUI_INNERDIALOG_TEXT 1033 1041 "Destination Folder"
|
||||
!insertmacro MUI_INNERDIALOG_STOP 4
|
||||
!insertmacro MUI_INNERDIALOG_STOP 5
|
||||
|
||||
!insertmacro MUI_INNERDIALOG_END
|
||||
|
||||
|
@ -106,14 +106,20 @@ FunctionEnd
|
|||
Function .onNextPage
|
||||
|
||||
!insertmacro MUI_NEXTPAGE_OUTER
|
||||
!insertmacro MUI_INSTALLOPTIONS_SETDIRECTION ${IO_DIRECTION_NEXT}
|
||||
StrCmp ${IO_NOSETDIRECTION} "1" no_setdirection
|
||||
!insertmacro MUI_INSTALLOPTIONS_SETDIRECTION ${IO_DIRECTION_NEXT}
|
||||
no_setdirection:
|
||||
StrCpy ${IO_NOSETDIRECTION} "0"
|
||||
!insertmacro MUI_NEXTPAGE SetPage
|
||||
|
||||
FunctionEnd
|
||||
|
||||
Function .onPrevPage
|
||||
|
||||
!insertmacro MUI_INSTALLOPTIONS_SETDIRECTION ${IO_DIRECTION_PREV}
|
||||
StrCmp ${IO_NOSETDIRECTION} "1" no_setdirection
|
||||
!insertmacro MUI_INSTALLOPTIONS_SETDIRECTION ${IO_DIRECTION_PREV}
|
||||
no_setdirection:
|
||||
StrCpy ${IO_NOSETDIRECTION} "0"
|
||||
!insertmacro MUI_PREVPAGE SetPage
|
||||
|
||||
FunctionEnd
|
||||
|
@ -132,34 +138,43 @@ Function SetPage
|
|||
WriteIniStr "$PLUGINSDIR\iniA.ini" "Settings" "CancelConfirm" "Are you sure you want to quit ${NAME} Setup?"
|
||||
WriteIniStr "$PLUGINSDIR\iniA.ini" "Settings" "CancelConfirmCaption" "${NAME} ${VERSION} Setup"
|
||||
WriteIniStr "$PLUGINSDIR\iniA.ini" "Settings" "CancelConfirmIcon" "MB_ICONWARNING"
|
||||
!insertmacro MUI_INSTALLOPTIONS_SHOW "iniA.ini"
|
||||
!insertmacro MUI_INSTALLOPTIONS_SHOW 2 "iniA.ini" "" "IO" ;Next page is an IO page
|
||||
!insertmacro MUI_PAGE_STOP 2
|
||||
|
||||
!insertmacro MUI_PAGE_START 3
|
||||
!insertmacro MUI_HEADER_TEXT 1033 "Choose Components" "Choose the components you want to install."
|
||||
!insertmacro MUI_PAGE_STOP 3
|
||||
|
||||
!insertmacro MUI_PAGE_START 4
|
||||
!insertmacro MUI_HEADER_TEXT 1033 "Choose Install Location" "Choose the folder in which to install ${NAME}."
|
||||
!insertmacro MUI_PAGE_STOP 4
|
||||
|
||||
!insertmacro MUI_PAGE_START 5
|
||||
!insertmacro MUI_HEADER_TEXT 1033 "Install Options B" "Create your own dialog!"
|
||||
WriteIniStr "$PLUGINSDIR\iniB.ini" "Settings" "Title" "${NAME} ${VERSION} Setup: Install Options B"
|
||||
WriteIniStr "$PLUGINSDIR\iniB.ini" "Settings" "CancelConfirm" "Are you sure you want to quit ${NAME} Setup?"
|
||||
WriteIniStr "$PLUGINSDIR\iniB.ini" "Settings" "CancelConfirmCaption" "${NAME} ${VERSION} Setup"
|
||||
WriteIniStr "$PLUGINSDIR\iniB.ini" "Settings" "CancelConfirmIcon" "MB_ICONWARNING"
|
||||
!insertmacro MUI_INSTALLOPTIONS_SHOW "iniB.ini"
|
||||
!insertmacro MUI_INSTALLOPTIONS_SHOW 3 "iniB.ini" "IO" "" ;Previous page is an IO page
|
||||
!insertmacro MUI_PAGE_STOP 3
|
||||
|
||||
!insertmacro MUI_PAGE_START 4
|
||||
!insertmacro MUI_HEADER_TEXT 1033 "Choose Components" "Choose the components you want to install."
|
||||
!insertmacro MUI_PAGE_STOP 4
|
||||
|
||||
!insertmacro MUI_PAGE_START 5
|
||||
!insertmacro MUI_HEADER_TEXT 1033 "Choose Install Location" "Choose the folder in which to install ${NAME}."
|
||||
!insertmacro MUI_PAGE_STOP 5
|
||||
|
||||
!insertmacro MUI_PAGE_START 6
|
||||
!insertmacro MUI_HEADER_TEXT 1033 "Installing" "Please wait while ${NAME} is being installed."
|
||||
!insertmacro MUI_HEADER_TEXT 1033 "Install Options C" "Create your own dialog!"
|
||||
WriteIniStr "$PLUGINSDIR\iniB.ini" "Settings" "Title" "${NAME} ${VERSION} Setup: Install Options C"
|
||||
WriteIniStr "$PLUGINSDIR\iniB.ini" "Settings" "CancelConfirm" "Are you sure you want to quit ${NAME} Setup?"
|
||||
WriteIniStr "$PLUGINSDIR\iniB.ini" "Settings" "CancelConfirmCaption" "${NAME} ${VERSION} Setup"
|
||||
WriteIniStr "$PLUGINSDIR\iniB.ini" "Settings" "CancelConfirmIcon" "MB_ICONWARNING"
|
||||
!insertmacro MUI_INSTALLOPTIONS_SHOW 6 "iniC.ini" "" ""
|
||||
!insertmacro MUI_PAGE_STOP 6
|
||||
|
||||
!insertmacro MUI_PAGE_START 7
|
||||
!insertmacro MUI_HEADER_TEXT 1033 "Finished" "Setup was completed successfully."
|
||||
!insertmacro MUI_HEADER_TEXT 1033 "Installing" "Please wait while ${NAME} is being installed."
|
||||
!insertmacro MUI_PAGE_STOP 7
|
||||
|
||||
!insertmacro MUI_PAGE_START 8
|
||||
!insertmacro MUI_HEADER_TEXT 1033 "Finished" "Setup was completed successfully."
|
||||
!insertmacro MUI_PAGE_STOP 8
|
||||
|
||||
!insertmacro MUI_PAGE_END
|
||||
|
||||
FunctionEnd
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;Modern UI Header File version 1.19f - WORKING ON INSTALLOPTIONS INTEGRATION
|
||||
;Modern UI Header File version 1.19g
|
||||
;Written by Joost Verburg
|
||||
|
||||
;See Example.nsi & Multilanguage.nsi for an example of usage
|
||||
|
@ -228,7 +228,7 @@
|
|||
|
||||
!macroend
|
||||
|
||||
!macro MUI_INSTALLOPTIONS_SHOW FILE
|
||||
!macro MUI_INSTALLOPTIONS_SHOW PAGE FILE IOBACK IONEXT
|
||||
|
||||
InstallOptions::dialog "$PLUGINSDIR\${FILE}"
|
||||
Pop ${TEMP1}
|
||||
|
@ -236,14 +236,15 @@
|
|||
StrCmp ${TEMP1} "cancel" "" +2
|
||||
Quit
|
||||
|
||||
StrCmp ${TEMP1} "back" "" +7
|
||||
!insertmacro MUI_INSTALLOPTIONS_BACK
|
||||
StrCmp ${TEMP1} "back" "" noback_${PAGE}
|
||||
!insertmacro MUI_INSTALLOPTIONS_${IOBACK}BACK
|
||||
noback_${PAGE}:
|
||||
|
||||
!insertmacro MUI_INSTALLOPTIONS_NEXT
|
||||
!insertmacro MUI_INSTALLOPTIONS_${IONEXT}NEXT
|
||||
|
||||
!macroend
|
||||
|
||||
!macro MUI_INSTALLOPTIONS_UNSHOW FILE
|
||||
!macro MUI_INSTALLOPTIONS_UNSHOW PAGE FILE IOBACK IONEXT
|
||||
|
||||
InstallOptions::dialog "$PLUGINSDIR\${FILE}"
|
||||
Pop ${TEMP1}
|
||||
|
@ -251,10 +252,11 @@
|
|||
StrCmp ${TEMP1} "cancel" "" +2
|
||||
Quit
|
||||
|
||||
StrCmp ${TEMP1} "back" "" +7
|
||||
!insertmacro MUI_INSTALLOPTIONS_UNBACK
|
||||
StrCmp ${TEMP1} "back" "" noback_${PAGE}
|
||||
!insertmacro MUI_INSTALLOPTIONS_UN${IOBACK}BACK
|
||||
noback_${PAGE}:
|
||||
|
||||
!insertmacro MUI_INSTALLOPTIONS_UNNEXT
|
||||
!insertmacro MUI_INSTALLOPTIONS_UN${IONEXT}NEXT
|
||||
|
||||
!macroend
|
||||
|
||||
|
@ -280,6 +282,22 @@
|
|||
|
||||
!macroend
|
||||
|
||||
!macro MUI_INSTALLOPTIONS_IOBACK
|
||||
|
||||
StrCpy ${IO_NOSETDIRECTION} "1"
|
||||
Call .onPrevPage
|
||||
Goto done
|
||||
|
||||
!macroend
|
||||
|
||||
!macro MUI_INSTALLOPTIONS_IONEXT
|
||||
|
||||
StrCpy ${IO_NOSETDIRECTION} "1"
|
||||
Call .onNextPage
|
||||
Goto done
|
||||
|
||||
!macroend
|
||||
|
||||
!macro MUI_INSTALLOPTIONS_UNBACK
|
||||
|
||||
StrCmp ${IO_DIRECTION} "${IO_DIRECTION_NEXT}" "" +3
|
||||
|
@ -302,4 +320,20 @@
|
|||
|
||||
!macroend
|
||||
|
||||
!macro MUI_INSTALLOPTIONS_UNIOBACK
|
||||
|
||||
StrCpy ${IO_NOSETDIRECTION} "1"
|
||||
Call .onPrevPage
|
||||
Goto done
|
||||
|
||||
!macroend
|
||||
|
||||
!macro MUI_INSTALLOPTIONS_UNIONEXT
|
||||
|
||||
StrCpy ${IO_NOSETDIRECTION} "1"
|
||||
Call .onNextPage
|
||||
Goto done
|
||||
|
||||
!macroend
|
||||
|
||||
!endif
|
|
@ -123,8 +123,7 @@ table
|
|||
file and recompile NSIS.</p>
|
||||
<p class="header">Version history</p>
|
||||
<ul>
|
||||
<li class="text">Working on the following things (no support for multiple
|
||||
IO pages in a row yet)
|
||||
<li class="text">Working on the following things
|
||||
<ul>
|
||||
<li>InstallOptions support in macro system
|
||||
<li>Added Modern UI + InstallOptions example
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
NumFields=1
|
||||
BackEnabled=1
|
||||
BackButtonText=< Back
|
||||
NextButtonText=Install
|
||||
NextButtonText=Next >
|
||||
|
||||
[Field 1]
|
||||
Type=label
|
||||
|
|
13
Examples/Modern UI/iniC.ini
Normal file
13
Examples/Modern UI/iniC.ini
Normal file
|
@ -0,0 +1,13 @@
|
|||
[Settings]
|
||||
NumFields=1
|
||||
BackEnabled=1
|
||||
BackButtonText=< Back
|
||||
NextButtonText=Install
|
||||
|
||||
[Field 1]
|
||||
Type=label
|
||||
text=IniB
|
||||
left=0
|
||||
right=350
|
||||
top=10
|
||||
bottom=25
|
Loading…
Add table
Add a link
Reference in a new issue