Mercurial > hg > openttd
changeset 9920:f38070343822 draft
(svn r14075) -Codechange: make the windows installer more platform aware and warn when the to-be-installed binary isn't the recommended one (or won't work at all).
author | rubidium <rubidium@openttd.org> |
---|---|
date | Fri, 15 Aug 2008 12:47:20 +0000 |
parents | 1e401eca4b13 |
children | 29d461128c75 |
files | os/win32/installer/build_installers.bat os/win32/installer/install.nsi os/win32/installer/version_win32.txt os/win32/installer/version_win64.txt os/win32/installer/version_win9x.txt |
diffstat | 5 files changed, 73 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
new file mode 100644 --- /dev/null +++ b/os/win32/installer/build_installers.bat @@ -0,0 +1,4 @@ +@echo off +"c:\Program Files\NSIS\makensis.exe" /DVERSION_INCLUDE=version_win9x.txt install.nsi > win9x.log +"c:\Program Files\NSIS\makensis.exe" /DVERSION_INCLUDE=version_win32.txt install.nsi > win32.log +"c:\Program Files\NSIS\makensis.exe" /DVERSION_INCLUDE=version_win64.txt install.nsi > win64.log
--- a/os/win32/installer/install.nsi +++ b/os/win32/installer/install.nsi @@ -1,6 +1,7 @@ !define APPNAME "OpenTTD" ; Define application name !define APPVERSION "0.6.1" ; Define application version !define INSTALLERVERSION 48 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!! +!include ${VERSION_INCLUDE} !define APPURLLINK "http://www.openttd.org" !define APPNAMEANDVERSION "${APPNAME} ${APPVERSION}" @@ -18,21 +19,21 @@ ; Version Info Var AddWinPrePopulate VIProductVersion "${APPVERSIONINTERNAL}" -VIAddVersionKey "ProductName" "OpenTTD Installer" +VIAddVersionKey "ProductName" "OpenTTD Installer ${APPBITS} bits version ${EXTRA_VERSION}" VIAddVersionKey "Comments" "Installs ${APPNAMEANDVERSION}" VIAddVersionKey "CompanyName" "OpenTTD Developers" VIAddVersionKey "FileDescription" "Installs ${APPNAMEANDVERSION}" VIAddVersionKey "ProductVersion" "${APPVERSION}" -VIAddVersionKey "InternalName" "InstOpenTTD" -VIAddVersionKey "FileVersion" "${APPVERSION}" +VIAddVersionKey "InternalName" "InstOpenTTD-${APPARCH}" +VIAddVersionKey "FileVersion" "${APPVERSION}-${APPARCH}" VIAddVersionKey "LegalCopyright" " " ; Main Install settings -Name "${APPNAMEANDVERSION}" +Name "${APPNAMEANDVERSION} ${APPBITS} bits version ${EXTRA_VERSION}" ; NOTE: Keep trailing backslash! InstallDir "$PROGRAMFILES\OpenTTD\" InstallDirRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Install Folder" -OutFile "openttd-${APPVERSION}-win32.exe" +OutFile "openttd-${APPVERSION}-${APPARCH}.exe" CRCCheck force ShowInstDetails show @@ -45,7 +46,7 @@ !include "MUI.nsh" !define MUI_ABORTWARNING - +!define MUI_WELCOMEPAGE_TITLE_3LINES !insertmacro MUI_PAGE_WELCOME !define MUI_LICENSEPAGE_RADIOBUTTONS @@ -75,6 +76,8 @@ ; New custom page to show UNICODE and MSLU information Page custom ShowWarningsPage +!define MUI_FINISHPAGE_TITLE_3LINES +!define MUI_FINISHPAGE_RUN_TEXT "Run ${APPNAMEANDVERSION} now!" !define MUI_FINISHPAGE_RUN "$INSTDIR\openttd.exe" !define MUI_FINISHPAGE_LINK "Visit the OpenTTD site for latest news, FAQs and downloads" !define MUI_FINISHPAGE_LINK_LOCATION "${APPURLLINK}" @@ -84,6 +87,7 @@ !define MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT DisableBack !insertmacro MUI_PAGE_FINISH +!define MUI_PAGE_HEADER_TEXT "Uninstall ${APPNAMEANDVERSION}" !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES @@ -127,7 +131,7 @@ File ${PATH_ROOT}known-bugs.txt ; Copy executable - File /oname=openttd.exe ${PATH_ROOT}objs\Win32\Release\openttd.exe + File /oname=openttd.exe ${BINARY_DIR}\openttd.exe File ${PATH_ROOT}objs\strgen\strgen.exe @@ -249,6 +253,7 @@ Delete "$INSTDIR\COPYING" Delete "$INSTDIR\INSTALL.LOG" Delete "$INSTDIR\crash.log" + Delete "$INSTDIR\crash.dmp" Delete "$INSTDIR\openttd.cfg" Delete "$INSTDIR\hs.dat" Delete "$INSTDIR\cached_sprites.*" @@ -267,6 +272,8 @@ Delete "$INSTDIR\data\openttd.grf" Delete "$INSTDIR\data\roadstops.grf" Delete "$INSTDIR\data\trkfoundw.grf" + Delete "$INSTDIR\data\openttdd.grf" + Delete "$INSTDIR\data\openttdw.grf" Delete "$INSTDIR\data\sample.cat" ; Windows Data files @@ -396,6 +403,47 @@ Push $R0 FunctionEnd +;------------------------------------------------------------------------------- +; Check whether we're not running an installer for 64 bits on 32 bits and vice versa +Function CheckProcessorArchitecture + cpudesc::tell + Pop $0 ;full identification string in $0 + StrCpy $1 $0 2, 56 ;pull out the architecture + StrCmp $1 "00" 0 Win64 + ClearErrors + IntCmp ${APPBITS} 64 0 Done + MessageBox MB_OKCANCEL|MB_ICONSTOP "You want to install the 64 bits OpenTTD on a 32 bits Operating System. This is not going to work. Please download the correct version. Do you really want to continue?" IDOK Done IDCANCEL Abort + GoTo Done +Win64: + ClearErrors + IntCmp ${APPBITS} 64 Done 0 + MessageBox MB_OKCANCEL|MB_ICONINFORMATION "You want to install the 32 bits OpenTTD on a 64 bits Operating System. This is not adviced, but will work with reduced capabilities. We suggest that you download the correct version. Do you really want to continue?" IDOK Done IDCANCEL Abort + GoTo Done +Abort: + Quit +Done: +FunctionEnd + + +;------------------------------------------------------------------------------- +; Check whether we're not running an installer for NT on 9x and vice versa +Function CheckWindowsVersion + Call GetWindowsVersion + Pop $R0 + StrCmp $R0 "win9x" 0 WinNT + ClearErrors + StrCmp ${APPARCH} "win9x" Done 0 + MessageBox MB_OKCANCEL|MB_ICONSTOP "You want to install the Windows 2000, XP and Vista version on Windows 95, 98 or ME. This is will not work. Please download the correct version. Do you really want to continue?" IDOK Done IDCANCEL Abort + GoTo Done +WinNT: + ClearErrors + StrCmp ${APPARCH} "win9x" 0 Done + MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "You want to install the Windows 95, 98 and ME version on Windows 2000, XP or Vista. This is not adviced, but will work with reduced capabilities. We suggest that you download the correct version. Do you really want to continue?" IDOK Done IDCANCEL Abort +Abort: + Quit +Done: +FunctionEnd + Var OLDVERSION Var UninstallString @@ -446,6 +494,8 @@ FinishCallback: ClearErrors + Call CheckProcessorArchitecture + Call CheckWindowsVersion FunctionEnd ; eof
new file mode 100644 --- /dev/null +++ b/os/win32/installer/version_win32.txt @@ -0,0 +1,4 @@ +!define APPBITS 32 ; Define number of bits for the architecture +!define EXTRA_VERSION "for Windows 2000, XP and Vista" +!define APPARCH "win32" ; Define the application architecture +!define BINARY_DIR "${PATH_ROOT}objs\win32\Release"
new file mode 100644 --- /dev/null +++ b/os/win32/installer/version_win64.txt @@ -0,0 +1,4 @@ +!define APPBITS 64 ; Define number of bits for the architecture +!define EXTRA_VERSION "for Windows XP and Vista" +!define APPARCH "win64" ; Define the application architecture +!define BINARY_DIR "${PATH_ROOT}objs\x64\Release"
new file mode 100644 --- /dev/null +++ b/os/win32/installer/version_win9x.txt @@ -0,0 +1,4 @@ +!define APPBITS 32 ; Define number of bits for the architecture +!define EXTRA_VERSION "for Windows 95, 98 and ME" +!define APPARCH "win9x" ; Define the application architecture +!define BINARY_DIR "${PATH_ROOT}bin"