merged from work

This commit is contained in:
2019-12-20 20:02:14 +01:00
parent 202608651b
commit 11e3a02511
505 changed files with 65307 additions and 823 deletions

View File

@ -0,0 +1,76 @@
[Settings]
NumFields=8
[Field 1]
Type=GroupBox
Left=0
Right=-1
Top=0
Bottom=-5
Text=" This is a group box... "
[Field 2]
Type=checkbox
Text=Install support for X
Left=10
Right=-10
Top=17
Bottom=25
State=0
Flags=GROUP
[Field 3]
Type=checkbox
Text=Install support for Y
Left=10
Right=-10
Top=30
Bottom=38
State=1
Flags=NOTABSTOP
[Field 4]
Type=checkbox
Text=Install support for Z
Left=10
Right=-10
Top=43
Bottom=51
State=0
Flags=NOTABSTOP
[Field 5]
Type=FileRequest
State=C:\dummy.xyz
Left=10
Right=-10
Top=56
Bottom=68
Filter=XYZ Files|*.xyz|All files|*.*
Flags=GROUP|FILE_MUST_EXIST|FILE_EXPLORER|FILE_HIDEREADONLY
[Field 6]
Type=DirRequest
Left=10
Right=-10
Top=73
Bottom=85
Text=Select a directory...
State=C:\Program Files\NSIS
[Field 7]
Type=Label
Left=10
Right=-10
Top=90
Bottom=98
Text=This is a label...
[Field 8]
Type=Text
Left=10
Right=-10
Top=98
Bottom=120
State="Multiline\r\nedit..."
Flags=MULTILINE|VSCROLL|WANTRETURN

View File

@ -0,0 +1,84 @@
;InstallOptions Test Script
;Written by Joost Verburg
;--------------------------
!define TEMP1 $R0 ;Temp variable
;The name of the installer
Name "InstallOptions Test"
;The file to write
OutFile "Test.exe"
; Show install details
ShowInstDetails show
;Things that need to be extracted on startup (keep these lines before any File command!)
;Only useful for BZIP2 compression
;Use ReserveFile for your own InstallOptions INI files too!
ReserveFile /plugin InstallOptions.dll
ReserveFile "test.ini"
;Order of pages
Page custom SetCustom ValidateCustom ": Testing InstallOptions" ;Custom page. InstallOptions gets called in SetCustom.
Page instfiles
Section "Components"
;Get Install Options dialog user input
ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 2" "State"
DetailPrint "Install X=${TEMP1}"
ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 3" "State"
DetailPrint "Install Y=${TEMP1}"
ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 4" "State"
DetailPrint "Install Z=${TEMP1}"
ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 5" "State"
DetailPrint "File=${TEMP1}"
ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 6" "State"
DetailPrint "Dir=${TEMP1}"
ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 8" "State"
DetailPrint "Info=${TEMP1}"
SectionEnd
Function .onInit
;Extract InstallOptions files
;$PLUGINSDIR will automatically be removed when the installer closes
InitPluginsDir
File /oname=$PLUGINSDIR\test.ini "test.ini"
FunctionEnd
Function SetCustom
;Display the InstallOptions dialog
Push ${TEMP1}
InstallOptions::dialog "$PLUGINSDIR\test.ini"
Pop ${TEMP1}
Pop ${TEMP1}
FunctionEnd
Function ValidateCustom
ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 2" "State"
StrCmp ${TEMP1} 1 done
ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 3" "State"
StrCmp ${TEMP1} 1 done
ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 4" "State"
StrCmp ${TEMP1} 1 done
MessageBox MB_ICONEXCLAMATION|MB_OK "You must select at least one install option!"
Abort
done:
FunctionEnd

View File

@ -0,0 +1,65 @@
[Settings]
NumFields=8
[Field 1]
Type=GroupBox
Left=0
Right=-1
Top=0
Bottom=-5
Text=" Images "
[Field 2]
Type=Bitmap
Left=10
Right=-10
Top=10
Bottom=30
Flags=TRANSPARENT
[Field 3]
Type=Bitmap
Left=10
Right=-10
Top=35
Bottom=45
Flags=TRANSPARENT
[Field 4]
Type=Bitmap
Left=10
Right=-10
Top=50
Bottom=70
Flags=RESIZETOFIT|TRANSPARENT
[Field 5]
Type=Bitmap
Left=10
Right=-10
Top=75
Bottom=95
Flags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ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ

View File

@ -0,0 +1,59 @@
;InstallOptions Test Script
;Written by Joost Verburg
;--------------------------
;The name of the installer
Name "InstallOptions Test"
;The file to write
OutFile "Test.exe"
; Show install details
ShowInstDetails show
;Things that need to be extracted on startup (keep these lines before any File command!)
;Only useful for BZIP2 compression
;Use ReserveFile for your own InstallOptions INI files too!
ReserveFile /plugin InstallOptions.dll
ReserveFile "testimgs.ini"
ReserveFile "${NSISDIR}\Contrib\Graphics\Checks\colorful.bmp"
ReserveFile "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp"
ReserveFile "${NSISDIR}\Contrib\Graphics\Icons\pixel-install.ico"
;Order of pages
Page custom SetCustom "" ": Testing InstallOptions" ;Custom page. InstallOptions gets called in SetCustom.
Page instfiles
Section
SectionEnd
Function .onInit
;Extract InstallOptions files
;$PLUGINSDIR will automatically be removed when the installer closes
InitPluginsDir
File /oname=$PLUGINSDIR\testimgs.ini "testimgs.ini"
File /oname=$PLUGINSDIR\image.bmp "${NSISDIR}\Contrib\Graphics\Checks\colorful.bmp"
File /oname=$PLUGINSDIR\image2.bmp "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp"
File /oname=$PLUGINSDIR\icon.ico "${NSISDIR}\Contrib\Graphics\Icons\pixel-install.ico"
;Write image paths to the INI file
WriteINIStr $PLUGINSDIR\testimgs.ini "Field 2" "Text" $PLUGINSDIR\image.bmp
WriteINIStr $PLUGINSDIR\testimgs.ini "Field 3" "Text" $PLUGINSDIR\image2.bmp
WriteINIStr $PLUGINSDIR\testimgs.ini "Field 4" "Text" $PLUGINSDIR\image.bmp
WriteINIStr $PLUGINSDIR\testimgs.ini "Field 5" "Text" $PLUGINSDIR\image2.bmp
WriteINIStr $PLUGINSDIR\testimgs.ini "Field 6" "Text" $PLUGINSDIR\icon.ico
;No Text for Field 7 so it'll show the installer's icon
FunctionEnd
Function SetCustom
;Display the InstallOptions dialog
InstallOptions::dialog "$PLUGINSDIR\testimgs.ini"
Pop $0
FunctionEnd

View File

@ -0,0 +1,44 @@
[Settings]
NumFields=5
[Field 1]
Type=Label
Left=10
Right=-40
Top=10
Bottom=18
Text=This custom page demonstrates the "Link" control
[Field 2]
Type=Link
Left=20
Right=-40
Top=40
Bottom=50
Text=* Run notepad
[Field 3]
Type=Link
Left=20
Right=-40
Top=55
Bottom=65
State=mailto:someone@anywhere.com
Text=* Send E-mail
[Field 4]
Type=Link
Left=20
Right=-40
Top=70
Bottom=80
State=http://nsis.sourceforge.net/
Text=* Homepage http://nsis.sourceforge.net/
[Field 5]
Type=Text
Left=20
Right=-40
Top=85
Bottom=98
State=Just to test proper interaction with the other fields

View File

@ -0,0 +1,58 @@
;InstallOptions Test Script
;Written by Ramon
;This script demonstrates the power of the new control "LINK"
;that allows you to execute files, send mails, open wepsites, etc.
;--------------------------
!define TEMP1 $R0 ;Temp variable
;The name of the installer
Name "InstallOptions Test Link"
;The file to write
OutFile "TestLink.exe"
; Show install details
ShowInstDetails show
;Things that need to be extracted on startup (keep these lines before any File command!)
;Only useful for BZIP2 compression
;Use ReserveFile for your own InstallOptions INI files too!
ReserveFile /plugin InstallOptions.dll
ReserveFile "testlink.ini"
;Order of pages
Page custom SetCustom
Page instfiles
Section "Components"
;Get Install Options dialog user input
SectionEnd
Function .onInit
;Extract InstallOptions files
;$PLUGINSDIR will automatically be removed when the installer closes
InitPluginsDir
File /oname=$PLUGINSDIR\test.ini "testlink.ini"
WriteIniStr $PLUGINSDIR\test.ini "Field 2" "State" "$WINDIR\Notepad.exe"
FunctionEnd
Function SetCustom
;Display the InstallOptions dialog
Push ${TEMP1}
InstallOptions::dialog "$PLUGINSDIR\test.ini"
Pop ${TEMP1}
Pop ${TEMP1}
FunctionEnd

View File

@ -0,0 +1,105 @@
[Settings]
NumFields=11
[Field 1]
Type=Groupbox
Text="This is a group box..."
Left=0
Right=-1
Top=0
Bottom=-4
[Field 2]
Type=Checkbox
Text=Install support for X
Flags=NOTIFY
State=1
Left=10
Right=100
Top=17
Bottom=25
[Field 3]
Type=Checkbox
Text=Install support for Y
State=0
Left=10
Right=100
Top=30
Bottom=38
[Field 4]
Type=Checkbox
Text=Install support for Z
Flags=RIGHT
State=0
Left=10
Right=100
Top=43
Bottom=51
[Field 5]
Type=FileRequest
Flags=GROUP|FILE_MUST_EXIST|FILE_EXPLORER|FILE_HIDEREADONLY
State=C:\dummy.xyz
Filter=XYZ Files|*.xyz|All files|*.*
Left=10
Right=-10
Top=56
Bottom=69
[Field 6]
Type=DirRequest
Text=Select a directory...
State=C:\Program Files\NSIS
Left=10
Right=-10
Top=74
Bottom=87
[Field 7]
Type=Label
Text=This is a label...
Left=10
Right=-10
Top=89
Bottom=97
[Field 8]
Type=Text
Flags=MULTILINE|VSCROLL|WANTRETURN|NOWORDWRAP
State="Multiline\r\nedit..."
Left=10
Right=-10
Top=97
Bottom=118
MinLen=1
ValidateText=Please enter some text before proceeding.
[Field 9]
Type=Button
Flags=NOTIFY
Text=&Clear
Left=-60
Right=-10
Top=19
Bottom=33
[Field 10]
Type=Button
Text=&Email
State=mailto:someone@anywhere.com
Left=-60
Right=-10
Top=35
Bottom=49
[Field 11]
Type=DROPLIST
ListItems=Show|Hide
State=Show
Flags=NOTIFY
Left=120
Right=-80
Top=20
Bottom=56

View File

@ -0,0 +1,133 @@
; InstallOptions script demonstrating custom buttons
;----------------------------------------------------
!include WinMessages.nsh
; The name of the installer
Name "InstallOptions Test"
; The file to write
OutFile "TestNotify.exe"
; Show install details
ShowInstDetails show
; Called before anything else as installer initialises
Function .onInit
; Extract InstallOptions files
; $PLUGINSDIR will automatically be removed when the installer closes
InitPluginsDir
File /oname=$PLUGINSDIR\test.ini "testnotify.ini"
FunctionEnd
; Our custom page
Page custom ShowCustom LeaveCustom ": Testing InstallOptions"
Function ShowCustom
; Initialise the dialog but don't show it yet
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Test the right-to-left version?" IDNO +2
WriteINIStr "$PLUGINSDIR\test.ini" "Settings" "RTL" "1"
InstallOptions::initDialog "$PLUGINSDIR\test.ini"
; In this mode InstallOptions returns the window handle so we can use it
Pop $0
; Now show the dialog and wait for it to finish
InstallOptions::show
; Finally fetch the InstallOptions status value (we don't care what it is though)
Pop $0
FunctionEnd
Function LeaveCustom
; At this point the user has either pressed Next or one of our custom buttons
; We find out which by reading from the INI file
ReadINIStr $0 "$PLUGINSDIR\test.ini" "Settings" "State"
StrCmp $0 0 validate ; Next button?
StrCmp $0 2 supportx ; "Install support for X"?
StrCmp $0 9 clearbtn ; "Clear" button?
StrCmp $0 11 droplist ; "Show|Hide" drop-list?
Abort ; Return to the page
supportx:
; Make the FileRequest field depend on the first checkbox
ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 2" "State"
ReadINIStr $1 "$PLUGINSDIR\test.ini" "Field 5" "HWND"
EnableWindow $1 $0
ReadINIStr $1 "$PLUGINSDIR\test.ini" "Field 5" "HWND2"
EnableWindow $1 $0
; Add the disabled flag too so when we return to this page it's disabled again
StrCmp $0 0 0 +3
WriteINIStr "$PLUGINSDIR\test.ini" "Field 5" "Flags" "GROUP|FILE_MUST_EXIST|FILE_EXPLORER|FILE_HIDEREADONLY|DISABLED"
Goto +2
WriteINIStr "$PLUGINSDIR\test.ini" "Field 5" "Flags" "GROUP|FILE_MUST_EXIST|FILE_EXPLORER|FILE_HIDEREADONLY"
Abort ; Return to the page
clearbtn:
; Clear all text fields
ReadINIStr $1 "$PLUGINSDIR\test.ini" "Field 5" "HWND"
SendMessage $1 ${WM_SETTEXT} 0 "STR:"
ReadINIStr $1 "$PLUGINSDIR\test.ini" "Field 6" "HWND"
SendMessage $1 ${WM_SETTEXT} 0 "STR:"
ReadINIStr $1 "$PLUGINSDIR\test.ini" "Field 8" "HWND"
SendMessage $1 ${WM_SETTEXT} 0 "STR:"
Abort ; Return to the page
droplist:
; Make the DirRequest field depend on the droplist
ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 11" "State"
StrCmp $0 "Show" +3
StrCpy $0 0
Goto +2
StrCpy $0 1
ReadINIStr $1 "$PLUGINSDIR\test.ini" "Field 6" "HWND"
EnableWindow $1 $0
ReadINIStr $1 "$PLUGINSDIR\test.ini" "Field 6" "HWND2"
EnableWindow $1 $0
; Add the disabled flag too so when we return to this page it's disabled again
StrCmp $0 0 0 +3
WriteINIStr "$PLUGINSDIR\test.ini" "Field 6" "Flags" "DISABLED"
Goto +2
WriteINIStr "$PLUGINSDIR\test.ini" "Field 6" "Flags" ""
Abort ; Return to the page
validate:
; At this point we know the Next button was pressed, so perform any validation
ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 2" "State"
StrCmp $0 1 done
ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 3" "State"
StrCmp $0 1 done
ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 4" "State"
StrCmp $0 1 done
MessageBox MB_ICONEXCLAMATION|MB_OK "You must select at least one install option!"
Abort
done:
FunctionEnd
; Installation page
Page instfiles
Section
;Get Install Options dialog user input
ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 2" "State"
DetailPrint "Install X=$0"
ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 3" "State"
DetailPrint "Install Y=$0"
ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 4" "State"
DetailPrint "Install Z=$0"
ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 5" "State"
DetailPrint "File=$0"
ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 6" "State"
DetailPrint "Dir=$0"
ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 8" "State"
DetailPrint "Info=$0"
SectionEnd