summaryrefslogtreecommitdiff
path: root/erts/etc/win32
diff options
context:
space:
mode:
authorDan Gudmundsson <dgud@erlang.org>2020-12-09 08:39:22 +0100
committerGitHub <noreply@github.com>2020-12-09 08:39:22 +0100
commit1e47980dbf545aaabc849e966efbf7d81f85aa7b (patch)
tree3d0ce5a85aec8fc87972fc6322740dcf5fa93727 /erts/etc/win32
parent8392c461f6192e80f6ab69bc4c9d5f793fae0b2d (diff)
parent82729b957ecae151fcac7a35765a9a864cc06a77 (diff)
downloaderlang-1e47980dbf545aaabc849e966efbf7d81f85aa7b.tar.gz
Merge pull request #2907 from dgud/dgud/otp/win-manifest
Add a default manifest for windows OTP-17067
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