From fd1d6998e6a96569e478c87220f6825a3e47851c Mon Sep 17 00:00:00 2001 From: "robertshield@chromium.org" Date: Tue, 19 Jan 2010 21:15:06 +0000 Subject: Adding a secondary mini_installer target for Chrome Frame. This will remove the need to have different build scripts to build either Chrome or Chrome Frame. Also remove the now-unneeded gyp variables 'chrome_frame_define' and 'google_update_appid'. BUG=Both Chrome and Chrome Frame products should be buildable from a single solution file - we shouldn't need to run GYP with different settings to get a CF solution. TEST=none Review URL: http://codereview.chromium.org/542078 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36546 0039d316-1c4b-4281-b951-d872f2087c98 --- app/app.gyp | 50 ---- build/all.gyp | 8 +- build/common.gypi | 9 - chrome/chrome.gyp | 6 +- chrome/chrome_exe.gypi | 17 +- chrome/installer/installer.gyp | 12 +- chrome/installer/installer_util.gypi | 1 - chrome/installer/mini_installer.gyp | 309 ++++++++++++--------- chrome/installer/mini_installer/appid.h | 13 + chrome/installer/mini_installer/chrome.release | 2 - chrome/installer/mini_installer/chrome_appid.cc | 9 + .../installer/mini_installer/chrome_frame.release | 47 ++++ .../installer/mini_installer/chrome_frame_appid.cc | 9 + chrome/installer/mini_installer/mini_installer.cc | 6 +- chrome/installer/setup/install.cc | 58 ++-- chrome/tools/build/win/create_installer_archive.py | 9 +- chrome_frame/chrome_frame.gyp | 5 +- chrome_frame/rename_me_to_supplement.gypi | 29 -- 18 files changed, 315 insertions(+), 284 deletions(-) create mode 100644 chrome/installer/mini_installer/appid.h create mode 100644 chrome/installer/mini_installer/chrome_appid.cc create mode 100644 chrome/installer/mini_installer/chrome_frame.release create mode 100644 chrome/installer/mini_installer/chrome_frame_appid.cc delete mode 100644 chrome_frame/rename_me_to_supplement.gypi diff --git a/app/app.gyp b/app/app.gyp index a0bccad..dcabe1d 100644 --- a/app/app.gyp +++ b/app/app.gyp @@ -163,56 +163,6 @@ }], ], }, - { - 'target_name': 'app_id', - 'type': 'none', - 'msvs_guid': '83100055-172B-49EA-B422-B1A92B627D37', - 'conditions': [ - ['OS=="win"', - { - 'direct_dependent_settings': { - 'include_dirs': [ - '<(SHARED_INTERMEDIATE_DIR)/chrome/app_id', - ], - }, - 'actions': [ - { - 'action_name': 'appid', - 'variables': { - 'appid_py': '../chrome/tools/build/appid.py', - }, - 'conditions': [ - [ 'branding=="Chrome"', { - 'variables': { - 'appid_value': '<(google_update_appid)', - }, - }, { # else - 'variables': { - 'appid_value': '', - }, - }], - ], - 'inputs': [ - '<(appid_py)', - ], - 'outputs': [ - '<(SHARED_INTERMEDIATE_DIR)/chrome/app_id/appid.h', - 'tools/build/_always_run_appid_py.marker', - ], - 'action': [ - 'python', - '<(appid_py)', - '-a', '<(appid_value)', - '-o', '<(SHARED_INTERMEDIATE_DIR)/chrome/app_id/appid.h', - ], - 'process_outputs_as_sources': 1, - 'message': 'Generating appid information in <(SHARED_INTERMEDIATE_DIR)/chrome/appid.h' - }, - ], - }, - ], - ], - }, ], } diff --git a/build/all.gyp b/build/all.gyp index 7566802..8a0910b 100644 --- a/build/all.gyp +++ b/build/all.gyp @@ -48,11 +48,6 @@ '../v8/tools/gyp/v8.gyp:*', ], }], - ['chrome_frame_define==1', { - 'dependencies': [ - '../chrome_frame/chrome_frame.gyp:*', - ], - }], ['OS=="mac" or OS=="linux" or OS=="freebsd"', { 'dependencies': [ '../third_party/yasm/yasm.gyp:*#host', @@ -95,6 +90,7 @@ 'dependencies': [ '../breakpad/breakpad.gyp:*', '../chrome/app/locales/locales.gyp:*', + '../chrome_frame/chrome_frame.gyp:*', '../courgette/courgette.gyp:*', '../gears/gears.gyp:*', '../gpu/demos/demos.gyp:*', @@ -212,6 +208,7 @@ # mini_installer_tests depends on mini_installer. This should be # defined in installer.gyp. '../chrome/installer/mini_installer.gyp:mini_installer', + '../chrome/installer/mini_installer.gyp:chrome_frame_mini_installer', '../courgette/courgette.gyp:courgette_unittests', '../ipc/ipc.gyp:ipc_tests', '../media/media.gyp:media_unittests', @@ -241,6 +238,7 @@ # mini_installer_tests depends on mini_installer. This should be # defined in installer.gyp. '../chrome/installer/mini_installer.gyp:mini_installer', + '../chrome/installer/mini_installer.gyp:chrome_frame_mini_installer', '../courgette/courgette.gyp:courgette_unittests', '../chrome/chrome.gyp:chrome', '../chrome_frame/chrome_frame.gyp:npchrome_frame', diff --git a/build/common.gypi b/build/common.gypi index 164095d..4f6d4bb 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -149,12 +149,6 @@ # to compile as shared by default 'library%': 'static_library', - # The Google Update appid. - 'google_update_appid%': '{8A69D345-D564-463c-AFF1-A69D9E530F96}', - - # Whether to add the experimental build define. - 'chrome_frame_define%': 0, - # Whether usage of OpenMAX is enabled. 'enable_openmax%': 0, @@ -321,9 +315,6 @@ }, { # else: branding!="Chrome" 'defines': ['CHROMIUM_BUILD'], }], - ['chrome_frame_define', { - 'defines': ['CHROME_FRAME_BUILD'], - }], ['toolkit_views==1 or chromeos==1', { 'defines': ['TOOLKIT_VIEWS=1'], }], diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index 286c16e..de2a386 100755 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -1233,6 +1233,7 @@ 'installer/installer.gyp:*', '../app/app.gyp:*', '../base/base.gyp:*', + '../chrome_frame/chrome_frame.gyp:*', '../ipc/ipc.gyp:*', '../media/media.gyp:*', '../net/net.gyp:*', @@ -1275,11 +1276,6 @@ '../base/allocator/allocator.gyp:*', ], }], - ['chrome_frame_define==1', { - 'dependencies': [ - '../chrome_frame/chrome_frame.gyp:*', - ], - }], ], }, { diff --git a/chrome/chrome_exe.gypi b/chrome/chrome_exe.gypi index d57770b..7d923b7 100644 --- a/chrome/chrome_exe.gypi +++ b/chrome/chrome_exe.gypi @@ -130,13 +130,6 @@ 'chrome_exe_target': 1, }, 'conditions': [ - ['chrome_frame_define==1 and OS=="win"', { - # TODO(gregoryd): This could be shared with the 64-bit target, but - # it does not work due to a gyp issue. - 'dependencies': [ - '../chrome_frame/chrome_frame.gyp:npchrome_frame', - ], - }], ['OS=="linux" or OS=="freebsd"', { 'actions': [ { @@ -509,6 +502,7 @@ '../breakpad/breakpad.gyp:breakpad_handler_win64', '../breakpad/breakpad.gyp:breakpad_sender_win64', '../base/base.gyp:base_nacl_win64', + '../chrome_frame/chrome_frame.gyp:npchrome_frame', # TODO(gregoryd): build sandbox for 64 bit # '../sandbox/sandbox.gyp:sandbox', ], @@ -524,15 +518,6 @@ 'ProgramDatabaseFile': '$(OutDir)\\nacl_exe.pdb', }, }, - 'conditions': [ - ['chrome_frame_define==1 and OS=="win"', { - # TODO(gregoryd): This could be shared with the 32-bit target, but - # it does not work due to a gyp issue. - 'dependencies': [ - '../chrome_frame/chrome_frame.gyp:npchrome_frame', - ], - }], - ], 'configurations': { 'Common_Base': { 'msvs_target_platform': 'x64', diff --git a/chrome/installer/installer.gyp b/chrome/installer/installer.gyp index b28017d..28b46826 100644 --- a/chrome/installer/installer.gyp +++ b/chrome/installer/installer.gyp @@ -176,6 +176,7 @@ '../../build/util/build_util.gyp:lastchange', '../../build/util/support/support.gyp:*', '../../build/win/system.gyp:cygwin', + '../../chrome_frame/chrome_frame.gyp:npchrome_frame', ], 'include_dirs': [ '../..', @@ -188,7 +189,7 @@ ], }, 'sources': [ - 'mini_installer/chrome.release', + 'mini_installer/chrome_frame.release', 'setup/install.cc', 'setup/install.h', 'setup/setup_main.cc', @@ -244,9 +245,11 @@ 'extension': 'release', 'variables': { 'scan_server_dlls_py' : '../tools/build/win/scan_server_dlls.py', + 'template_file': 'mini_installer/chrome_frame.release', }, 'inputs': [ - ' #include +#include "chrome/installer/mini_installer/appid.h" #include "chrome/installer/mini_installer/mini_installer.h" #include "chrome/installer/mini_installer/pe_resource.h" -// Generated header that includes the Google Update id. -#include "appid.h" - // Required linker symbol. See remarks above. extern "C" unsigned int __sse2_available = 0; @@ -155,7 +153,7 @@ void SetFullInstallerFlag(HKEY root_key) { if (!SafeStrCopy(ap_registry_key, _countof(ap_registry_key), kApRegistryKeyBase) || !SafeStrCat(ap_registry_key, _countof(ap_registry_key), - google_update::kChromeGuid)) { + google_update::kAppGuid)) { return; } if (::RegOpenKeyEx(root_key, ap_registry_key, NULL, diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc index 088ba65..145b7ce 100644 --- a/chrome/installer/setup/install.cc +++ b/chrome/installer/setup/install.cc @@ -30,11 +30,6 @@ #include "installer_util_strings.h" #include "registered_dlls.h" -#if defined(CHROME_FRAME_BUILD) -COMPILE_ASSERT(kNumDllsToRegister > 0, - Chrome_Frame_DLL_must_be_built_before_setup); -#endif - namespace { std::wstring AppendPath(const std::wstring& parent_path, @@ -372,30 +367,39 @@ bool DoPostInstallTasks(HKEY reg_root, } } - // Now we need to register any self registering components and unregister - // any that were left from the old version that is being upgraded: - if (!current_version.empty()) { - std::wstring old_dll_path(install_path); - file_util::AppendToPath(&old_dll_path, current_version); - scoped_ptr old_dll_list(WorkItem::CreateWorkItemList()); - if (InstallUtil::BuildDLLRegistrationList(old_dll_path, kDllsToRegister, - kNumDllsToRegister, false, - old_dll_list.get())) { - // Don't abort the install as a result of a failure to unregister old - // DLLs. - old_dll_list->Do(); + if (InstallUtil::IsChromeFrameProcess()) { + // Chrome Frame instances of setup.exe should always have at least + // one DLL to register. Enforce that this is so. + if (kNumDllsToRegister <= 0) { + NOTREACHED(); + return false; } - } - std::wstring dll_path(install_path); - file_util::AppendToPath(&dll_path, new_version.GetString()); - scoped_ptr dll_list(WorkItem::CreateWorkItemList()); - if (InstallUtil::BuildDLLRegistrationList(dll_path, kDllsToRegister, - kNumDllsToRegister, true, - dll_list.get())) { - if (!dll_list->Do()) { - dll_list->Rollback(); - return false; + // Now we need to register any self registering components and unregister + // any that were left from the old version that is being upgraded: + if (!current_version.empty()) { + std::wstring old_dll_path(install_path); + file_util::AppendToPath(&old_dll_path, current_version); + scoped_ptr old_dll_list(WorkItem::CreateWorkItemList()); + if (InstallUtil::BuildDLLRegistrationList(old_dll_path, kDllsToRegister, + kNumDllsToRegister, false, + old_dll_list.get())) { + // Don't abort the install as a result of a failure to unregister old + // DLLs. + old_dll_list->Do(); + } + } + + std::wstring dll_path(install_path); + file_util::AppendToPath(&dll_path, new_version.GetString()); + scoped_ptr dll_list(WorkItem::CreateWorkItemList()); + if (InstallUtil::BuildDLLRegistrationList(dll_path, kDllsToRegister, + kNumDllsToRegister, true, + dll_list.get())) { + if (!dll_list->Do()) { + dll_list->Rollback(); + return false; + } } } diff --git a/chrome/tools/build/win/create_installer_archive.py b/chrome/tools/build/win/create_installer_archive.py index 35b5437..eeb0c01 100755 --- a/chrome/tools/build/win/create_installer_archive.py +++ b/chrome/tools/build/win/create_installer_archive.py @@ -147,12 +147,14 @@ def MakeStagingDirectories(output_dir): """Creates a staging path for installer archive. If directory exists already, deletes the existing directory. """ - file_path = os.path.join(output_dir, ARCHIVE_DIR) + prefixed_archive_dir = (options.archive_prefix or "") + ARCHIVE_DIR + file_path = os.path.join(output_dir, prefixed_archive_dir) if os.path.exists(file_path): shutil.rmtree(file_path) os.makedirs(file_path) - temp_file_path = os.path.join(output_dir, TEMP_ARCHIVE_DIR) + prefixed_temp_archive_dir = (options.archive_prefix or "") + TEMP_ARCHIVE_DIR + temp_file_path = os.path.join(output_dir, prefixed_temp_archive_dir) if os.path.exists(temp_file_path): shutil.rmtree(temp_file_path) os.makedirs(temp_file_path) @@ -313,6 +315,9 @@ if '__main__' == __name__: 'specifies the directory that contains base versions of ' + 'setup.exe, courgette.exe (if --diff_algorithm is COURGETTE) ' + '& chrome.7z.') + option_parser.add_option('-p', '--archive_prefix', + help='Specifies a prefix to the archive path. Useful if building ' + + 'multiple installer archives.') option_parser.add_option('-f', '--setup_exe_format', default='COMPRESSED', help='How setup.exe should be included {COMPRESSED|DIFF|FULL}.') option_parser.add_option('-a', '--diff_algorithm', default='BSDIFF', diff --git a/chrome_frame/chrome_frame.gyp b/chrome_frame/chrome_frame.gyp index 75d0d42..de04bbd 100644 --- a/chrome_frame/chrome_frame.gyp +++ b/chrome_frame/chrome_frame.gyp @@ -304,7 +304,6 @@ 'dependencies': [ '../base/base.gyp:test_support_base', '../chrome/chrome.gyp:browser', - '../chrome/chrome.gyp:chrome_dll_version', '../chrome/chrome.gyp:chrome_resources', '../chrome/chrome.gyp:debugger', '../chrome/chrome.gyp:renderer', @@ -343,11 +342,11 @@ 'conditions': [ ['OS=="win"', { 'dependencies': [ - '../chrome/chrome.gyp:automation', '../breakpad/breakpad.gyp:breakpad_handler', + '../chrome/chrome.gyp:automation', + '../chrome/chrome.gyp:chrome_dll_version', '../chrome/installer/installer.gyp:installer_util', '../google_update/google_update.gyp:google_update', - '../chrome/installer/installer.gyp:installer_util', ] }], ], diff --git a/chrome_frame/rename_me_to_supplement.gypi b/chrome_frame/rename_me_to_supplement.gypi deleted file mode 100644 index bdc9ae9..0000000 --- a/chrome_frame/rename_me_to_supplement.gypi +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2009 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# It is used to override the Chrome Frame appid, as well as -# add extra required source files and defines. The file is checked in as -# rename_me_to_supplement.gypi so as to not be active on the official builder. -# This is required because with these fields present, Chrome will build in -# Chrome Frame mode, which isn't what the Chrome official builder wants yet. -# -# Renaming this file to supplement.gypi will cause gyp to pick it up. -# supplement.gypi is a magic gyp include file that gets pulled in before any -# other includes. -# -# The official builder will define these extra vars and whatnot in the build -# scripts themselves. -{ - 'variables': { - 'google_update_appid': '{8BA986DA-5100-405E-AA35-86F34A02ACBF}', - 'extra_installer_util_sources': 0, - 'chrome_frame_define': 1, - }, -} - -# Local Variables: -# tab-width:2 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=2 shiftwidth=2: -- cgit v1.1