summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-08-15 23:00:56 +0000
committerrubidium <rubidium@openttd.org>2008-08-15 23:00:56 +0000
commita8e85f00c9580b06934002a7fdfdc0f706d6ac9b (patch)
tree486cb418c7d7d2f9986ebfea47df3e982accc9b5 /os
parentc10691faffc9d08b6342b18c3be6f27e659fb43e (diff)
downloadopenttd-a8e85f00c9580b06934002a7fdfdc0f706d6ac9b.tar.xz
(svn r14081) -Fix (r14075): WoW64 spoiled the 64 bits Windows detection and the installer for the 64 bits binary installed in the wrong directory. Thanks to michi_cc and glx for testing.
Diffstat (limited to 'os')
-rw-r--r--os/win32/installer/install.nsi13
-rw-r--r--os/win32/installer/version_win32.txt1
-rw-r--r--os/win32/installer/version_win64.txt1
-rw-r--r--os/win32/installer/version_win9x.txt1
4 files changed, 9 insertions, 7 deletions
diff --git a/os/win32/installer/install.nsi b/os/win32/installer/install.nsi
index b16a988fc..7e7f20519 100644
--- a/os/win32/installer/install.nsi
+++ b/os/win32/installer/install.nsi
@@ -31,7 +31,6 @@ VIAddVersionKey "LegalCopyright" " "
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}-${APPARCH}.exe"
CRCCheck force
@@ -395,8 +394,9 @@ Function GetWindowsVersion
ClearErrors
StrCpy $R0 "winnt"
- ReadRegStr $R1 HKLM "SOFTWARE\MICROSOFT\WINDOWS NT\CurrentVersion" CurrentVersion
- IfErrors 0 WinNT
+ GetVersion::WindowsPlatformId
+ Pop $R0
+ IntCmp $R0 2 WinNT 0
StrCpy $R0 "win9x"
WinNT:
ClearErrors
@@ -406,10 +406,9 @@ 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
+ GetVersion::WindowsPlatformArchitecture
+ Pop $R0
+ IntCmp $R0 64 Win64 0
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
diff --git a/os/win32/installer/version_win32.txt b/os/win32/installer/version_win32.txt
index d6314b8f0..ed7f77e3d 100644
--- a/os/win32/installer/version_win32.txt
+++ b/os/win32/installer/version_win32.txt
@@ -2,3 +2,4 @@
!define EXTRA_VERSION "for Windows 2000, XP and Vista"
!define APPARCH "win32" ; Define the application architecture
!define BINARY_DIR "${PATH_ROOT}objs\win32\Release"
+InstallDir "$PROGRAMFILES32\OpenTTD\"
diff --git a/os/win32/installer/version_win64.txt b/os/win32/installer/version_win64.txt
index ed96e3105..3c84447b6 100644
--- a/os/win32/installer/version_win64.txt
+++ b/os/win32/installer/version_win64.txt
@@ -2,3 +2,4 @@
!define EXTRA_VERSION "for Windows XP and Vista"
!define APPARCH "win64" ; Define the application architecture
!define BINARY_DIR "${PATH_ROOT}objs\x64\Release"
+InstallDir "$PROGRAMFILES64\OpenTTD\"
diff --git a/os/win32/installer/version_win9x.txt b/os/win32/installer/version_win9x.txt
index 25ccc23c2..be20888e5 100644
--- a/os/win32/installer/version_win9x.txt
+++ b/os/win32/installer/version_win9x.txt
@@ -2,3 +2,4 @@
!define EXTRA_VERSION "for Windows 95, 98 and ME"
!define APPARCH "win9x" ; Define the application architecture
!define BINARY_DIR "${PATH_ROOT}bin"
+InstallDir "$PROGRAMFILES32\OpenTTD\"