Commit d33d0b27 authored by grt@chromium.org's avatar grt@chromium.org

mini_installer code cleanups (no functional changes).

- Move constants into *_constants.{cc,h}.
- Remove unused constants.
- Lay foundation for detailed process exit codes.

BUG=385419

Review URL: https://codereview.chromium.org/365143002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282032 0039d316-1c4b-4281-b951-d872f2087c98
parent cb9354f9
......@@ -39,10 +39,12 @@
'mini_installer/configuration.h',
'mini_installer/decompress.cc',
'mini_installer/decompress.h',
'mini_installer/exit_code.h',
'mini_installer/mini_installer.cc',
'mini_installer/mini_installer.h',
'mini_installer/mini_installer.ico',
'mini_installer/mini_installer.rc',
'mini_installer/mini_installer_constants.cc',
'mini_installer/mini_installer_constants.h',
'mini_installer/mini_installer_exe_version.rc.version',
'mini_installer/mini_installer_resource.h',
'mini_installer/mini_string.cc',
......
......@@ -22,10 +22,12 @@
'mini_installer/configuration.h',
'mini_installer/decompress.cc',
'mini_installer/decompress.h',
'mini_installer/exit_code.h',
'mini_installer/mini_installer.cc',
'mini_installer/mini_installer.h',
'mini_installer/mini_installer.ico',
'mini_installer/mini_installer.rc',
'mini_installer/mini_installer_constants.cc',
'mini_installer/mini_installer_constants.h',
'mini_installer/mini_installer_exe_version.rc.version',
'mini_installer/mini_installer_resource.h',
'mini_installer/mini_string.cc',
......
// Copyright 2014 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.
#ifndef CHROME_INSTALLER_MINI_INSTALLER_EXIT_CODE_H_
#define CHROME_INSTALLER_MINI_INSTALLER_EXIT_CODE_H_
namespace mini_installer {
// mini_installer process exit codes (the underlying type is uint32_t).
enum ExitCode {
SUCCESS_EXIT_CODE = 0,
GENERIC_ERROR = 1,
// The next three generic values are here for historic reasons. New additions
// should have values strictly greater than them. This is to prevent
// collisions with setup.exe's installer::InstallStatus enum since the two are
// surfaced similarly by Google Update.
GENERIC_INITIALIZATION_FAILURE = 101,
GENERIC_UNPACKING_FAILURE = 102,
GENERIC_SETUP_FAILURE = 103,
};
} // namespace mini_installer
#endif // CHROME_INSTALLER_MINI_INSTALLER_EXIT_CODE_H_
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Copyright 2014 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.
#ifndef CHROME_INSTALLER_MINI_INSTALLER_MINI_INSTALLER_H_
#define CHROME_INSTALLER_MINI_INSTALLER_MINI_INSTALLER_H_
#include "chrome/installer/mini_installer/mini_installer_constants.h"
namespace mini_installer {
// Various filenames
const wchar_t kSetupName[] = L"setup.exe";
const wchar_t kChromePrefix[] = L"chrome";
// Various filenames and prefixes.
// The target name of the installer extracted from resources.
const wchar_t kSetupExe[] = L"setup.exe";
// The prefix of the chrome archive resource.
const wchar_t kChromeArchivePrefix[] = L"chrome";
// The prefix of the installer resource.
const wchar_t kSetupPrefix[] = L"setup";
// setup.exe command line arguments
const wchar_t kCmdInstallArchive[] = L" --install-archive";
const wchar_t kCmdUpdateSetupExe[] = L" --update-setup-exe";
const wchar_t kCmdNewSetupExe[] = L" --new-setup-exe";
// Command line switch names for setup.exe.
const wchar_t kCmdInstallArchive[] = L"install-archive";
const wchar_t kCmdUpdateSetupExe[] = L"update-setup-exe";
const wchar_t kCmdNewSetupExe[] = L"new-setup-exe";
// Temp directory prefix that this process creates
// Temp directory prefix that this process creates.
const wchar_t kTempPrefix[] = L"CR_";
// Google Update will use the full installer if this suffix is found in the ap
// value.
// ap value suffix to force subsequent updates to use the full rather than
// differential updater.
const wchar_t kFullInstallerSuffix[] = L"-full";
// ap value tag for a multi-install product.
const wchar_t kMultiInstallTag[] = L"-multi";
// The resource types that would be unpacked from the mini installer.
// 'BN' is uncompressed binary and 'BL' is LZ compressed binary.
// Uncompressed binary.
const wchar_t kBinResourceType[] = L"BN";
// LZ compressed binary.
const wchar_t kLZCResourceType[] = L"BL";
// 7zip archive.
const wchar_t kLZMAResourceType[] = L"B7";
// Registry key to get uninstall command
const wchar_t kApRegistryValueName[] = L"ap";
// Registry key that tells Chrome installer not to delete extracted files.
const wchar_t kCleanupRegistryValueName[] = L"ChromeInstallerCleanup";
// Registry key to get uninstall command
const wchar_t kUninstallRegistryValueName[] = L"UninstallString";
// Registry value names.
// The name of an app's Client State registry value that holds its tag/channel.
const wchar_t kApRegistryValue[] = L"ap";
// The name of the value in kCleanupRegistryKey that tells the installer not to
// delete extracted files.
const wchar_t kCleanupRegistryValue[] = L"ChromeInstallerCleanup";
// The name of an app's Client State registry value that holds the path to its
// uninstaller.
const wchar_t kUninstallRegistryValue[] = L"UninstallString";
// Paths for the above registry keys
// Registry key paths.
#if defined(GOOGLE_CHROME_BUILD)
// The concatenation of this plus the Google Update GUID is the app registry
// key.
const wchar_t kApRegistryKeyBase[] = L"Software\\Google\\Update\\ClientState\\";
const wchar_t kUninstallRegistryKey[] =
// The path to the key containing each app's Client State registry key.
const wchar_t kClientStateKeyBase[] =
L"Software\\Google\\Update\\ClientState\\";
// The path to the key in which kCleanupRegistryValue is found.
const wchar_t kCleanupRegistryKey[] =
L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Google Chrome";
const wchar_t kCleanupRegistryKey[] = L"Software\\Google";
#else
const wchar_t kApRegistryKeyBase[] = L"Software\\Chromium";
const wchar_t kUninstallRegistryKey[] =
L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Chromium";
// The path to the key containing each app's Client State registry key.
const wchar_t kClientStateKeyBase[] = L"Software\\Chromium";
// The path to the key in which kCleanupRegistryValue is found.
const wchar_t kCleanupRegistryKey[] = L"Software\\Chromium";
#endif
// One gigabyte is the biggest resource size that it can handle.
const int kMaxResourceSize = 1024*1024*1024;
// This is the file that contains the list of files to be linked in the
// executable. This file is updated by the installer generator tool chain.
const wchar_t kManifestFilename[] = L"packed_files.txt";
const size_t kMaxResourceSize = 1024*1024*1024;
} // namespace mini_installer
#endif // CHROME_INSTALLER_MINI_INSTALLER_MINI_INSTALLER_H_
// Copyright 2014 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.
#ifndef CHROME_INSTALLER_MINI_INSTALLER_MINI_INSTALLER_CONSTANTS_H_
#define CHROME_INSTALLER_MINI_INSTALLER_MINI_INSTALLER_CONSTANTS_H_
namespace mini_installer {
// Various filenames and prefixes.
extern const wchar_t kSetupExe[];
extern const wchar_t kChromeArchivePrefix[];
extern const wchar_t kSetupPrefix[];
// Unprefixed command line switch names for setup.exe.
extern const wchar_t kCmdInstallArchive[];
extern const wchar_t kCmdUpdateSetupExe[];
extern const wchar_t kCmdNewSetupExe[];
extern const wchar_t kTempPrefix[];
extern const wchar_t kFullInstallerSuffix[];
extern const wchar_t kMultiInstallTag[];
// The resource types that would be unpacked from the mini installer.
extern const wchar_t kBinResourceType[];
extern const wchar_t kLZCResourceType[];
extern const wchar_t kLZMAResourceType[];
// Registry value names.
extern const wchar_t kApRegistryValue[];
extern const wchar_t kCleanupRegistryValue[];
extern const wchar_t kUninstallRegistryValue[];
// Registry key paths.
extern const wchar_t kClientStateKeyBase[];
extern const wchar_t kCleanupRegistryKey[];
extern const size_t kMaxResourceSize;
} // namespace mini_installer
#endif // CHROME_INSTALLER_MINI_INSTALLER_MINI_INSTALLER_CONSTANTS_H_
......@@ -254,7 +254,7 @@ def IsComponentBuild(mini_installer_path):
query_command = mini_installer_path + ' --query-component-build'
script_dir = os.path.dirname(os.path.abspath(__file__))
exit_status = subprocess.call(query_command, shell=True, cwd=script_dir)
return exit_status != 0
return exit_status == 0
def main():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment