From 8eb1dca0ac1974f13266bf4645c0cb8913d58d9d Mon Sep 17 00:00:00 2001 From: canni0 Date: Sat, 10 Jan 2009 23:29:25 +0000 Subject: - Update: Changed routines for online update check - Fixed: Added missing Language Strings git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1554 b956fd51-792f-4845-bead-9b4dfca2ff2c --- installer/Update.nsi | 53 ++++++++++++++++++++++++++++++++++------ installer/languages/English.nsh | 8 ++++++ installer/languages/German.nsh | 8 ++++++ installer/settings/functions.nsh | 24 ++++++++++++++++++ installer/version.txt | 1 - 5 files changed, 86 insertions(+), 8 deletions(-) delete mode 100644 installer/version.txt diff --git a/installer/Update.nsi b/installer/Update.nsi index 6da20f5d..b8e5a458 100644 --- a/installer/Update.nsi +++ b/installer/Update.nsi @@ -40,8 +40,8 @@ Var /GLOBAL checkbox_state XPStyle on -Name "${name} v.${version} - Update" -Brandingtext "${name} v.${version} Update" +Name "${name} - Update" +Brandingtext "${name} Update" OutFile "ultrastardx-update.exe" InstallDir "$PROGRAMFILES\${name}" @@ -123,26 +123,65 @@ ${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 +NSISdl::download /TIMEOUT=50000 http://ultrastardeluxe.xtremeweb-hosting.net/version.txt $TEMP\version.txt -FileOpen $4 "$TEMP\version.txt" r -FileRead $4 $1 +Push 1 +Push "$TEMP\version.txt" + Call ReadFileLine +Pop $1 ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${name}" 'DisplayVersion' - ${VersionCompare} "$R0" "$1" $R1 -MessageBox MB_OK "$R1. R0 = $R0 und R1 = $1" +${If} $R1 == "0" + +messageBox MB_OK|MB_ICONINFORMATION "$(update_check_equal)" + +${Else} + ${If} $R1 == "1" + + IfFileExists $TEMP\version.txt FileExists + SetErrors + Goto Failed + + FileExists: + messageBox MB_OK|MB_ICONINFORMATION "$(update_check_newer)" + + ${Else} + ${If} $R1 == "2" + messageBox MB_YESNO|MB_ICONQUESTION \ + "$(update_check_older)" IDNO +6 + Push 2 + Push "$TEMP\version.txt" + Call ReadFileLine + Pop $2 + ExecShell Open $2 + + ${Else} + + Failed: + messageBox MB_YESNO|MB_ICONQUESTION \ + "$(update_check_failed)" IDNO +2 + + ExecShell Open http://www.ultrastardeluxe.org + + ${EndIf} + ${EndIf} +${EndIf} ${Else} +; If checkbox_state = 0 ${EndIf} +Delete "$TEMP\version.txt" + + FunctionEnd ; ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ ~+~ diff --git a/installer/languages/English.nsh b/installer/languages/English.nsh index e1ee4656..e5d8dccf 100644 --- a/installer/languages/English.nsh +++ b/installer/languages/English.nsh @@ -15,8 +15,16 @@ 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." +LangString update_check_older ${LANG_ENGLISH} "Your version $R0 is outdated. The new version $1 of UltraStar Deluxe is available. Do you want to update?" +LangString update_check_equal ${LANG_ENGLISH} "Your currently installed version $R0 is up-to-date. No update needed." +LangString update_check_newer ${LANG_ENGLISH} "Your installed version $R0 is newer than the $\n$\rcurrent release version $1 of UltraStar Deluxe. No update needed." +LangString update_check_failed ${LANG_ENGLISH} "The check for a new version failed. Do you want to visit website to check manually ?" + ; Welcome Page: +LangString page_welcome_title_update ${LANG_ENGLISH} "Welcome to the UltraStar Deluxe Update Wizard" +LangString page_welcome_txt_update ${LANG_ENGLISH} "This wizard will guide you through the Update process of UltraStar Deluxe. UltraStar Deluxe is a free open source Karaoke game, which can be compared with Singstar.$\n$\r$\n$\rThe UltraStar Deluxe Team wishes you fun.$\n$\rProject website: http://www.ultrastardeluxe.org$\n$\rSupport Forum: http://forum.ultrastardeluxe.org" + LangString page_welcome_title ${LANG_ENGLISH} "Welcome to the UltraStar Deluxe Setup Wizard" LangString page_welcome_txt ${LANG_ENGLISH} "This wizard will guide you through the Installation of UltraStar Deluxe. UltraStar Deluxe is a free open source Karaoke game, which can be compared with Singstar.$\n$\r$\n$\rThe UltraStar Deluxe Team wishes you fun.$\n$\rProject website: http://www.ultrastardeluxe.org$\n$\rSupport Forum: http://forum.ultrastardeluxe.org" diff --git a/installer/languages/German.nsh b/installer/languages/German.nsh index 7ab009e0..642257ee 100644 --- a/installer/languages/German.nsh +++ b/installer/languages/German.nsh @@ -15,8 +15,16 @@ 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." +LangString update_check_older ${LANG_GERMAN} "Deine aktuelle Version $R0 ist veraltet. Die neue Version $1 von UltraStar Deluxe ist verfügbar. Möchtest du sie runterladen?" +LangString update_check_equal ${LANG_GERMAN} "Deine aktuelle Version $R0 ist auf dem neusten Stand.$\n$\rKein Update benötigt." +LangString update_check_newer ${LANG_GERMAN} "Deine aktuelle Version $R0 ist neuer als die zurzeit veröffentlichte$\n$\rVersion $1 von UltraStar Deluxe. Kein Update benötigt." +LangString update_check_failed ${LANG_GERMAN} "Die Aktualisierungsprüfung ist fehlgeschlagen. Willst du manuell nach Updates suchen?" + ; Welcome Page: +LangString page_welcome_title_update ${LANG_GERMAN} "Willkommen beim Aktualisierungsassistenten von UltraStar Deluxe" +LangString page_welcome_txt_update ${LANG_GERMAN} "Dieser Assistent wird Sie durch die Aktualisierung von UltraStar Deluxe begleiten. UltraStar Deluxe ist ein kostenloses quelloffenes Karaokespiel, welches Singstar ähnelt. $\n$\r$\n$\rDas UltraStar Deluxe Team wünscht viel Spaß.$\n$\rProjekthomepage: http://www.ultrastardeluxe.org$\n$\rSupport Forum: http://forum.ultrastardeluxe.org" + LangString page_welcome_title ${LANG_GERMAN} "Willkommen zur Installationsroutine von UltraStar Deluxe" LangString page_welcome_txt ${LANG_GERMAN} "Dieser Assistent wird Sie durch die Installation von UltraStar Deluxe begleiten. UltraStar Deluxe ist ein kostenloses quelloffenes Karaokespiel, welches Singstar ähnelt. $\n$\r$\n$\rDas UltraStar Deluxe Team wünscht viel Spaß.$\n$\rProjekthomepage: http://www.ultrastardeluxe.org$\n$\rSupport Forum: http://forum.ultrastardeluxe.org" diff --git a/installer/settings/functions.nsh b/installer/settings/functions.nsh index edaa1e74..bbd4fea2 100644 --- a/installer/settings/functions.nsh +++ b/installer/settings/functions.nsh @@ -172,4 +172,28 @@ Function VersionCompare Pop $2 Pop $1 Exch $0 +FunctionEnd + +Function ReadFileLine +Exch $0 ;file +Exch +Exch $1 ;line number +Push $2 +Push $3 + + FileOpen $2 $0 r + StrCpy $3 0 + +Loop: + IntOp $3 $3 + 1 + ClearErrors + FileRead $2 $0 + IfErrors +2 + StrCmp $3 $1 0 loop + FileClose $2 + +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 deleted file mode 100644 index b123147e..00000000 --- a/installer/version.txt +++ /dev/null @@ -1 +0,0 @@ -1.1 \ No newline at end of file -- cgit v1.2.3