diff options
Diffstat (limited to 'os/win32/installer/install.nsi')
-rw-r--r-- | os/win32/installer/install.nsi | 64 |
1 files changed, 57 insertions, 7 deletions
diff --git a/os/win32/installer/install.nsi b/os/win32/installer/install.nsi index a31b8a9cf..b16a988fc 100644 --- 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 @@ SetCompressor LZMA ; 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 @@ Var CDDRIVE !include "MUI.nsh" !define MUI_ABORTWARNING - +!define MUI_WELCOMEPAGE_TITLE_3LINES !insertmacro MUI_PAGE_WELCOME !define MUI_LICENSEPAGE_RADIOBUTTONS @@ -75,6 +76,8 @@ Page custom SelectCDEnter SelectCDExit ": TTD folder" ; 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 @@ Page custom ShowWarningsPage !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 @@ Section "!OpenTTD" Section1 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 @@ Section "Uninstall" 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 @@ Section "Uninstall" 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 @@ WinNT: 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 @@ InstallerIsOlder: FinishCallback: ClearErrors + Call CheckProcessorArchitecture + Call CheckWindowsVersion FunctionEnd ; eof |