aboutsummaryrefslogtreecommitdiffstats
path: root/erts/etc/win32
diff options
context:
space:
mode:
Diffstat (limited to 'erts/etc/win32')
-rwxr-xr-xerts/etc/win32/nsis/dll_version_helper.sh75
-rwxr-xr-xerts/etc/win32/nsis/find_redist.sh46
2 files changed, 98 insertions, 23 deletions
diff --git a/erts/etc/win32/nsis/dll_version_helper.sh b/erts/etc/win32/nsis/dll_version_helper.sh
index 571ee3e39e..eecd4a72b5 100755
--- a/erts/etc/win32/nsis/dll_version_helper.sh
+++ b/erts/etc/win32/nsis/dll_version_helper.sh
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2007-2010. All Rights Reserved.
+# Copyright Ericsson AB 2007-2011. All Rights Reserved.
#
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
@@ -26,6 +26,7 @@
# exit 0
cat > hello.c <<EOF
+#include <windows.h>
#include <stdio.h>
int main(void)
@@ -35,14 +36,74 @@ int main(void)
}
EOF
-cl /MD hello.c > /dev/null 2>&1
+cl /MD hello.c > /dev/null 2>&1
if [ '!' -f hello.exe.manifest ]; then
- echo "This compiler does not generate manifest files - OK if using mingw" >&2
- exit 0
+ # Gah - VC 2010 changes the way it handles DLL's and manifests... Again...
+ # need another way of getting the version
+ DLLNAME=`dumpbin.exe /imports hello.exe | egrep MSVCR.*dll`
+ DLLNAME=`echo $DLLNAME`
+ cat > helper.c <<EOF
+#include <windows.h>
+#include <stdio.h>
+
+#define REQ_MODULE "$DLLNAME"
+
+int main(void)
+{
+ DWORD dummy;
+ DWORD versize;
+ int i,n;
+ unsigned char *versinfo;
+ char buff[100];
+
+ char *vs_verinfo;
+ unsigned int vs_ver_size;
+
+ struct LANGANDCODEPAGE {
+ WORD language;
+ WORD codepage;
+ } *translate;
+
+ unsigned int tr_size;
+
+ if (!(versize = GetFileVersionInfoSize(REQ_MODULE,&dummy))) {
+ fprintf(stderr,"No version info size in %s!\n",REQ_MODULE);
+ exit(1);
+ }
+ versinfo=malloc(versize);
+ if (!GetFileVersionInfo(REQ_MODULE,dummy,versize,versinfo)) {
+ fprintf(stderr,"No version info in %s!\n",REQ_MODULE);
+ exit(2);
+ }
+ if (!VerQueryValue(versinfo,"\\\\VarFileInfo\\\\Translation",&translate,&tr_size)) {
+ fprintf(stderr,"No translation info in %s!\n",REQ_MODULE);
+ exit(3);
+ }
+ n = tr_size/sizeof(translate);
+ for(i=0; i < n; ++i) {
+ sprintf(buff,"\\\\StringFileInfo\\\\%04x%04x\\\\FileVersion",
+ translate[i].language,translate[i].codepage);
+ if (VerQueryValue(versinfo,buff,&vs_verinfo,&vs_ver_size)) {
+ printf("%s\n",(char *) vs_verinfo);
+ return 0;
+ }
+ }
+ fprintf(stderr,"Failed to find file version of %s\n",REQ_MODULE);
+ return 0;
+}
+EOF
+ cl /MD helper.c version.lib > /dev/null 2>&1
+ if [ '!' -f helper.exe ]; then
+ echo "Failed to build helper program." >&2
+ exit 1
+ fi
+ NAME=$DLLNAME
+ VERSION=`./helper`
+else
+ VERSION=`grep '<assemblyIdentity' hello.exe.manifest | sed 's,.*version=.\([0-9\.]*\).*,\1,g' | grep -v '<'`
+ NAME=`grep '<assemblyIdentity' hello.exe.manifest | sed 's,.*name=.[A-Za-z\.]*\([0-9]*\).*,msvcr\1.dll,g' | grep -v '<'`
fi
-VERSION=`grep '<assemblyIdentity' hello.exe.manifest | sed 's,.*version=.\([0-9\.]*\).*,\1,g' | grep -v '<'`
-NAME=`grep '<assemblyIdentity' hello.exe.manifest | sed 's,.*name=.[A-Za-z\.]*\([0-9]*\).*,msvcr\1.dll,g' | grep -v '<'`
-rm -f hello.c hello.obj hello.exe hello.exe.manifest
+#rm -f hello.c hello.obj hello.exe hello.exe.manifest helper.c helper.obj helper.exe helper.exe.manifest
if [ "$1" = "-n" ]; then
ASKEDFOR=$NAME
else
diff --git a/erts/etc/win32/nsis/find_redist.sh b/erts/etc/win32/nsis/find_redist.sh
index 153977ded5..328811a0d7 100755
--- a/erts/etc/win32/nsis/find_redist.sh
+++ b/erts/etc/win32/nsis/find_redist.sh
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2007-2010. All Rights Reserved.
+# Copyright Ericsson AB 2007-2011. All Rights Reserved.
#
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
@@ -114,13 +114,18 @@ RCPATH=`lookup_prog_in_path rc`
fail=false
if [ '!' -z "$RCPATH" ]; then
BPATH=$RCPATH
- for x in rc bin v6.0A ; do
- NBPATH=`remove_path_element $x "$BPATH"`
- if [ "$NBPATH" = "$BPATH" ]; then
- fail=true
- break;
+ allow_fail=false
+ for x in rc bin @ANY v6.0A v7.0A v7.1; do
+ if [ $x = @ANY ]; then
+ allow_fail=true
+ else
+ NBPATH=`remove_path_element $x "$BPATH"`
+ if [ $allow_fail = false -a "$NBPATH" = "$BPATH" ]; then
+ fail=true
+ break;
+ fi
+ BPATH="$NBPATH"
fi
- BPATH="$NBPATH"
done
if [ $fail = false ]; then
BPATH_LIST="$BPATH_LIST $BPATH"
@@ -129,23 +134,32 @@ fi
# Frantic search through two roots with different
# version directories. We want to be very specific about the
-# directory structures as we woildnt want to find the wrong
+# directory structures as we wouldnt want to find the wrong
# redistributables...
-#echo $BPATH
+#echo $BPATH_LIST
for BP in $BPATH_LIST; do
- for verdir in "sdk v2.0" "sdk v3.5" "v6.0A"; do
+ #echo "BP=$BP"
+ for verdir in "sdk v2.0" "sdk v3.5" "v6.0A" "v7.0A" "v7.1"; do
BPATH=$BP
fail=false
- for x in $verdir bootstrapper packages vcredist_x86 vcredist_x86.exe; do
+ allow_fail=false
+ for x in $verdir @ANY bootstrapper packages vcredist_x86 Redist VC @ALL vcredist_x86.exe; do
#echo "x=$x"
#echo "BPATH=$BPATH"
- NBPATH=`add_path_element $x "$BPATH"`
- if [ "$NBPATH" = "$BPATH" ]; then
- fail=true
- break;
+ #echo "allow_fail=$allow_fail"
+ if [ $x = @ANY ]; then
+ allow_fail=true
+ elif [ $x = @ALL ]; then
+ allow_fail=false
+ else
+ NBPATH=`add_path_element $x "$BPATH"`
+ if [ $allow_fail = false -a "$NBPATH" = "$BPATH" ]; then
+ fail=true
+ break;
+ fi
+ BPATH="$NBPATH"
fi
- BPATH="$NBPATH"
done
if [ $fail = false ]; then
break;