From 9610e656bbbfe0010ad441c89a6608e21a114a0a Mon Sep 17 00:00:00 2001 From: Ales Pergl Date: Mon, 12 Jun 2017 16:00:52 +0200 Subject: [PATCH 1/3] Use dynamic CRT in the release build --- brightray/brightray.gypi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brightray/brightray.gypi b/brightray/brightray.gypi index e51774370b7d..c0dc92b98c16 100644 --- a/brightray/brightray.gypi +++ b/brightray/brightray.gypi @@ -209,7 +209,7 @@ 'abstract': 1, 'msvs_settings': { 'VCCLCompilerTool': { - 'RuntimeLibrary': '0', # /MT (nondebug static) + 'RuntimeLibrary': '2', # /MD (nondebug DLL) # 1, optimizeMinSpace, Minimize Size (/O1) 'Optimization': '1', # 2, favorSize - Favor small code (/Os) From b72da0a509a4f85eeb40e1c82946726755e6174c Mon Sep 17 00:00:00 2001 From: Ales Pergl Date: Thu, 15 Jun 2017 09:50:09 +0200 Subject: [PATCH 2/3] Include VC runtime and UCRT in the Windows distribution --- script/create-dist.py | 51 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/script/create-dist.py b/script/create-dist.py index f39283d52e75..dc689ac33879 100755 --- a/script/create-dist.py +++ b/script/create-dist.py @@ -8,6 +8,8 @@ import shutil import subprocess import sys import stat +if sys.platform == "win32": + import _winreg from lib.config import BASE_URL, PLATFORM, get_target_arch, get_zip_name from lib.util import scoped_cwd, rm_rf, get_electron_version, make_zip, \ @@ -60,6 +62,7 @@ TARGET_BINARIES = { 'snapshot_blob.bin', ], } +TARGET_BINARIES_EXT = [] TARGET_DIRECTORIES = { 'darwin': [ '{0}.app'.format(PRODUCT_NAME), @@ -85,6 +88,9 @@ def main(): copy_chrome_binary('chromedriver') copy_chrome_binary('mksnapshot') copy_license() + if PLATFORM == 'win32': + copy_vcruntime_binaries() + copy_ucrt_binaries() args = parse_args() @@ -129,6 +135,47 @@ def copy_chrome_binary(binary): os.chmod(dest, os.stat(dest).st_mode | stat.S_IEXEC) +def copy_vcruntime_binaries(): + with _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, + r"SOFTWARE\Microsoft\VisualStudio\14.0\Setup\VC", 0, + _winreg.KEY_READ | _winreg.KEY_WOW64_32KEY) as key: + crt_dir = _winreg.QueryValueEx(key, "ProductDir")[0] + + arch = get_target_arch() + if arch == "ia32": + arch = "x86" + + crt_dir += r"redist\{0}\Microsoft.VC140.CRT\\".format(arch) + + dlls = ["msvcp140.dll", "vcruntime140.dll"] + + # Note: copyfile is used to remove the read-only flag + for dll in dlls: + shutil.copyfile(crt_dir + dll, os.path.join(DIST_DIR, dll)) + TARGET_BINARIES_EXT.append(dll) + + +def copy_ucrt_binaries(): + with _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, + r"SOFTWARE\Microsoft\Windows Kits\Installed Roots" + ) as key: + ucrt_dir = _winreg.QueryValueEx(key, "KitsRoot10")[0] + + arch = get_target_arch() + if arch == "ia32": + arch = "x86" + + ucrt_dir += r"Redist\ucrt\DLLs\{0}".format(arch) + + dlls = glob.glob(os.path.join(ucrt_dir, '*.dll')) + if len(dlls) == 0: + raise Exception('UCRT files not found') + + for dll in dlls: + shutil.copy2(dll, DIST_DIR) + TARGET_BINARIES_EXT.append(os.path.basename(dll)) + + def copy_license(): shutil.copy2(os.path.join(CHROMIUM_DIR, '..', 'LICENSES.chromium.html'), DIST_DIR) @@ -192,8 +239,8 @@ def create_dist_zip(): zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name) with scoped_cwd(DIST_DIR): - files = TARGET_BINARIES[PLATFORM] + ['LICENSE', 'LICENSES.chromium.html', - 'version'] + files = TARGET_BINARIES[PLATFORM] + TARGET_BINARIES_EXT + ['LICENSE', + 'LICENSES.chromium.html', 'version'] dirs = TARGET_DIRECTORIES[PLATFORM] make_zip(zip_file, files, dirs) From 0bdd35a4827330dc8c6a856ba1aef3ea05536ab3 Mon Sep 17 00:00:00 2001 From: Ales Pergl Date: Thu, 15 Jun 2017 09:58:43 +0200 Subject: [PATCH 3/3] Updated `libchromiumcontent` submodule --- vendor/libchromiumcontent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/libchromiumcontent b/vendor/libchromiumcontent index 3d692b2280bd..6cb70ce82575 160000 --- a/vendor/libchromiumcontent +++ b/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit 3d692b2280bd28cc9c6d8f79aa852b960f3d6a72 +Subproject commit 6cb70ce82575d6f9e115cbab4bc6495ed61e3b22