Skip to content

Commit

Permalink
prepare nsis scripts for arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
cocoa-xu committed May 20, 2024
1 parent 40568b0 commit 92d8cac
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
3 changes: 3 additions & 0 deletions erts/etc/win32/nsis/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ WTARGET_DIR=$(shell (w32_path.sh -d "$(TARGET_DIR)"))
ifeq ($(CONFIG_SUBTYPE),win64)
WINTYPE=win64
REDIST_TARGET=vcredist_x64.exe
else ifeq ($(CONFIG_SUBTYPE),arm64)
WINTYPE=arm64
REDIST_TARGET=vcredist_arm64.exe
else
WINTYPE=win32
REDIST_TARGET=vcredist_x86.exe
Expand Down
12 changes: 10 additions & 2 deletions erts/etc/win32/nsis/erlang20.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ Var STARTMENU_FOLDER
!if ${WINTYPE} == "win64"
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "${OTP_PRODUCT} ${OTP_RELEASE} (x64)"
!else
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "${OTP_PRODUCT} ${OTP_RELEASE} (i386)"
!if ${WINTYPE} == "arm64"
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "${OTP_PRODUCT} ${OTP_RELEASE} (arm64)"
!else
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "${OTP_PRODUCT} ${OTP_RELEASE} (i386)"
!endif
!endif

;--------------------------------
Expand Down Expand Up @@ -104,7 +108,7 @@ Var STARTMENU_FOLDER

VIProductVersion "${OTP_VERSION_LONG}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "Ericsson AB"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${OTP_VERSION}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${OTP_VERSION}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Erlang/OTP installer"
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright Ericsson AB 2010-${YEAR}. All Rights Reserved."
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Erlang/OTP"
Expand Down Expand Up @@ -385,6 +389,10 @@ Function .onInit
StrCmpS ${WINTYPE} "win64" +1 +4
StrCpy $archprefix "amd64"
StrCpy $sysnativedir "$WINDIR\sysnative"
Goto +4
StrCmpS ${WINTYPE} "arm64" +1 +6
StrCpy $archprefix "arm64"
StrCpy $sysnativedir "$WINDIR\sysnative"
Goto +3
StrCpy $archprefix "x86"
StrCpy $sysnativedir $SYSDIR
Expand Down
15 changes: 13 additions & 2 deletions erts/etc/win32/nsis/find_redist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,19 @@ add_path_element()
if [ "$1" = "win64" ]; then
AMD64DIR=true
VCREDIST=vcredist_x64
VCREDIST2=vcredist.x64
COMPONENTS="cl amd64 bin vc"
elif [ "$1" = "win32" ]; then
AMD64DIR=false
VCREDIST=vcredist_x86
VCREDIST2=vcredist.x86
COMPONENTS="cl bin vc"
elif [ "$1" = "arm64" ]; then
AMD64DIR=false
VCREDIST=vcredist_arm64
VCREDIST2=vcredist.arm64
else
echo "TARGET argument should win32 or win64"
echo "TARGET argument should win32, win64 or arm64"
exit 2
fi

Expand All @@ -101,11 +107,16 @@ if [ x"$VCToolsRedistDir" != x"" ]; then
echo "$File"
exit 0
fi
File="$VCToolsRedistDir/$VCREDIST2.exe"
if [ -r "$File" ]; then
echo "$File"
exit 0
fi
fi

CLPATH=`lookup_prog_in_path cl`
if [ -z "$CLPATH" ]; then
echo "Can not locate cl.exe and vcredist_x86/x64.exe - OK if using mingw" >&2
echo "Can not locate cl.exe and vcredist_x86/x64/arm64.exe - OK if using mingw" >&2
exit 1
fi

Expand Down

0 comments on commit 92d8cac

Please sign in to comment.