Skip to content

Commit 9e0e61c

Browse files
committed
[project/Win32BuildSetup] Fix Windows ARM64 detection. Add prompts when attempting to install x86 or x64 on ARM64 machine. Specify minimum NSIS version in documentation.
1 parent 656052d commit 9e0e61c

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

docs/README.Windows.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ To build Kodi:
5555
* **[CMake](https://cmake.org/download/)** (version 3.20 or greater is required to build Kodi, version 3.21 or greater to build with Visual Studio 2022)
5656
* **[Git for Windows](https://gitforwindows.org/)**
5757
* **[Java Runtime Environment (JRE)](http://www.oracle.com/technetwork/java/javase/downloads/index.html)**
58-
* **[Nullsoft scriptable install system (NSIS)](http://nsis.sourceforge.net/Download)** (Only needed if you want to generate an installer file)
58+
* **[Nullsoft scriptable install system (NSIS)](http://nsis.sourceforge.net/Download)** version 3.04 or greater (Only needed if you want to generate an installer file)
5959
* **[Visual Studio 2022](https://visualstudio.microsoft.com/downloads/)** or **[Visual Studio 2019](https://visualstudio.microsoft.com/vs/older-downloads/)** (Community Edition is fine)
6060

6161
To run Kodi you need a relatively recent CPU with integrated GPU or discrete GPU with up-to-date graphics device-drivers installed from the manufacturer's website.

project/Win32BuildSetup/genNsisInstaller.nsi

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
;Default installation folder
2222
!ifdef x64
2323
InstallDir "$PROGRAMFILES64\${APP_NAME}"
24+
!else ifdef arm64
25+
InstallDir "$PROGRAMFILES64\${APP_NAME}"
2426
!else
2527
InstallDir "$PROGRAMFILES\${APP_NAME}"
2628
!endif
@@ -348,12 +350,32 @@ Function .onInit
348350
MessageBox MB_OK|MB_ICONSTOP 'This is the 64-bit ${APP_NAME} installer.$\nPlease download the 32-bit version from ${WEBSITE}.$\n$\nClick Ok to quit Setup.'
349351
Quit
350352
${Endif}
353+
354+
; x64 will run in emulation on ARM64
355+
${If} ${IsNativeARM64}
356+
MessageBox MB_YESNO|MB_ICONEXCLAMATION|MB_DEFBUTTON2 'There is a specific ARM64 ${APP_NAME} version available for download. Please consider installing the ARM64 version instead.$\nFor details visit ${WEBSITE}.$\nProceed with x64 installation anyway?' /SD IDYES IDYES noprobx64arm
357+
Quit
358+
noprobx64arm:
359+
${Endif}
360+
!else ifdef arm64
361+
SetRegView 64
362+
${IfNot} ${IsNativeARM64}
363+
MessageBox MB_OK|MB_ICONSTOP 'This is the ARM64 ${APP_NAME} installer.$\nPlease download the x86 or x64 version from ${WEBSITE}.$\n$\nClick Ok to quit Setup.'
364+
Quit
365+
${Endif}
351366
!else
352-
${If} ${RunningX64}
353-
MessageBox MB_YESNO|MB_ICONEXCLAMATION|MB_DEFBUTTON2 'There is a specific 64-bit ${APP_NAME} version available for download. Please consider installing the 64-bit version instead.$\nFor details visit ${WEBSITE}.$\nProceed with 32-bit installation anyway?' /SD IDYES IDYES noprob
367+
; x86 will run in emulation on ARM64
368+
${If} ${IsNativeARM64}
369+
MessageBox MB_YESNO|MB_ICONEXCLAMATION|MB_DEFBUTTON2 'There is a specific ARM64 ${APP_NAME} version available for download. Please consider installing the ARM64 version instead.$\nFor details visit ${WEBSITE}.$\nProceed with x86 installation anyway?' /SD IDYES IDYES noprobx86arm
354370
Quit
355-
noprob:
356-
${Endif}
371+
noprobx86arm:
372+
${Else}
373+
${If} ${RunningX64}
374+
MessageBox MB_YESNO|MB_ICONEXCLAMATION|MB_DEFBUTTON2 'There is a specific 64-bit ${APP_NAME} version available for download. Please consider installing the 64-bit version instead.$\nFor details visit ${WEBSITE}.$\nProceed with 32-bit installation anyway?' /SD IDYES IDYES noprobx86x64
375+
Quit
376+
noprobx86x64:
377+
${Endif}
378+
${Endif}
357379
!endif
358380

359381
; Windows 8.1 is minimum requirement

0 commit comments

Comments
 (0)