From d20eab9831c920a1d0807bdc833a74185c4637b1 Mon Sep 17 00:00:00 2001 From: Phillip Lord Date: Thu, 16 Nov 2017 22:08:35 +0000 Subject: [PATCH] Fix install location for windows installer --- admin/nt/dist-build/build-zips.sh | 7 +++++-- admin/nt/dist-build/emacs.nsi | 25 +++++++++++++++++++++---- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/admin/nt/dist-build/build-zips.sh b/admin/nt/dist-build/build-zips.sh index 138ef4d4699..ce4a11dc1e7 100755 --- a/admin/nt/dist-build/build-zips.sh +++ b/admin/nt/dist-build/build-zips.sh @@ -69,7 +69,9 @@ function build_installer { cd $HOME/emacs-build/install/emacs-$VERSION echo Calling makensis in `pwd` cp ../../git/$BRANCH/admin/nt/dist-build/emacs.nsi . - makensis -DARCH=$ARCH -DEMACS_VERSION=$ACTUAL_VERSION \ + + makensis -v4 \ + -DARCH=$ARCH -DEMACS_VERSION=$ACTUAL_VERSION \ -DOUT_VERSION=$VERSION emacs.nsi rm emacs.nsi mv Emacs-$ARCH-$VERSION-installer.exe ~/emacs-upload @@ -104,7 +106,7 @@ while getopts "36ghsiV:" opt; do GIT_UP=1 ;; i) - BUILD=1 + BUILD=0 ;; V) VERSION=$OPTARG @@ -117,6 +119,7 @@ while getopts "36ghsiV:" opt; do echo " -3 32 bit build only" echo " -6 64 bit build only" echo " -g git update and worktree only" + echo " -i build installer only" exit 0 ;; \?) diff --git a/admin/nt/dist-build/emacs.nsi b/admin/nt/dist-build/emacs.nsi index ec33dc03da6..492e4cd97d8 100644 --- a/admin/nt/dist-build/emacs.nsi +++ b/admin/nt/dist-build/emacs.nsi @@ -1,14 +1,12 @@ !include MUI2.nsh - +!include LogicLib.nsh +!include x64.nsh Outfile "Emacs-${ARCH}-${OUT_VERSION}-installer.exe" - -InstallDir "$DESKTOP\Emacs-${EMACS_VERSION}" SetCompressor /solid lzma - Var StartMenuFolder @@ -36,6 +34,25 @@ Var StartMenuFolder !insertmacro MUI_LANGUAGE "English" Name Emacs-${EMACS_VERSION} +function .onInit + ${If} ${RunningX64} + ${If} ${ARCH} == "x86_64" + StrCpy $INSTDIR "$PROGRAMFILES64\Emacs" + ${Else} + StrCpy $INSTDIR "$PROGRAMFILES32\Emacs" + ${Endif} + ${Else} + ${If} ${ARCH} == "x86_64" + Quit + ${Else} + StrCpy $INSTDIR "$PROGRAMFILES\Emacs" + ${Endif} + ${EndIf} + + MessageBox MB_OK "Installdir is $INSTDIR" +functionend + + Section SetOutPath $INSTDIR -- 2.39.2