diff options
author | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-07 04:08:56 +0000 |
---|---|---|
committer | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-07 04:08:56 +0000 |
commit | 58d9fe56a31875c85168c8b7264099900ea397b5 (patch) | |
tree | 7e18a793e6692199e5338b54cf5c6f89bec18d17 | |
parent | fe4e649c161fc4e637fe963d15c904ee5e2e1bc7 (diff) | |
download | chromium_src-58d9fe56a31875c85168c8b7264099900ea397b5.zip chromium_src-58d9fe56a31875c85168c8b7264099900ea397b5.tar.gz chromium_src-58d9fe56a31875c85168c8b7264099900ea397b5.tar.bz2 |
1) Generate VisualElementsManifest.xml at install time from a pre-defined template.
This allows us to put images in the version directory (i.e. a path that changes each istall; rather than needing the images beside chrome.exe).
This also allows us to localize the Display Name of Google Chrome. This however does not fix bug #123376 (we have the same issue here).
2) Fixes create_installer_archive.py to not create empty directories for output directories specified in chrome.release for which the input is not present when packaging chrome.7z
3) Removes "Dictionaries\en-US.bdic: %(ChromeDir)s\Dictionaries" from chrome.release which has not been packaged since Chrome 17 (and maybe even before that).
4) (2+3) have the side-effect that there is no longer an empty Dictionaries/ directory created at install.
BUG=123319,123376
TEST=Install Chrome on Win8 and watch VisualElementsManifest.xml land with the correct values.
Overinstall Chrome on a Win8 install with VisualElementsManifest.xml from an installer that doesn't have VisualElements --> ensure VisualElementsManifest.xml is deleted and icons go back to default-style.
Review URL: http://codereview.chromium.org/10160011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135615 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/chrome_installer.gypi | 39 | ||||
-rw-r--r-- | chrome/installer/mini_installer/chrome.release | 16 | ||||
-rw-r--r-- | chrome/installer/setup/install.cc | 78 | ||||
-rw-r--r-- | chrome/installer/setup/install.h | 13 | ||||
-rw-r--r-- | chrome/installer/setup/install_unittest.cc | 104 | ||||
-rw-r--r-- | chrome/installer/setup/install_worker.cc | 50 | ||||
-rw-r--r-- | chrome/installer/setup/setup_constants.cc | 11 | ||||
-rw-r--r-- | chrome/installer/setup/setup_constants.h | 8 | ||||
-rw-r--r-- | chrome/installer/util/install_util.cc | 2 | ||||
-rw-r--r-- | chrome/installer/util/util_constants.h | 5 | ||||
-rwxr-xr-x | chrome/tools/build/win/create_installer_archive.py | 5 |
11 files changed, 270 insertions, 61 deletions
diff --git a/chrome/chrome_installer.gypi b/chrome/chrome_installer.gypi index ad3d1ea..45bfa50 100644 --- a/chrome/chrome_installer.gypi +++ b/chrome/chrome_installer.gypi @@ -364,6 +364,7 @@ # below into a separate lib and then link both setup.exe and # setup_unittests.exe against that. 'sources': [ + 'installer/mini_installer/chrome.release', # Move to lib 'installer/mini_installer/appid.h', 'installer/mini_installer/chrome_appid.cc', 'installer/mini_installer/configuration.cc', @@ -375,17 +376,47 @@ 'installer/mini_installer/mini_string.cc', 'installer/mini_installer/mini_string.h', 'installer/mini_installer/mini_string_test.cc', - 'installer/setup/install_worker.cc', # Move to lib - 'installer/setup/install_worker.h', # Move to lib + 'installer/setup/install.cc', # Move to lib + 'installer/setup/install.h', # Move to lib + 'installer/setup/install_unittest.cc', + 'installer/setup/install_worker.cc', # Move to lib + 'installer/setup/install_worker.h', # Move to lib 'installer/setup/install_worker_unittest.cc', 'installer/setup/run_all_unittests.cc', - 'installer/setup/setup_constants.cc', # Move to lib - 'installer/setup/setup_constants.h', # Move to lib + 'installer/setup/setup_constants.cc', # Move to lib + 'installer/setup/setup_constants.h', # Move to lib 'installer/setup/setup_unittests.rc', 'installer/setup/setup_unittests_resource.h', 'installer/setup/setup_util.cc', 'installer/setup/setup_util_unittest.cc', ], + 'rules': [ + { + 'rule_name': 'server_dlls', # Move to lib + 'extension': 'release', + 'variables': { + 'scan_server_dlls_py' : 'tools/build/win/scan_server_dlls.py', + 'template_file': 'mini_installer/chrome.release', + }, + 'inputs': [ + '<(scan_server_dlls_py)', + '<(template_file)' + ], + 'outputs': [ + '<(INTERMEDIATE_DIR)/registered_dlls.h', + ], + 'action': [ + 'python', + '<(scan_server_dlls_py)', + '--output_dir=<(PRODUCT_DIR)', + '--input_file=<(RULE_INPUT_PATH)', + '--header_output_dir=<(INTERMEDIATE_DIR)', + # TODO(sgk): may just use environment variables + #'--distribution=$(CHROMIUM_BUILD)', + '--distribution=_google_chrome', + ], + }, + ], }, ], }], diff --git a/chrome/installer/mini_installer/chrome.release b/chrome/installer/mini_installer/chrome.release index 79ea146..af0e53c 100644 --- a/chrome/installer/mini_installer/chrome.release +++ b/chrome/installer/mini_installer/chrome.release @@ -5,7 +5,6 @@ [GENERAL] chrome.exe: %(ChromeDir)s\ wow_helper.exe: %(ChromeDir)s\ -Dictionaries\en-US.bdic: %(ChromeDir)s\Dictionaries chrome.dll: %(VersionDir)s\ nacl64.exe: %(VersionDir)s\ ppGoogleNaClPluginChrome.dll: %(VersionDir)s\ @@ -40,15 +39,18 @@ ui_resources_2x.pak: %(VersionDir)s\ theme_resources_touch_1x.pak: %(VersionDir)s\ [GOOGLE_CHROME] -splash-620x300.png: %(ChromeDir)s\ -Logo.png: %(ChromeDir)s\ -SmallLogo.png: %(ChromeDir)s\ -VisualElementsManifest.xml: %(ChromeDir)s\ +FlashPlayerApp.exe: %(VersionDir)s\ +FlashPlayerCPLApp.cpl: %(VersionDir)s\ delegate_execute.exe: %(VersionDir)s\ gcswf32.dll: %(VersionDir)s\ metro_driver.dll: %(VersionDir)s\ plugin.vch: %(VersionDir)s\ -FlashPlayerApp.exe: %(VersionDir)s\ -FlashPlayerCPLApp.cpl: %(VersionDir)s\ PepperFlash\pepflashplayer.dll: %(VersionDir)s\PepperFlash\ PepperFlash\manifest.json: %(VersionDir)s\PepperFlash\ +# All or none of the following 3 files need to be present as the creation of +# VisualElementsManifest.xml is based on the existence of +# %(VersionDir)\VisualElements. On a similar note, no other files should be +# packaged in this directory. +Logo.png: %(VersionDir)s\VisualElements\ +SmallLogo.png: %(VersionDir)s\VisualElements\ +splash-620x300.png: %(VersionDir)s\VisualElements\ diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc index 2ceac7d..375b2ec 100644 --- a/chrome/installer/setup/install.cc +++ b/chrome/installer/setup/install.cc @@ -6,7 +6,6 @@ #include <shlobj.h> #include <time.h> -#include <vector> #include "base/command_line.h" #include "base/file_path.h" @@ -14,7 +13,9 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/path_service.h" +#include "base/string16.h" #include "base/string_util.h" +#include "base/stringprintf.h" #include "base/utf_string_conversions.h" #include "base/win/windows_version.h" #include "chrome/common/chrome_constants.h" @@ -31,10 +32,8 @@ #include "chrome/installer/util/installer_state.h" #include "chrome/installer/util/master_preferences.h" #include "chrome/installer/util/master_preferences_constants.h" -#include "chrome/installer/util/product.h" #include "chrome/installer/util/set_reg_value_work_item.h" #include "chrome/installer/util/shell_util.h" -#include "chrome/installer/util/util_constants.h" #include "chrome/installer/util/work_item_list.h" // Build-time generated include file. @@ -353,6 +352,73 @@ installer::InstallStatus InstallNewVersion( namespace installer { +void EscapeXmlAttributeValueInSingleQuotes(string16* att_value) { + ReplaceChars(*att_value, L"&", L"&", att_value); + ReplaceChars(*att_value, L"'", L"'", att_value); + ReplaceChars(*att_value, L"<", L"<", att_value); +} + +bool CreateVisualElementsManifest(const FilePath& src_path, + const Version& version) { + // Construct the relative path to the versioned VisualElements directory. + string16 elements_dir(ASCIIToUTF16(version.GetString())); + elements_dir.push_back(FilePath::kSeparators[0]); + elements_dir.append(installer::kVisualElements); + + // Some distributions of Chromium may not include visual elements. Only + // proceed if this distribution does. + if (!file_util::PathExists(src_path.Append(elements_dir))) { + VLOG(1) << "No visual elements found, not writing " + << installer::kVisualElementsManifest << " to " << src_path.value(); + return true; + } else { + // A printf_p-style format string for generating the visual elements + // manifest. Required arguments, in order, are: + // - Localized display name for the product. + // - Relative path to the VisualElements directory. + static const char kManifestTemplate[] = + "<Application>\r\n" + " <VisualElements\r\n" + " DisplayName='%1$ls'\r\n" + " Logo='%2$ls\\Logo.png'\r\n" + " SmallLogo='%2$ls\\SmallLogo.png'\r\n" + " ForegroundText='light'\r\n" + " BackgroundColor='white'>\r\n" + " <DefaultTile ShowName='allLogos'/>\r\n" + " <SplashScreen Image='%2$ls\\splash-620x300.png'/>\r\n" + " </VisualElements>\r\n" + "</Application>"; + + const string16 manifest_template(ASCIIToUTF16(kManifestTemplate)); + + BrowserDistribution* dist = BrowserDistribution::GetSpecificDistribution( + BrowserDistribution::CHROME_BROWSER); + // TODO(grt): http://crbug.com/75152 Write a reference to a localized + // resource for |display_name|. + string16 display_name(dist->GetAppShortCutName()); + EscapeXmlAttributeValueInSingleQuotes(&display_name); + + // Fill the manifest with the desired values. + string16 manifest16(base::StringPrintf(manifest_template.c_str(), + display_name.c_str(), + elements_dir.c_str())); + + // Write the manifest to |src_path|. + const std::string manifest(UTF16ToUTF8(manifest16)); + if (file_util::WriteFile( + src_path.Append(installer::kVisualElementsManifest), + manifest.c_str(), manifest.size())) { + VLOG(1) << "Successfully wrote " << installer::kVisualElementsManifest + << " to " << src_path.value(); + return true; + } else { + PLOG(ERROR) << "Error writing " << installer::kVisualElementsManifest + << " to " << src_path.value(); + return false; + } + } +} + InstallStatus InstallOrUpdateProduct( const InstallationState& original_state, const InstallerState& installer_state, @@ -377,6 +443,12 @@ InstallStatus InstallOrUpdateProduct( } } + // Create VisualElementManifest.xml in |src_path| (if required) so that it + // looks as if it had been extracted from the archive when calling + // InstallNewVersion() below. + installer_state.UpdateStage(installer::CREATING_VISUAL_MANIFEST); + CreateVisualElementsManifest(src_path, new_version); + scoped_ptr<Version> existing_version; InstallStatus result = InstallNewVersion(original_state, installer_state, setup_path, archive_path, src_path, install_temp_path, new_version, diff --git a/chrome/installer/setup/install.h b/chrome/installer/setup/install.h index 370c51e..5305f55b 100644 --- a/chrome/installer/setup/install.h +++ b/chrome/installer/setup/install.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. // @@ -23,6 +23,17 @@ class InstallationState; class InstallerState; class MasterPreferences; +// Escape |att_value| as per the XML AttValue production +// (http://www.w3.org/TR/2008/REC-xml-20081126/#NT-AttValue) for a value in +// single quotes. +void EscapeXmlAttributeValueInSingleQuotes(string16* att_value); + +// Creates VisualElementsManifest.xml beside chrome.exe in |src_path| if +// |src_path|\VisualElements exists. +// Returns true unless the manifest is supposed to be created, but fails to be. +bool CreateVisualElementsManifest(const FilePath& src_path, + const Version& version); + // This function installs or updates a new version of Chrome. It returns // install status (failed, new_install, updated etc). // diff --git a/chrome/installer/setup/install_unittest.cc b/chrome/installer/setup/install_unittest.cc new file mode 100644 index 0000000..8d4606f --- /dev/null +++ b/chrome/installer/setup/install_unittest.cc @@ -0,0 +1,104 @@ +// Copyright (c) 2012 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. + +#include <string> + +#include "base/file_util.h" +#include "base/platform_file.h" +#include "base/scoped_temp_dir.h" +#include "base/string16.h" +#include "base/utf_string_conversions.h" +#include "base/version.h" +#include "chrome/installer/setup/install.h" +#include "chrome/installer/setup/setup_constants.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace { + +class CreateVisualElementsManifestTest : public testing::Test { + protected: + virtual void SetUp() OVERRIDE { + // Create a temp directory for testing. + ASSERT_TRUE(test_dir_.CreateUniqueTempDir()); + + version_ = Version("0.0.0.0"); + + version_dir_ = test_dir_.path().AppendASCII(version_.GetString()); + ASSERT_TRUE(file_util::CreateDirectory(version_dir_)); + + manifest_path_ = + test_dir_.path().Append(installer::kVisualElementsManifest); + } + + virtual void TearDown() OVERRIDE { + // Clean up test directory manually so we can fail if it leaks. + ASSERT_TRUE(test_dir_.Delete()); + } + + // The temporary directory used to contain the test operations. + ScopedTempDir test_dir_; + + // A dummy version number used to create the version directory. + Version version_; + + // The path to |test_dir_|\|version_|. + FilePath version_dir_; + + // The path to VisualElementsManifest.xml. + FilePath manifest_path_; +}; + +} // namespace + +// Test that VisualElementsManifest.xml is not created when VisualElements are +// not present. +TEST_F(CreateVisualElementsManifestTest, VisualElementsManifestNotCreated) { + ASSERT_TRUE( + installer::CreateVisualElementsManifest(test_dir_.path(), version_)); + ASSERT_FALSE(file_util::PathExists(manifest_path_)); +} + +// Test that VisualElementsManifest.xml is created with the correct content when +// VisualElements are present. +TEST_F(CreateVisualElementsManifestTest, VisualElementsManifestCreated) { + ASSERT_TRUE(file_util::CreateDirectory( + version_dir_.Append(installer::kVisualElements))); + ASSERT_TRUE( + installer::CreateVisualElementsManifest(test_dir_.path(), version_)); + ASSERT_TRUE(file_util::PathExists(manifest_path_)); + + std::string read_manifest; + ASSERT_TRUE(file_util::ReadFileToString(manifest_path_, &read_manifest)); + + static const char kExpectedManifest[] = + "<Application>\r\n" + " <VisualElements\r\n" + " DisplayName='Google Chrome'\r\n" + " Logo='0.0.0.0\\VisualElements\\Logo.png'\r\n" + " SmallLogo='0.0.0.0\\VisualElements\\SmallLogo.png'\r\n" + " ForegroundText='light'\r\n" + " BackgroundColor='white'>\r\n" + " <DefaultTile ShowName='allLogos'/>\r\n" + " <SplashScreen Image='0.0.0.0\\VisualElements\\splash-620x300.png'/>" + "\r\n" + " </VisualElements>\r\n" + "</Application>"; + + ASSERT_STREQ(kExpectedManifest, read_manifest.c_str()); +} + +TEST(EscapeXmlAttributeValueTest, EscapeCrazyValue) { + string16 val(L"This has 'crazy' \"chars\" && < and > signs."); + static const wchar_t kExpectedEscapedVal[] = + L"This has 'crazy' \"chars\" && < and > signs."; + installer::EscapeXmlAttributeValueInSingleQuotes(&val); + ASSERT_STREQ(kExpectedEscapedVal, val.c_str()); +} + +TEST(EscapeXmlAttributeValueTest, DontEscapeNormalValue) { + string16 val(L"Google Chrome"); + static const wchar_t kExpectedEscapedVal[] = L"Google Chrome"; + installer::EscapeXmlAttributeValueInSingleQuotes(&val); + ASSERT_STREQ(kExpectedEscapedVal, val.c_str()); +} diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc index cd17fee..74d9a8f 100644 --- a/chrome/installer/setup/install_worker.cc +++ b/chrome/installer/setup/install_worker.cc @@ -10,6 +10,7 @@ #include <oaidl.h> #include <shlobj.h> #include <time.h> + #include <vector> #include "base/command_line.h" @@ -775,35 +776,22 @@ void AddInstallWorkItems(const InstallationState& original_state, WorkItem::ALWAYS_MOVE); } - if (base::win::GetVersion() >= base::win::VERSION_WIN8) { - // Desktop only (i.e. not supporting Metro) versions of Chromium do not have - // to include visual elements. - scoped_ptr<WorkItemList> win8_work_items( - WorkItem::CreateConditionalWorkItemList(new ConditionRunIfFileExists( - src_path.Append(L"visualelementsmanifest.xml")))); - // TODO (gab): All of these hard-coded strings are temporary and will be - // deleted in the patch following this one. - win8_work_items->AddMoveTreeWorkItem( - src_path.Append(L"visualelementsmanifest.xml").value(), - target_path.Append(L"visualelementsmanifest.xml").value(), - temp_path.value(), - WorkItem::ALWAYS_MOVE); - win8_work_items->AddMoveTreeWorkItem( - src_path.Append(L"logo.png").value(), - target_path.Append(L"logo.png").value(), - temp_path.value(), - WorkItem::ALWAYS_MOVE); - win8_work_items->AddMoveTreeWorkItem( - src_path.Append(L"smalllogo.png").value(), - target_path.Append(L"smalllogo.png").value(), - temp_path.value(), - WorkItem::ALWAYS_MOVE); - win8_work_items->AddMoveTreeWorkItem( - src_path.Append(L"splash-620x300.png").value(), - target_path.Append(L"splash-620x300.png").value(), + // Install kVisualElementsManifest if it is present in |src_path|. No need to + // make this a conditional work item as if the file is not there now, it will + // never be. + if (file_util::PathExists( + src_path.Append(installer::kVisualElementsManifest))) { + install_list->AddMoveTreeWorkItem( + src_path.Append(installer::kVisualElementsManifest).value(), + target_path.Append(installer::kVisualElementsManifest).value(), temp_path.value(), WorkItem::ALWAYS_MOVE); - install_list->AddWorkItem(win8_work_items.release()); + } else { + // We do not want to have an old VisualElementsManifest pointing to an old + // version directory. Delete it as there wasn't a new one to replace it. + install_list->AddDeleteTreeWorkItem( + target_path.Append(installer::kVisualElementsManifest), + temp_path); } // In the past, we copied rather than moved for system level installs so that @@ -822,14 +810,6 @@ void AddInstallWorkItems(const InstallationState& original_state, check_for_duplicates ? WorkItem::CHECK_DUPLICATES : WorkItem::ALWAYS_MOVE); - // Copy the default Dictionaries only if the folder doesn't exist already. - // TODO(grt): Use AddMoveTreeWorkItem in a conditional WorkItemList, which - // will be more efficient in space and time. - install_list->AddCopyTreeWorkItem( - src_path.Append(installer::kDictionaries).value(), - target_path.Append(installer::kDictionaries).value(), - temp_path.value(), WorkItem::IF_NOT_PRESENT); - // Delete any old_chrome.exe if present (ignore failure if it's in use). install_list->AddDeleteTreeWorkItem( target_path.Append(installer::kChromeOldExe), temp_path) diff --git a/chrome/installer/setup/setup_constants.cc b/chrome/installer/setup/setup_constants.cc index 76f08bf..77c03a6 100644 --- a/chrome/installer/setup/setup_constants.cc +++ b/chrome/installer/setup/setup_constants.cc @@ -1,15 +1,17 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. #include "chrome/installer/setup/setup_constants.h" namespace installer { -// Elements that makes up install target path. -const wchar_t kWowHelperExe[] = L"wow_helper.exe"; -const wchar_t kDictionaries[] = L"Dictionaries"; + +// Elements that make up install paths. const wchar_t kChromeArchive[] = L"chrome.7z"; const wchar_t kChromeCompressedArchive[] = L"chrome.packed.7z"; +const wchar_t kVisualElements[] = L"VisualElements"; +const wchar_t kVisualElementsManifest[] = L"VisualElementsManifest.xml"; +const wchar_t kWowHelperExe[] = L"wow_helper.exe"; // Sub directory of install source package under install temporary directory. const wchar_t kInstallSourceDir[] = L"source"; @@ -17,4 +19,5 @@ const wchar_t kInstallSourceChromeDir[] = L"Chrome-bin"; const wchar_t kMediaPlayerRegPath[] = L"Software\\Microsoft\\MediaPlayer\\ShimInclusionList"; + } // namespace installer diff --git a/chrome/installer/setup/setup_constants.h b/chrome/installer/setup/setup_constants.h index aa15381..0c17223 100644 --- a/chrome/installer/setup/setup_constants.h +++ b/chrome/installer/setup/setup_constants.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -10,15 +10,17 @@ namespace installer { -extern const wchar_t kWowHelperExe[]; -extern const wchar_t kDictionaries[]; extern const wchar_t kChromeArchive[]; extern const wchar_t kChromeCompressedArchive[]; +extern const wchar_t kVisualElements[]; +extern const wchar_t kVisualElementsManifest[]; +extern const wchar_t kWowHelperExe[]; extern const wchar_t kInstallSourceDir[]; extern const wchar_t kInstallSourceChromeDir[]; extern const wchar_t kMediaPlayerRegPath[]; + } // namespace installer #endif // CHROME_INSTALLER_SETUP_SETUP_CONSTANTS_H__ diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc index 1ea8785..5f4e238 100644 --- a/chrome/installer/util/install_util.cc +++ b/chrome/installer/util/install_util.cc @@ -52,6 +52,7 @@ const wchar_t kStageRollingback[] = L"rollingback"; const wchar_t kStageUncompressing[] = L"uncompressing"; const wchar_t kStageUnpacking[] = L"unpacking"; const wchar_t kStageUpdatingChannels[] = L"updating_channels"; +const wchar_t kStageCreatingVisualManifest[] = L"creating_visual_manifest"; const wchar_t* const kStages[] = { NULL, @@ -71,6 +72,7 @@ const wchar_t* const kStages[] = { kStageRemovingOldVersions, kStageFinishing, kStageConfiguringAutoLaunch, + kStageCreatingVisualManifest, }; COMPILE_ASSERT(installer::NUM_STAGES == arraysize(kStages), diff --git a/chrome/installer/util/util_constants.h b/chrome/installer/util/util_constants.h index fc8f7b2..402cfe3 100644 --- a/chrome/installer/util/util_constants.h +++ b/chrome/installer/util/util_constants.h @@ -113,12 +113,13 @@ enum InstallerStage { REMOVING_OLD_VERSIONS, // 14: Deleting old version directories. FINISHING, // 15: Finishing the install. CONFIGURE_AUTO_LAUNCH, // 16: Configuring Chrome to auto-launch. - NUM_STAGES // 17: The number of stages. + CREATING_VISUAL_MANIFEST, // 17: Creating VisualElementsManifest.xml + NUM_STAGES // 18: The number of stages. }; // When we start reporting the numerical values from the enum, the order // above MUST be preserved. -COMPILE_ASSERT(CONFIGURE_AUTO_LAUNCH == 16, +COMPILE_ASSERT(CREATING_VISUAL_MANIFEST == 17, never_ever_ever_change_InstallerStage_values_bang); namespace switches { diff --git a/chrome/tools/build/win/create_installer_archive.py b/chrome/tools/build/win/create_installer_archive.py index cab244c..78bc63b9 100755 --- a/chrome/tools/build/win/create_installer_archive.py +++ b/chrome/tools/build/win/create_installer_archive.py @@ -117,9 +117,10 @@ def CopySectionFilesToStagingDir(config, section, staging_dir, build_dir): continue dst = os.path.join(staging_dir, config.get(section, option)) - if not os.path.exists(dst): + files = glob.glob(os.path.join(build_dir, option)) + if len(files) > 0 and not os.path.exists(dst): os.makedirs(dst) - for file in glob.glob(os.path.join(build_dir, option)): + for file in files: dst_file = os.path.join(dst, os.path.basename(file)) if not os.path.exists(dst_file): shutil.copy(file, dst) |