From da957735cf8f37e6bda903626e826c4993f37f8a Mon Sep 17 00:00:00 2001 From: canni0 Date: Sat, 10 Jan 2009 21:57:04 +0000 Subject: - Added: Check online for USdx Updates - Changed: Installer Icon git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1553 b956fd51-792f-4845-bead-9b4dfca2ff2c --- installer/Update.nsi | 176 +++++++++++++++++++++++++++++++ installer/languages/English.nsh | 5 + installer/languages/German.nsh | 5 + installer/settings/functions.nsh | 100 +++++++++++++++++- installer/version.txt | 1 + installerdependencies/images/install.ico | Bin 22486 -> 72374 bytes 6 files changed, 286 insertions(+), 1 deletion(-) create mode 100644 installer/Update.nsi create mode 100644 installer/version.txt diff --git a/installer/Update.nsi b/installer/Update.nsi new file mode 100644 index 00000000..6da20f5d --- /dev/null +++ b/installer/Update.nsi @@ -0,0 +1,176 @@ +; ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ +; UltraStar Deluxe Installer: Update +; ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ + +!include MUI2.nsh +!include WinVer.nsh +!include LogicLib.nsh +!include nsDialogs.nsh + +; ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ +; Variables +; ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ + +; Installer Paths: + +!define path_settings ".\settings" +!define path_languages ".\languages" +!define path_images "..\installerdependencies\images" +!define path_plugins "..\installerdependencies\plugins" +!define path_gdf "$WINDIR\gdf.dll" + +!addPluginDir "${path_plugins}\" + +!include "${path_settings}\variables.nsh" +!include "${path_settings}\GameExplorer.nsh" +!include "${path_settings}\functions.nsh" + +; ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ +; Export Settings +; ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ + +SetCompress Auto +SetCompressor /SOLID lzma +SetCompressorDictSize 32 +SetDatablockOptimize On + +Var /GLOBAL CHECKBOX +Var /GLOBAL label_update_information +Var /GLOBAL checkbox_state + +XPStyle on + +Name "${name} v.${version} - Update" +Brandingtext "${name} v.${version} Update" +OutFile "ultrastardx-update.exe" + +InstallDir "$PROGRAMFILES\${name}" + +; Windows Vista: + +RequestExecutionLevel user + +; ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ +; Interface Settings +; ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ + +; Icons: + +!define MUI_ICON "${path_images}\${img_install}" +!define MUI_UNICON "${path_images}\${img_uninstall}" + +; Header and Side Images: + +!define MUI_HEADERIMAGE +!define MUI_HEADERIMAGE_BITMAP "${path_images}\${img_header}" +!define MUI_HEADERIMAGE_UNBITMAP "${path_images}\${img_header}" + +!define MUI_WELCOMEFINISHPAGE_BITMAP "${path_images}\${img_side}" +!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${path_images}\${img_side}" + +; Abort Warnings: + +!define MUI_ABORTWARNING +!define MUI_ABORTWARNING_TEXT "$(abort_install)" +!define MUI_ABORTWARNING_CANCEL_DEFAULT + +!define MUI_UNABORTWARNING +!define MUI_UNABORTWARNING_TEXT "$(abort_uninstall)" +!define MUI_UNABORTWARNING_CANCEL_DEFAULT + +; ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ +; Pages Installation Routine Settings +; ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ + +; Welcome Page: + +!define MUI_WELCOMEPAGE_TITLE_3LINES +!define MUI_WELCOMEPAGE_TITLE "$(page_welcome_title_update)" +!define MUI_WELCOMEPAGE_TEXT "$(page_welcome_txt_update)" + +; ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ +; Pages Installation Routine +; ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ + +!insertmacro MUI_PAGE_WELCOME + +; USDX Update Page + +Page custom Update Download + +Function Update + +nsDialogs::Create /NOUNLOAD 1018 + + Pop $0 + + ${NSD_CreateCheckbox} 0 -150 100% 8u "$(update_connect)" + Pop $CHECKBOX + GetFunctionAddress $0 OnCheckbox + nsDialogs::OnClick /NOUNLOAD $CHECKBOX $0 + + ${NSD_CreateLabel} 0 0 100% 30u "$(update_information)" + Pop $label_update_information + +nsDialogs::Show + + +FunctionEnd ; Update page End + +Function Download + +${NSD_GetState} $CHECKBOX $checkbox_state + +${If} $checkbox_state == "1" + +NSISdl::download_quiet /TIMEOUT=30000 http://ultrastardx.svn.sourceforge.net/viewvc/ultrastardx/trunk/installer/version.txt $TEMP\version.txt + +FileOpen $4 "$TEMP\version.txt" r +FileRead $4 $1 + +ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${name}" 'DisplayVersion' + + +${VersionCompare} "$R0" "$1" $R1 + +MessageBox MB_OK "$R1. R0 = $R0 und R1 = $1" + + + +${Else} + + + +${EndIf} + +FunctionEnd + +; ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ +; UPDATE (Section 1) +; ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ + +Section $(name_section1) Section1 + SectionIn RO + SetOutPath $INSTDIR + SetOverwrite try + +SectionEnd + +; ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ +; Language Support +; ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ + +!insertmacro MUI_LANGUAGE "English" +!insertmacro MUI_LANGUAGE "German" + +!insertmacro MUI_RESERVEFILE_LANGDLL + +!include "${path_languages}\*.nsh" + +Function .onInit + + !insertmacro MUI_LANGDLL_DISPLAY + + + +FunctionEnd diff --git a/installer/languages/English.nsh b/installer/languages/English.nsh index b539a0e2..e1ee4656 100644 --- a/installer/languages/English.nsh +++ b/installer/languages/English.nsh @@ -10,6 +10,11 @@ LangString oninit_alreadyinstalled ${LANG_ENGLISH} "is already installed" LangString oninit_closeusdx ${LANG_ENGLISH} "cannot be uninstalled while its running! Do you want to close it?" LangString oninit_updateusdx ${LANG_ENGLISH} "Do you want to update the installation from:" +LangString update_connect ${LANG_ENGLISH} "Establish internet connection and check for new version" +LangString button_next ${LANG_ENGLISH} "Next >" +LangString button_close ${LANG_ENGLISH} "Close" +LangString update_information ${LANG_ENGLISH} "You can check if a new version of 'UltraStar Deluxe' is available. Thereto an internet connection will be established. If a new version is found, it can be installed afterwards." + ; Welcome Page: LangString page_welcome_title ${LANG_ENGLISH} "Welcome to the UltraStar Deluxe Setup Wizard" diff --git a/installer/languages/German.nsh b/installer/languages/German.nsh index 0939b236..7ab009e0 100644 --- a/installer/languages/German.nsh +++ b/installer/languages/German.nsh @@ -10,6 +10,11 @@ LangString oninit_alreadyinstalled ${LANG_GERMAN} "ist bereits installiert" LangString oninit_closeusdx ${LANG_GERMAN} "kann nicht während der Laufzeit deinstalliert werden. Soll es geschlossen werden?" LangString oninit_updateusdx ${LANG_GERMAN} "Möchten Sie das Programm aktualisieren von" +LangString update_connect ${LANG_GERMAN} "Mit dem Internet verbinden und nach aktueller Version suchen" +LangString button_next ${LANG_GERMAN} "Weiter >" +LangString button_close ${LANG_GERMAN} "Beenden" +LangString update_information ${LANG_GERMAN} "Du kannst nach einer aktuelleren Version von 'UltraStar Deluxe' suchen. Dazu wird eine Verbindung mit dem Internet hergestellt. Wurde eine aktuellere Version gefunden, kann diese anschließend installiert werden." + ; Welcome Page: LangString page_welcome_title ${LANG_GERMAN} "Willkommen zur Installationsroutine von UltraStar Deluxe" diff --git a/installer/settings/functions.nsh b/installer/settings/functions.nsh index 8345c4cc..edaa1e74 100644 --- a/installer/settings/functions.nsh +++ b/installer/settings/functions.nsh @@ -74,4 +74,102 @@ FunctionEnd !macro nsProcess::Unload nsProcess::_Unload -!macroend \ No newline at end of file +!macroend + +Function OnCheckbox + GetDlgItem $R0 $HWNDPARENT 1 + Pop $0 # HWND + ${NSD_GetState} $0 $1 + IntCmp $1 1 _Next _Close + _Next: + SendMessage $R0 ${WM_SETTEXT} 0 "STR:$(button_next)" + goto _done + _Close: + SendMessage $R0 ${WM_SETTEXT} 0 "STR:$(button_close)" + _done: +FunctionEnd + +Function VersionCompare + !define VersionCompare `!insertmacro VersionCompareCall` + + !macro VersionCompareCall _VER1 _VER2 _RESULT + Push `${_VER1}` + Push `${_VER2}` + Call VersionCompare + Pop ${_RESULT} + !macroend + + Exch $1 + Exch + Exch $0 + Exch + Push $2 + Push $3 + Push $4 + Push $5 + Push $6 + Push $7 + + begin: + StrCpy $2 -1 + IntOp $2 $2 + 1 + StrCpy $3 $0 1 $2 + StrCmp $3 '' +2 + StrCmp $3 '.' 0 -3 + StrCpy $4 $0 $2 + IntOp $2 $2 + 1 + StrCpy $0 $0 '' $2 + + StrCpy $2 -1 + IntOp $2 $2 + 1 + StrCpy $3 $1 1 $2 + StrCmp $3 '' +2 + StrCmp $3 '.' 0 -3 + StrCpy $5 $1 $2 + IntOp $2 $2 + 1 + StrCpy $1 $1 '' $2 + + StrCmp $4$5 '' equal + + StrCpy $6 -1 + IntOp $6 $6 + 1 + StrCpy $3 $4 1 $6 + StrCmp $3 '0' -2 + StrCmp $3 '' 0 +2 + StrCpy $4 0 + + StrCpy $7 -1 + IntOp $7 $7 + 1 + StrCpy $3 $5 1 $7 + StrCmp $3 '0' -2 + StrCmp $3 '' 0 +2 + StrCpy $5 0 + + StrCmp $4 0 0 +2 + StrCmp $5 0 begin newer2 + StrCmp $5 0 newer1 + IntCmp $6 $7 0 newer1 newer2 + + StrCpy $4 '1$4' + StrCpy $5 '1$5' + IntCmp $4 $5 begin newer2 newer1 + + equal: + StrCpy $0 0 + goto end + newer1: + StrCpy $0 1 + goto end + newer2: + StrCpy $0 2 + + end: + Pop $7 + Pop $6 + Pop $5 + Pop $4 + Pop $3 + Pop $2 + Pop $1 + Exch $0 +FunctionEnd \ No newline at end of file diff --git a/installer/version.txt b/installer/version.txt new file mode 100644 index 00000000..b123147e --- /dev/null +++ b/installer/version.txt @@ -0,0 +1 @@ +1.1 \ No newline at end of file diff --git a/installerdependencies/images/install.ico b/installerdependencies/images/install.ico index f3214d1a..af1b9372 100644 Binary files a/installerdependencies/images/install.ico and b/installerdependencies/images/install.ico differ -- cgit v1.2.3