summaryrefslogtreecommitdiff
path: root/erts/etc/win32
diff options
context:
space:
mode:
authorDan Gudmundsson <dgud@erlang.org>2020-12-03 09:35:40 +0100
committerDan Gudmundsson <dgud@erlang.org>2020-12-03 09:35:40 +0100
commit82729b957ecae151fcac7a35765a9a864cc06a77 (patch)
tree58fdaa73d0e7d7807521c7c1a8b39b4a4b658f3a /erts/etc/win32
parentb2d38edca6c9e27c9f4eef822cd82b608f6cc345 (diff)
downloaderlang-82729b957ecae151fcac7a35765a9a864cc06a77.tar.gz
Add a default manifest for windows
Previously only erl werl and beam added the manifest. Add it to all exe and dll's. Specificly ./Install.exe that runs after the nsis installer, needs it if somebody wants to run it manually. The test runs don't want to elevate to admin for example.
Diffstat (limited to 'erts/etc/win32')
-rw-r--r--erts/etc/win32/erl.c5
-rw-r--r--erts/etc/win32/manifest.xml17
-rw-r--r--erts/etc/win32/win_erlexec.c5
-rwxr-xr-xerts/etc/win32/wsl_tools/vc/ld.sh10
4 files changed, 25 insertions, 12 deletions
diff --git a/erts/etc/win32/erl.c b/erts/etc/win32/erl.c
index 7cbd0d027c..e960fb1238 100644
--- a/erts/etc/win32/erl.c
+++ b/erts/etc/win32/erl.c
@@ -17,10 +17,7 @@
*
* %CopyrightEnd%
*/
-#pragma comment(linker,"/manifestdependency:\"type='win32' "\
- "name='Microsoft.Windows.Common-Controls' "\
- "version='6.0.0.0' processorArchitecture='*' "\
- "publicKeyToken='6595b64144ccf1df' language='*'\"")
+
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/erts/etc/win32/manifest.xml b/erts/etc/win32/manifest.xml
new file mode 100644
index 0000000000..eea364c9e9
--- /dev/null
+++ b/erts/etc/win32/manifest.xml
@@ -0,0 +1,17 @@
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity
+ type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0"
+ processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*">
+ </assemblyIdentity>
+ </dependentAssembly>
+ </dependency>
+ <ms_asmv2:trustInfo xmlns:ms_asmv2="urn:schemas-microsoft-com:asm.v2">
+ <ms_asmv2:security>
+ <ms_asmv2:requestedPrivileges>
+ <ms_asmv2:requestedExecutionLevel level="AsInvoker" uiAccess="false"></ms_asmv2:requestedExecutionLevel>
+ </ms_asmv2:requestedPrivileges>
+ </ms_asmv2:security>
+ </ms_asmv2:trustInfo>
+</assembly>
diff --git a/erts/etc/win32/win_erlexec.c b/erts/etc/win32/win_erlexec.c
index c0bb92793e..defa654ad8 100644
--- a/erts/etc/win32/win_erlexec.c
+++ b/erts/etc/win32/win_erlexec.c
@@ -22,11 +22,6 @@
* Most of this only used when beam is run as a separate process.
*/
-#pragma comment(linker,"/manifestdependency:\"type='win32' "\
- "name='Microsoft.Windows.Common-Controls' "\
- "version='6.0.0.0' processorArchitecture='*' "\
- "publicKeyToken='6595b64144ccf1df' language='*'\"")
-
#include <windows.h>
#include <winuser.h>
#include <wincon.h>
diff --git a/erts/etc/win32/wsl_tools/vc/ld.sh b/erts/etc/win32/wsl_tools/vc/ld.sh
index fc115bec8c..a16c502cea 100755
--- a/erts/etc/win32/wsl_tools/vc/ld.sh
+++ b/erts/etc/win32/wsl_tools/vc/ld.sh
@@ -177,11 +177,16 @@ RES=$?
CMANIFEST=`w32_path.sh -u $MANIFEST`
-if [ "$RES" = "0" -a -f "$CMANIFEST" ]; then
- # Add stuff to manifest to turn off "virtualization"
+if [ -f "$CMANIFEST" ]; then
+ ## Add stuff to manifest to turn off "virtualization"
sed -n -i '1h;1!H;${;g;s,<trustInfo.*</trustInfo>.,,g;p;}' $CMANIFEST 2>/dev/null
sed -i "s/<\/assembly>/ <ms_asmv2:trustInfo xmlns:ms_asmv2=\"urn:schemas-microsoft-com:asm.v2\">\n <ms_asmv2:security>\n <ms_asmv2:requestedPrivileges>\n <ms_asmv2:requestedExecutionLevel level=\"AsInvoker\" uiAccess=\"false\"\/>\n <\/ms_asmv2:requestedPrivileges>\n <\/ms_asmv2:security>\n <\/ms_asmv2:trustInfo>\n<\/assembly>/" $CMANIFEST 2>/dev/null
+else
+ CMANIFEST=$ERL_TOP/erts/etc/win32/manifest.xml
+ MANIFEST=`w32_path.sh -d $CMANIFEST`
+fi
+if [ "$RES" = "0" ]; then
eval mt.exe -nologo -manifest "$MANIFEST" -outputresource:"$OUTPUTRES" >>/tmp/link.exe.${p}.1 2>>/tmp/link.exe.${p}.2
RES=$?
if [ "$RES" != "0" ]; then
@@ -192,7 +197,6 @@ if [ "$RES" = "0" -a -f "$CMANIFEST" ]; then
echo "If you get this error, make sure Windows Defender AND Windows Search is disabled">>/tmp/link.exe.${p}.1
rm -f "$CREMOVE"
fi
- rm -f "$CMANIFEST"
fi
# This works around some strange behaviour