diff --git a/erts/etc/win32/nsis/Makefile b/erts/etc/win32/nsis/Makefile index a53ac70..7bcecaa 100644 --- a/erts/etc/win32/nsis/Makefile +++ b/erts/etc/win32/nsis/Makefile @@ -62,9 +62,15 @@ else endif REDIST_FILE=$(shell (sh ./find_redist.sh || echo "")) +ifeq ($(MSYSTEM),MINGW32) + NICEREDISTFILE=$(shell (msys2win_path.sh -m "$(REDIST_FILE)" 2>/dev/null || echo "")) +else + NICEREDISTFILE=$(shell (cygpath -d -m "$(REDIST_FILE)" 2>/dev/null || echo "")) +endif + REDIST_TARGET=$(shell (sh ./find_redist.sh -n || echo "")) -REDIST_DLL_VERSION=$(shell (sh ./dll_version_helper.sh || echo "")) -REDIST_DLL_NAME=$(shell (sh ./dll_version_helper.sh -n || echo "")) +REDIST_DLL_VERSION=$(shell (sh ./dll_version_helper.sh $(NICEREDISTFILE) || echo "")) +REDIST_DLL_NAME=$(shell (sh ./dll_version_helper.sh -n $(NICEREDISTFILE) || echo "")) release_spec: @NSIS_VER=`makensis /hdrinfo | head -1 | awk '{print $$2}'`; \ diff --git a/erts/etc/win32/nsis/dll_version_helper.sh b/erts/etc/win32/nsis/dll_version_helper.sh index 96e4532..0d9ba42 100755 --- a/erts/etc/win32/nsis/dll_version_helper.sh +++ b/erts/etc/win32/nsis/dll_version_helper.sh @@ -25,6 +25,13 @@ # echo "8.0.50727.763" # exit 0 +if [ "$1" = "-n" ]; then + SWITCH=$1 + shift +else + SWITCH="" +fi + cat > hello.c < #include @@ -42,11 +49,16 @@ if [ '!' -f hello.exe.manifest ]; then # need another way of getting the version DLLNAME=`dumpbin.exe -imports hello.exe | egrep MSVCR.*dll` DLLNAME=`echo $DLLNAME` + if [ '!' -z "$1" ]; then + FILETOLOOKIN=$1 + else + FILETOLOOKIN=$DLLNAME + fi cat > helper.c < #include -#define REQ_MODULE "$DLLNAME" +#define REQ_MODULE "$FILETOLOOKIN" int main(void) { @@ -100,7 +112,7 @@ else NAME=`grep '