new Page system

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1539 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
joostverburg 2002-11-01 20:46:42 +00:00
parent c700365ee8
commit 6a013ea16b
2 changed files with 44 additions and 120 deletions

View file

@ -1,18 +1,6 @@
[Settings] [Settings]
NumFields=6 NumFields=6
Title=Install Options Test Setup: Testing Installer Options
Title=Test Install Setup: Testing Installer Options
; uncomment this to confirm on exit.
; CancelConfirm=Are you sure you want to cancel the install?
; comment this out to hide the back button
BackEnabled=1
; you can override the defaults here
CancelButtonText=Cancel
NextButtonText=Next >
BackButtonText=< Back
[Field 1] [Field 1]
Type=checkbox Type=checkbox
@ -64,4 +52,4 @@ Left=0
Right=-1 Right=-1
Top=85 Top=85
Bottom=104 Bottom=104
Text=This is a label... Text=This is a label...

View file

@ -1,128 +1,64 @@
; Copyright (C) 2001 Michael Bishop ;Install Options Test Script
; ;Written by Joost Verburg
; This software is provided 'as-is', without any express or implied
; warranty. In no event will the authors be held liable for any damages
; arising from the use of this software.
;
; Permission is granted to anyone to use this software for any purpose,
; including commercial applications, and to alter it and redistribute it
; freely, subject to the following restrictions:
;
; 1. The origin of this software must not be misrepresented; you must not
; claim that you wrote the original software. If you use this software
; in a product, an acknowledgment in the product documentation would be
; appreciated but is not required.
; 2. Altered source versions must be plainly marked as such, and must not be
; misrepresented as being the original software.
; 3. This notice may not be removed or altered from any source distribution.
;
; Test installation script !define TEMP1 $R0
; The name of the installer ;The name of the installer
Name "Test Install" Name "Install Options Test"
; The file to write ; The file to write
OutFile "test-setup.exe" OutFile "Test.exe"
ShowInstDetails show
; The default installation directory ; The default installation directory
InstallDir $PROGRAMFILES\Test InstallDir "$PROGRAMFILES\IOTest"
DirText "Choose dir" DirText "Choose a directory"
LicenseText "You are about to install test install and it owns, you will love it, we think." LicenseText "A license"
LicenseData "..\..\license.txt" LicenseData "..\..\License.txt"
ComponentText "Choose components" ComponentText "Choose components"
; Do not automatically close the installation window Page license
AutoCloseWindow false Page custom SetCustom ;Custom page. Install Options gets called in SetCustom,
Page components
; Define some installation templates Page directory
InstType "Typical" ; 1 Page instfiles
Section "Required Components"
ReadINIStr $R0 $7 "Field 1" State
DetailPrint "Install X=$R0"
ReadINIStr $R0 $7 "Field 2" State
DetailPrint "Install Y=$R0"
ReadINIStr $R0 $7 "Field 3" State
DetailPrint "Install Z=$R0"
ReadINIStr $R0 $7 "Field 4" State
DetailPrint "File=$R0"
ReadINIStr $R0 $7 "Field 5" State
DetailPrint "Dir=$R0"
Section "Components"
ReadINIStr ${TEMP1} "$PLUGINSDIR\test.nsi" "Field 1" "State"
MessageBox MB_OK "Install X=$R0"
ReadINIStr ${TEMP1} "$PLUGINSDIR\test.nsi" "Field 2" "State"
MessageBox MB_OK "Install Y=$R0"
ReadINIStr ${TEMP1} "$PLUGINSDIR\test.nsi" "Field 3" "State"
MessageBox MB_OK "Install Z=$R0"
ReadINIStr ${TEMP1} "$PLUGINSDIR\test.nsi" "Field 4" "State"
MessageBox MB_OK "File=$R0"
ReadINIStr ${TEMP1} "$PLUGINSDIR\test.nsi" "Field 5" "State"
MessageBox MB_OK "Dir=$R0"
SectionEnd SectionEnd
Section "more components"
Nop
SectionEnd
; $9 = counter
; $8 = DLL
; $7 = ini
Function .onInit Function .onInit
StrCpy $9 0 ;Extract Install Options files
GetTempFileName $8 Call Initialize_____Plugins
GetTempFileName $7 SetDetailsPrint both
File /oname=$8 ..\..\Plugins\InstallOptions.dll
File /oname=$7 "test.ini" File /oname=$PLUGINSDIR\test.nsi "test.nsi"
FunctionEnd FunctionEnd
; cleanup on exit. Function SetCustom
Function .onInstSuccess
Call Cleanup
FunctionEnd
Function .onInstFailed Push ${TEMP1}
Call Cleanup
FunctionEnd
Function .onUserAbort InstallOptions::dialog "$PLUGINSDIR\test.nsi"
Call Cleanup Pop ${TEMP1}
FunctionEnd
Function Cleanup StrCmp ${TEMP1} "cancel" "" +3
Delete $8 Pop ${TEMP1}
Delete $7
FunctionEnd
Function .onNextPage
StrCmp $9 1 good
IntOp $9 $9 + 1
Return
good:
Call RunConfigure
Pop $0
StrCmp $0 "cancel" "" nocancel
Call Cleanup
Quit Quit
nocancel:
StrCmp $0 "back" "" noback
Abort
noback:
IntOp $9 $9 + 1
FunctionEnd
Function .onPrevPage StrCmp ${TEMP1} "back" "" +3
StrCmp $9 2 good Pop ${TEMP1}
IntOp $9 $9 - 1
Return
good:
Call RunConfigure
Pop $0
StrCmp $0 "cancel" "" nocancel
Call Cleanup
Quit
nocancel:
StrCmp $0 "back" back
Abort Abort
back:
IntOp $9 $9 - 1 Pop ${TEMP1}
FunctionEnd
Function RunConfigure
Push $7
CallInstDLL $8 dialog
FunctionEnd FunctionEnd