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]
NumFields=6
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
Title=Install Options Test Setup: Testing Installer Options
[Field 1]
Type=checkbox
@ -64,4 +52,4 @@ Left=0
Right=-1
Top=85
Bottom=104
Text=This is a label...
Text=This is a label...

View file

@ -1,128 +1,64 @@
; Copyright (C) 2001 Michael Bishop
;
; 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.
;
;Install Options Test Script
;Written by Joost Verburg
; Test installation script
!define TEMP1 $R0
; The name of the installer
Name "Test Install"
;The name of the installer
Name "Install Options Test"
; The file to write
OutFile "test-setup.exe"
ShowInstDetails show
OutFile "Test.exe"
; The default installation directory
InstallDir $PROGRAMFILES\Test
InstallDir "$PROGRAMFILES\IOTest"
DirText "Choose dir"
LicenseText "You are about to install test install and it owns, you will love it, we think."
LicenseData "..\..\license.txt"
DirText "Choose a directory"
LicenseText "A license"
LicenseData "..\..\License.txt"
ComponentText "Choose components"
; Do not automatically close the installation window
AutoCloseWindow false
; Define some installation templates
InstType "Typical" ; 1
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"
Page license
Page custom SetCustom ;Custom page. Install Options gets called in SetCustom,
Page components
Page directory
Page instfiles
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
Section "more components"
Nop
SectionEnd
; $9 = counter
; $8 = DLL
; $7 = ini
Function .onInit
StrCpy $9 0
GetTempFileName $8
GetTempFileName $7
File /oname=$8 ..\..\Plugins\InstallOptions.dll
File /oname=$7 "test.ini"
;Extract Install Options files
Call Initialize_____Plugins
SetDetailsPrint both
File /oname=$PLUGINSDIR\test.nsi "test.nsi"
FunctionEnd
; cleanup on exit.
Function .onInstSuccess
Call Cleanup
FunctionEnd
Function SetCustom
Function .onInstFailed
Call Cleanup
FunctionEnd
Push ${TEMP1}
Function .onUserAbort
Call Cleanup
FunctionEnd
InstallOptions::dialog "$PLUGINSDIR\test.nsi"
Pop ${TEMP1}
Function Cleanup
Delete $8
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
StrCmp ${TEMP1} "cancel" "" +3
Pop ${TEMP1}
Quit
nocancel:
StrCmp $0 "back" "" noback
Abort
noback:
IntOp $9 $9 + 1
FunctionEnd
Function .onPrevPage
StrCmp $9 2 good
IntOp $9 $9 - 1
Return
good:
Call RunConfigure
Pop $0
StrCmp $0 "cancel" "" nocancel
Call Cleanup
Quit
nocancel:
StrCmp $0 "back" back
StrCmp ${TEMP1} "back" "" +3
Pop ${TEMP1}
Abort
back:
IntOp $9 $9 - 1
FunctionEnd
Function RunConfigure
Push $7
CallInstDLL $8 dialog
Pop ${TEMP1}
FunctionEnd