Skip to content

Commit 1e11665

Browse files
committed
Check for 64-bit Windows, and install the correct version of Python
1 parent fbe391e commit 1e11665

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

source/install.nsi

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ ${StrTrimNewLines}
3737
!insertmacro VersionCompare
3838
!include "Sections.nsh"
3939
!include WinVer.nsh
40+
!include x64.nsh
4041
!include "EnvVarUpdate.nsh"
4142
!include PathUpdate.nsh
4243

@@ -53,7 +54,8 @@ ${StrTrimNewLines}
5354
!define MBED_CLI_VERSION "mbed-cli-1.10.0"
5455
!define MBED_CLI_ENV "MBED_CLI_TOOLS"
5556
!define PRODUCT_PUBLISHER "Arm Mbed"
56-
!define PYTHON_INSTALLER "python-2.7.14.amd64.msi"
57+
!define PYTHON_INSTALLER "python-2.7.14.msi"
58+
!define PYTHON_INSTALLER_64 "python-2.7.14.amd64.msi"
5759
!define GCC_EXE "gcc-arm-none-eabi-6-2017-q2-update-win32.exe"
5860
!define GIT_INSTALLER "Git-2.17.1.2-32-bit.exe"
5961
!define MERCURIAL_INSTALLER "Mercurial-4.1.1.exe"
@@ -137,11 +139,18 @@ Section "python" SecPython
137139
${endif}
138140
${EndIf}
139141
pythonInstall:
142+
; Install options for python taken from https://www.python.org/download/releases/2.5/msi/
143+
; configure python to add itsself to the path.
144+
; check for 64-bit Windows
145+
${If} ${RunningX64}
146+
File "..\prerequisites\${PYTHON_INSTALLER_64}"
147+
nsExec::ExecToStack '"msiexec" /i "$INSTDIR\${PYTHON_INSTALLER_64}" ALLUSERS=1 ADDLOCAL=ALL /qn'
148+
Delete $INSTDIR\${PYTHON_INSTALLER_64}
149+
${Else}
140150
File "..\prerequisites\${PYTHON_INSTALLER}"
141-
; Install options for python taken from https://www.python.org/download/releases/2.5/msi/
142-
; This gets python to add itsself to the path.
143151
nsExec::ExecToStack '"msiexec" /i "$INSTDIR\${PYTHON_INSTALLER}" ALLUSERS=1 ADDLOCAL=ALL /qn'
144152
Delete $INSTDIR\${PYTHON_INSTALLER}
153+
${EndIf}
145154
pythonExit:
146155
SectionEnd
147156

0 commit comments

Comments
 (0)