Added new options page to the NSIS installer.
The supplied (default) 'tuxpaint.cfg' is now empty, but is safely appended to by the NSIS script. NSIS now has a Mode (Windowed|Full-Screen) and a Resolution (640x480|800x600) option which append the following lines to 'tuxpaint.cfg': fullscreen=$mode nofancycursors=$mode 800x600=$res [Where $mode and $res are "yes"|"no".] The added file 'options.ini' contains the GUI layout for the new page.
This commit is contained in:
parent
32620562c8
commit
5dc92570f3
3 changed files with 112 additions and 16 deletions
59
visualc/options.ini
Normal file
59
visualc/options.ini
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
[Settings]
|
||||
NumFields=6
|
||||
|
||||
[Field 1]
|
||||
Type=LABEL
|
||||
Text=" Start Tux Paint with these options: "
|
||||
Left=0
|
||||
Right=-1
|
||||
Top=0
|
||||
Bottom=35
|
||||
|
||||
[Field 2]
|
||||
Type=GroupBox
|
||||
Left=50
|
||||
Right=-50
|
||||
Top=36
|
||||
Bottom=78
|
||||
Text=" Display: "
|
||||
|
||||
[Field 3]
|
||||
Type=LABEL
|
||||
Text=Mode:
|
||||
Left=58
|
||||
Right=100
|
||||
Top=46
|
||||
Bottom=55
|
||||
State=1
|
||||
Flags=NOTABSTOP
|
||||
|
||||
[Field 4]
|
||||
Type=DROPLIST
|
||||
ListItems=Windowed|Full-Screen
|
||||
State=Full-Screen
|
||||
Left=115
|
||||
Right=-55
|
||||
Top=44
|
||||
Bottom=80
|
||||
Flags=NOTABSTOP
|
||||
|
||||
[Field 5]
|
||||
Type=LABEL
|
||||
Text=Resolution:
|
||||
Left=58
|
||||
Right=100
|
||||
Top=62
|
||||
Bottom=71
|
||||
State=1
|
||||
Flags=NOTABSTOP
|
||||
|
||||
[Field 6]
|
||||
Type=DROPLIST
|
||||
ListItems=640x480|800x600
|
||||
State=800x600
|
||||
Left=115
|
||||
Right=-55
|
||||
Top=60
|
||||
Bottom=96
|
||||
Flags=NOTABSTOP
|
||||
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
fullscreen=no
|
||||
nofancycursors=no
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
# vim: noai et ts=4 tw=0
|
||||
# with a few tiny modifications by Phil Harper(philh@theopencd.org)
|
||||
|
||||
!define PKG_VERSION "0.9.14-rc3"
|
||||
!define PKG_VERSION "0.9.14-rc4"
|
||||
!define PKG_PREFIX "tuxpaint"
|
||||
|
||||
!define APP_PREFIX "TuxPaint"
|
||||
|
|
@ -9,6 +9,8 @@
|
|||
!define APP_CFG_EXE "${APP_PREFIX}-config.exe"
|
||||
!define APP_NAME "Tux Paint"
|
||||
|
||||
!define TEMP1 $R0 ;Temp variable
|
||||
|
||||
SetCompressor lzma
|
||||
OutFile "${PKG_PREFIX}-${PKG_VERSION}-win32-installer.exe"
|
||||
Name "${APP_NAME}"
|
||||
|
|
@ -42,15 +44,39 @@ AllowRootDirInstall false
|
|||
|
||||
# Install page stuff
|
||||
InstProgressFlags smooth
|
||||
AutoCloseWindow true
|
||||
AutoCloseWindow false
|
||||
|
||||
# Put plugin files used by the installer at the start of the archive
|
||||
ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
|
||||
ReserveFile "options.ini"
|
||||
|
||||
Var FullscreenMode ; start TP in full-screen or windowed mode
|
||||
Var Resolution ; resolution 800x600 or 640x480
|
||||
|
||||
Page license
|
||||
Page components
|
||||
Page custom SetOptions ValidateOptions ": Runtime Options" ;Custom page.
|
||||
Page directory
|
||||
Page instfiles
|
||||
UninstPage uninstConfirm
|
||||
UninstPage instfiles
|
||||
|
||||
Section
|
||||
SetOutPath $INSTDIR
|
||||
File "release\${APP_EXE}"
|
||||
File "..\..\tuxpaint-config\visualc\release\${APP_CFG_EXE}"
|
||||
File "release\*.dll"
|
||||
|
||||
File "tuxpaint.cfg"
|
||||
FileOpen $0 "tuxpaint.cfg" "a"
|
||||
FileSeek $0 0 END
|
||||
FileWrite $0 "fullscreen=$FullscreenMode$\r$\n"
|
||||
FileWrite $0 "nofancycursors=$FullscreenMode$\r$\n"
|
||||
FileWrite $0 "800x600=$Resolution$\r$\n"
|
||||
FileClose $0
|
||||
|
||||
!include "filelist.inc"
|
||||
|
||||
SetOutPath $INSTDIR\locale
|
||||
File /r "locale\*.*"
|
||||
SetOutPath $INSTDIR\userdata
|
||||
|
|
@ -62,7 +88,6 @@ Section
|
|||
WriteUninstaller "uninstall.exe"
|
||||
SectionEnd
|
||||
|
||||
|
||||
Section "Start Menu Shortcuts"
|
||||
SetOutPath $INSTDIR
|
||||
CreateDirectory "$SMPROGRAMS\${APP_NAME}"
|
||||
|
|
@ -74,7 +99,6 @@ Section "Start Menu Shortcuts"
|
|||
CreateShortCut "$SMPROGRAMS\${APP_NAME}\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 "" "" "Remove ${APP_NAME}"
|
||||
SectionEnd
|
||||
|
||||
|
||||
Section "Desktop Shortcut"
|
||||
SetOutPath $INSTDIR
|
||||
CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${APP_EXE}" "" "$INSTDIR\${APP_EXE}" 0 "" "" "Create a picture with ${APP_NAME}"
|
||||
|
|
@ -85,17 +109,33 @@ Section "View README"
|
|||
ExecShell "open" "docs\html\README.html"
|
||||
SectionEnd
|
||||
|
||||
;Function .onInstSuccess
|
||||
; BringToFront
|
||||
; MessageBox MB_YESNO|MB_ICONQUESTION \
|
||||
; "${APP_NAME} was installed. Would you like to run ${APP_NAME} now ?" \
|
||||
; IDNO NoExec
|
||||
; Exec '$INSTDIR\${APP_EXE}'
|
||||
; NoExec:
|
||||
;FunctionEnd
|
||||
Function SetOptions
|
||||
Push ${TEMP1}
|
||||
InstallOptions::dialog "$PLUGINSDIR\options.ini"
|
||||
Pop ${TEMP1}
|
||||
Pop ${TEMP1}
|
||||
FunctionEnd
|
||||
|
||||
Function ValidateOptions
|
||||
StrCpy $FullscreenMode "yes"
|
||||
ReadINIStr ${TEMP1} "$PLUGINSDIR\options.ini" "Field 4" "State"
|
||||
StrCmp ${TEMP1} "Full-Screen" skip01
|
||||
StrCpy $FullscreenMode "no"
|
||||
skip01:
|
||||
StrCpy $Resolution "yes"
|
||||
ReadINIStr ${TEMP1} "$PLUGINSDIR\options.ini" "Field 6" "State"
|
||||
StrCmp ${TEMP1} "800x600" skip02
|
||||
StrCpy $Resolution "no"
|
||||
skip02:
|
||||
FunctionEnd
|
||||
|
||||
; init custom page
|
||||
Function .onInit
|
||||
InitPluginsDir
|
||||
File /oname=$PLUGINSDIR\options.ini "options.ini"
|
||||
FunctionEnd
|
||||
|
||||
; uninstall stuff
|
||||
|
||||
UninstallText "This will uninstall ${APP_NAME}. Hit 'Uninstall' to continue."
|
||||
|
||||
; special uninstall section.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue