diff --git a/visualc/options.ini b/visualc/options.ini new file mode 100644 index 000000000..509b35db0 --- /dev/null +++ b/visualc/options.ini @@ -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 + diff --git a/visualc/tuxpaint.cfg b/visualc/tuxpaint.cfg index 805221243..e69de29bb 100644 --- a/visualc/tuxpaint.cfg +++ b/visualc/tuxpaint.cfg @@ -1,3 +0,0 @@ -fullscreen=no -nofancycursors=no - diff --git a/visualc/tuxpaint.nsi b/visualc/tuxpaint.nsi index 02ecd7a56..c61613d0b 100644 --- a/visualc/tuxpaint.nsi +++ b/visualc/tuxpaint.nsi @@ -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.