Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4715)

Unified Diff: chrome/tools/build/win/create_installer_archive.py

Issue 2559053002: Instrument setup.exe in the SyzyAsan builds.
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/tools/build/win/create_installer_archive.py
diff --git a/chrome/tools/build/win/create_installer_archive.py b/chrome/tools/build/win/create_installer_archive.py
index 4a4f08072c95d622b239b66d006637c58f5a827a..666899561c25bcad6466ef98c1750762e8afb087 100755
--- a/chrome/tools/build/win/create_installer_archive.py
+++ b/chrome/tools/build/win/create_installer_archive.py
@@ -325,7 +325,7 @@ def PrepareSetupExec(options, current_version, prev_version):
'/D', 'CompressionType=LZX',
'/V1',
'/L', options.output_dir,
- os.path.join(options.build_dir, SETUP_EXEC),]
+ os.path.join(options.output_dir, SETUP_EXEC),]
RunSystemCommand(cmd, options.verbose)
setup_file = SETUP_EXEC[:-1] + "_"
return setup_file
@@ -366,11 +366,10 @@ def CreateResourceInputFile(
os.path.join(output_dir, archive_file)))
# Include all files needed to run setup.exe (these are copied into the
# 'Installer' dir by DoComponentBuildTasks).
- if component_build:
- installer_dir = os.path.join(staging_dir, CHROME_DIR, current_version,
- 'Installer')
- for file in os.listdir(installer_dir):
- resources.append((file, 'BN', os.path.join(installer_dir, file)))
+ installer_dir = os.path.join(staging_dir, CHROME_DIR, current_version,
+ 'Installer')
+ for file in os.listdir(installer_dir):
+ resources.append((file, 'BN', os.path.join(installer_dir, file)))
with open(resource_file_path, 'w') as f:
f.write(_RESOURCE_FILE_HEADER)
@@ -468,6 +467,21 @@ def ParseDLLsFromDeps(build_dir, runtime_deps_file):
build_dlls.add(os.path.join(build_dir, l))
return build_dlls
+
+def CopySetupRuntimeDeps(build_dir, setup_runtime_deps, version_dir):
+ """Copy the setup.exe runtime dependencies to the installer's directory."""
+ installer_dir = os.path.join(version_dir, 'Installer')
+ # |installer_dir| is technically only created post-install, but we need it
+ # now to add setup.exe's config and manifest to the archive.
+ if not os.path.exists(installer_dir):
+ os.mkdir(installer_dir)
+
+ setup_component_dlls = ParseDLLsFromDeps(build_dir, setup_runtime_deps)
+ for setup_component_dll in setup_component_dlls:
+ g_archive_inputs.append(setup_component_dll)
+ shutil.copy(setup_component_dll, installer_dir)
+
+
# Copies component build DLLs and generates required config files and manifests
# in order for chrome.exe and setup.exe to be able to find those DLLs at
# run-time.
@@ -479,17 +493,8 @@ def DoComponentBuildTasks(staging_dir, build_dir, target_arch,
# Get the required directories for the upcoming operations.
chrome_dir = os.path.join(staging_dir, CHROME_DIR)
version_dir = os.path.join(chrome_dir, current_version)
- installer_dir = os.path.join(version_dir, 'Installer')
- # |installer_dir| is technically only created post-install, but we need it
- # now to add setup.exe's config and manifest to the archive.
- if not os.path.exists(installer_dir):
- os.mkdir(installer_dir)
- setup_component_dlls = ParseDLLsFromDeps(build_dir, setup_runtime_deps)
-
- for setup_component_dll in setup_component_dlls:
- g_archive_inputs.append(setup_component_dll)
- shutil.copy(setup_component_dll, installer_dir)
+ CopySetupRuntimeDeps(build_dir, setup_runtime_deps, version_dir)
# Stage all the component DLLs to the |version_dir| (for
# the version assembly to be able to refer to them below and make sure
@@ -549,6 +554,9 @@ def main(options):
DoComponentBuildTasks(staging_dir, options.build_dir,
options.target_arch, options.setup_runtime_deps,
options.chrome_runtime_deps, current_version)
+ elif options.setup_runtime_deps:
+ CopySetupRuntimeDeps(options.build_dir, options.setup_runtime_deps,
+ os.path.join(staging_dir, CHROME_DIR, current_version))
version_numbers = current_version.split('.')
current_build_number = version_numbers[2] + '.' + version_numbers[3]

Powered by Google App Engine
This is Rietveld 408576698