Commit 1b7cc341 authored by S. Ganesh's avatar S. Ganesh Committed by Commit Bot

Reland "Elevation Service setup and COM registration."

This is a reland of f4c67a89

Original change's description:
> Elevation Service setup and COM registration.
> 
> Bug: 833687
> Change-Id: I1fef2e5ebac7ed44975996d67a43d1e26dc8ccb0
> Reviewed-on: https://chromium-review.googlesource.com/c/1244555
> Commit-Queue: S. Ganesh <ganesh@chromium.org>
> Reviewed-by: Greg Thompson <grt@chromium.org>
> Reviewed-by: Sorin Jianu <sorin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#598170}

Bug: 833687
Change-Id: I62ebfbc4a4992ddf0374a3be2432a7970ac4aaff
Reviewed-on: https://chromium-review.googlesource.com/c/1274835Reviewed-by: default avatarGreg Thompson <grt@chromium.org>
Commit-Queue: S. Ganesh <ganesh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#598746}
parent 70387588
...@@ -65,13 +65,17 @@ struct InstallConstants { ...@@ -65,13 +65,17 @@ struct InstallConstants {
// name registered with Default Programs on Windows. // name registered with Default Programs on Windows.
const wchar_t* base_app_name; const wchar_t* base_app_name;
// The unsuffixed portion of the AppUserModelId. The AppUserModelId is used to // Used for the following:
// group an app's windows together on the Windows taskbar along with its // * The unsuffixed portion of the AppUserModelId. The AppUserModelId is used
// to group an app's windows together on the Windows taskbar along with its
// corresponding shortcuts; see // corresponding shortcuts; see
// https://msdn.microsoft.com/library/windows/desktop/dd378459.aspx for more // https://msdn.microsoft.com/library/windows/desktop/dd378459.aspx for more
// information. Use ShellUtil::GetBrowserModelId to get the suffixed value -- // information. Use ShellUtil::GetBrowserModelId to get the suffixed value --
// it is almost never correct to use the unsuffixed (base) portion of this id // it is almost never correct to use the unsuffixed (base) portion of this id
// directly. // directly.
// * The prefix for the Elevation Service Name. See
// install_static::GetElevationServiceDisplayName() and
// install_static::GetElevationServiceName().
const wchar_t* base_app_id; const wchar_t* base_app_id;
// The prefix for the browser's ProgID. This prefix may be no more than 11 // The prefix for the browser's ProgID. This prefix may be no more than 11
......
...@@ -405,6 +405,18 @@ const CLSID& GetElevatorClsid() { ...@@ -405,6 +405,18 @@ const CLSID& GetElevatorClsid() {
return InstallDetails::Get().elevator_clsid(); return InstallDetails::Get().elevator_clsid();
} }
std::wstring GetElevationServiceName() {
std::wstring name = GetElevationServiceDisplayName();
name.erase(std::remove_if(name.begin(), name.end(), isspace), name.end());
return name;
}
std::wstring GetElevationServiceDisplayName() {
static constexpr wchar_t kElevationServiceDisplayName[] =
L" Elevation Service";
return GetBaseAppName() + kElevationServiceDisplayName;
}
std::wstring GetBaseAppName() { std::wstring GetBaseAppName() {
return InstallDetails::Get().mode().base_app_name; return InstallDetails::Get().mode().base_app_name;
} }
......
...@@ -109,8 +109,10 @@ const wchar_t* GetAppGuid(); ...@@ -109,8 +109,10 @@ const wchar_t* GetAppGuid();
// the Windows OS. // the Windows OS.
const CLSID& GetToastActivatorClsid(); const CLSID& GetToastActivatorClsid();
// The CLSID of the COM server that provides silent elevation functionality. // Return the Elevation Service CLSID, Name, and Display Name respectively.
const CLSID& GetElevatorClsid(); const CLSID& GetElevatorClsid();
std::wstring GetElevationServiceName();
std::wstring GetElevationServiceDisplayName();
// Returns the unsuffixed application name of this program. This is the base of // Returns the unsuffixed application name of this program. This is the base of
// the name registered with Default Programs. IMPORTANT: This must only be // the name registered with Default Programs. IMPORTANT: This must only be
......
...@@ -23,6 +23,7 @@ chrome_child.dll: %(VersionDir)s\ ...@@ -23,6 +23,7 @@ chrome_child.dll: %(VersionDir)s\
chrome_elf.dll: %(VersionDir)s\ chrome_elf.dll: %(VersionDir)s\
chrome_watcher.dll: %(VersionDir)s\ chrome_watcher.dll: %(VersionDir)s\
d3dcompiler_47.dll: %(VersionDir)s\ d3dcompiler_47.dll: %(VersionDir)s\
elevation_service.exe: %(VersionDir)s\
eventlog_provider.dll: %(VersionDir)s\ eventlog_provider.dll: %(VersionDir)s\
ffmpeg.dll: %(VersionDir)s\ ffmpeg.dll: %(VersionDir)s\
icudt.dll: %(VersionDir)s\ icudt.dll: %(VersionDir)s\
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "chrome/installer/setup/install_service_work_item.h" #include "chrome/installer/setup/install_service_work_item.h"
#include "base/command_line.h"
#include "chrome/installer/setup/install_service_work_item_impl.h" #include "chrome/installer/setup/install_service_work_item_impl.h"
namespace installer { namespace installer {
...@@ -11,7 +12,7 @@ namespace installer { ...@@ -11,7 +12,7 @@ namespace installer {
InstallServiceWorkItem::InstallServiceWorkItem( InstallServiceWorkItem::InstallServiceWorkItem(
const base::string16& service_name, const base::string16& service_name,
const base::string16& display_name, const base::string16& display_name,
const base::string16& service_cmd_line) const base::CommandLine& service_cmd_line)
: impl_(std::make_unique<InstallServiceWorkItemImpl>(service_name, : impl_(std::make_unique<InstallServiceWorkItemImpl>(service_name,
display_name, display_name,
service_cmd_line)) {} service_cmd_line)) {}
...@@ -26,4 +27,12 @@ void InstallServiceWorkItem::RollbackImpl() { ...@@ -26,4 +27,12 @@ void InstallServiceWorkItem::RollbackImpl() {
impl_->RollbackImpl(); impl_->RollbackImpl();
} }
// static
bool InstallServiceWorkItem::DeleteService(const base::string16& service_name) {
return InstallServiceWorkItemImpl(
service_name, base::string16(),
base::CommandLine(base::CommandLine::NO_PROGRAM))
.DeleteServiceImpl();
}
} // namespace installer } // namespace installer
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "chrome/installer/util/work_item.h" #include "chrome/installer/util/work_item.h"
namespace base {
class CommandLine;
} // namespace base
namespace installer { namespace installer {
class InstallServiceWorkItemImpl; class InstallServiceWorkItemImpl;
...@@ -38,10 +42,12 @@ class InstallServiceWorkItem : public WorkItem { ...@@ -38,10 +42,12 @@ class InstallServiceWorkItem : public WorkItem {
// "C:\Program Files (x86)\Google\Chrome\ElevationService.exe" /svc // "C:\Program Files (x86)\Google\Chrome\ElevationService.exe" /svc
InstallServiceWorkItem(const base::string16& service_name, InstallServiceWorkItem(const base::string16& service_name,
const base::string16& display_name, const base::string16& display_name,
const base::string16& service_cmd_line); const base::CommandLine& service_cmd_line);
~InstallServiceWorkItem() override; ~InstallServiceWorkItem() override;
static bool DeleteService(const base::string16& service_name);
private: private:
friend class InstallServiceWorkItemTest; friend class InstallServiceWorkItemTest;
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <memory> #include <memory>
#include <utility> #include <utility>
#include "base/command_line.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/time/time.h" #include "base/time/time.h"
...@@ -59,10 +60,10 @@ InstallServiceWorkItemImpl::ServiceConfig::~ServiceConfig() = default; ...@@ -59,10 +60,10 @@ InstallServiceWorkItemImpl::ServiceConfig::~ServiceConfig() = default;
InstallServiceWorkItemImpl::InstallServiceWorkItemImpl( InstallServiceWorkItemImpl::InstallServiceWorkItemImpl(
const base::string16& service_name, const base::string16& service_name,
const base::string16& display_name, const base::string16& display_name,
const base::string16& service_cmd_line) const base::CommandLine& service_cmd_line)
: service_name_(service_name), : service_name_(service_name),
display_name_(display_name), display_name_(display_name),
service_cmd_line_(service_cmd_line), service_cmd_line_(service_cmd_line.GetCommandLineString()),
rollback_existing_service_(false), rollback_existing_service_(false),
rollback_new_service_(false), rollback_new_service_(false),
original_service_still_exists_(false) {} original_service_still_exists_(false) {}
...@@ -140,6 +141,34 @@ void InstallServiceWorkItemImpl::RollbackImpl() { ...@@ -140,6 +141,34 @@ void InstallServiceWorkItemImpl::RollbackImpl() {
LOG_IF(WARNING, !ReinstallOriginalService()); LOG_IF(WARNING, !ReinstallOriginalService());
} }
bool InstallServiceWorkItemImpl::DeleteServiceImpl() {
scm_.Set(::OpenSCManager(nullptr, nullptr, SC_MANAGER_CONNECT));
if (!scm_.IsValid()) {
DPLOG(ERROR) << "::OpenSCManager Failed";
return false;
}
if (!OpenService())
return false;
if (!DeleteCurrentService())
return false;
// If the service cannot be deleted, the service name value is not deleted.
// This is to allow for identifying that an existing instance of the service
// is still installed when a future install or upgrade runs.
base::win::RegKey key;
auto result = key.Open(HKEY_LOCAL_MACHINE,
install_static::GetClientStateKeyPath().c_str(),
KEY_SET_VALUE | KEY_WOW64_32KEY);
if (result != ERROR_SUCCESS)
return result == ERROR_FILE_NOT_FOUND || result == ERROR_PATH_NOT_FOUND;
result = key.DeleteValue(service_name_.c_str());
return result == ERROR_SUCCESS || result == ERROR_FILE_NOT_FOUND ||
result == ERROR_PATH_NOT_FOUND;
}
bool InstallServiceWorkItemImpl::IsServiceCorrectlyConfigured( bool InstallServiceWorkItemImpl::IsServiceCorrectlyConfigured(
const ServiceConfig& config) { const ServiceConfig& config) {
return config.type == kServiceType && return config.type == kServiceType &&
...@@ -229,7 +258,7 @@ bool InstallServiceWorkItemImpl::SetServiceName( ...@@ -229,7 +258,7 @@ bool InstallServiceWorkItemImpl::SetServiceName(
base::string16 InstallServiceWorkItemImpl::GetCurrentServiceName() const { base::string16 InstallServiceWorkItemImpl::GetCurrentServiceName() const {
base::win::RegKey key; base::win::RegKey key;
LONG result = key.Open(HKEY_LOCAL_MACHINE, auto result = key.Open(HKEY_LOCAL_MACHINE,
install_static::GetClientStateKeyPath().c_str(), install_static::GetClientStateKeyPath().c_str(),
KEY_QUERY_VALUE | KEY_WOW64_32KEY); KEY_QUERY_VALUE | KEY_WOW64_32KEY);
if (result != ERROR_SUCCESS) if (result != ERROR_SUCCESS)
......
...@@ -13,6 +13,12 @@ ...@@ -13,6 +13,12 @@
#include "base/win/scoped_handle.h" #include "base/win/scoped_handle.h"
#include "base/win/windows_types.h" #include "base/win/windows_types.h"
namespace base {
class CommandLine;
} // namespace base
namespace installer { namespace installer {
// Helper class for the implementation of InstallServiceWorkItem. // Helper class for the implementation of InstallServiceWorkItem.
...@@ -43,12 +49,13 @@ class InstallServiceWorkItemImpl { ...@@ -43,12 +49,13 @@ class InstallServiceWorkItemImpl {
InstallServiceWorkItemImpl(const base::string16& service_name, InstallServiceWorkItemImpl(const base::string16& service_name,
const base::string16& display_name, const base::string16& display_name,
const base::string16& service_cmd_line); const base::CommandLine& service_cmd_line);
~InstallServiceWorkItemImpl(); ~InstallServiceWorkItemImpl();
bool DoImpl(); bool DoImpl();
void RollbackImpl(); void RollbackImpl();
bool DeleteServiceImpl();
// Member functions that help with service installation or upgrades. // Member functions that help with service installation or upgrades.
bool IsServiceCorrectlyConfigured(const ServiceConfig& config); bool IsServiceCorrectlyConfigured(const ServiceConfig& config);
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/win/registry.h" #include "base/win/registry.h"
#include "chrome/install_static/install_util.h" #include "chrome/install_static/install_util.h"
...@@ -20,7 +22,8 @@ namespace { ...@@ -20,7 +22,8 @@ namespace {
constexpr base::char16 kServiceName[] = L"InstallServiceWorkItemService"; constexpr base::char16 kServiceName[] = L"InstallServiceWorkItemService";
constexpr base::char16 kServiceDisplayName[] = L"InstallServiceWorkItemService"; constexpr base::char16 kServiceDisplayName[] = L"InstallServiceWorkItemService";
constexpr base::char16 kServiceCmdLine[] = L"c:\\windows\\system32\\cmd.exe"; constexpr base::FilePath::CharType kServiceProgramPath[] =
FILE_PATH_LITERAL("c:\\windows\\system32\\cmd.exe");
} // namespace } // namespace
...@@ -63,7 +66,8 @@ TEST_F(InstallServiceWorkItemTest, Do_MultiSzToVector) { ...@@ -63,7 +66,8 @@ TEST_F(InstallServiceWorkItemTest, Do_MultiSzToVector) {
TEST_F(InstallServiceWorkItemTest, Do_FreshInstall) { TEST_F(InstallServiceWorkItemTest, Do_FreshInstall) {
auto item = std::make_unique<InstallServiceWorkItem>( auto item = std::make_unique<InstallServiceWorkItem>(
kServiceName, kServiceDisplayName, kServiceCmdLine); kServiceName, kServiceDisplayName,
base::CommandLine(base::FilePath(kServiceProgramPath)));
ASSERT_TRUE(item->Do()); ASSERT_TRUE(item->Do());
EXPECT_TRUE(GetImpl(item.get())->OpenService()); EXPECT_TRUE(GetImpl(item.get())->OpenService());
...@@ -73,16 +77,30 @@ TEST_F(InstallServiceWorkItemTest, Do_FreshInstall) { ...@@ -73,16 +77,30 @@ TEST_F(InstallServiceWorkItemTest, Do_FreshInstall) {
EXPECT_FALSE(GetImpl(item.get())->OpenService()); EXPECT_FALSE(GetImpl(item.get())->OpenService());
} }
TEST_F(InstallServiceWorkItemTest, Do_FreshInstallThenDeleteService) {
auto item = std::make_unique<InstallServiceWorkItem>(
kServiceName, kServiceDisplayName,
base::CommandLine(base::FilePath(kServiceProgramPath)));
ASSERT_TRUE(item->Do());
EXPECT_TRUE(GetImpl(item.get())->OpenService());
EXPECT_TRUE(IsServiceCorrectlyConfigured(item.get()));
EXPECT_TRUE(InstallServiceWorkItem::DeleteService(kServiceName));
}
TEST_F(InstallServiceWorkItemTest, Do_UpgradeNoChanges) { TEST_F(InstallServiceWorkItemTest, Do_UpgradeNoChanges) {
auto item = std::make_unique<InstallServiceWorkItem>( auto item = std::make_unique<InstallServiceWorkItem>(
kServiceName, kServiceDisplayName, kServiceCmdLine); kServiceName, kServiceDisplayName,
base::CommandLine(base::FilePath(kServiceProgramPath)));
ASSERT_TRUE(item->Do()); ASSERT_TRUE(item->Do());
EXPECT_TRUE(IsServiceCorrectlyConfigured(item.get())); EXPECT_TRUE(IsServiceCorrectlyConfigured(item.get()));
// Same command line: // Same command line:
auto item_upgrade = std::make_unique<InstallServiceWorkItem>( auto item_upgrade = std::make_unique<InstallServiceWorkItem>(
kServiceName, kServiceDisplayName, kServiceCmdLine); kServiceName, kServiceDisplayName,
base::CommandLine(base::FilePath(kServiceProgramPath)));
EXPECT_TRUE(item_upgrade->Do()); EXPECT_TRUE(item_upgrade->Do());
item_upgrade->Rollback(); item_upgrade->Rollback();
...@@ -93,14 +111,16 @@ TEST_F(InstallServiceWorkItemTest, Do_UpgradeNoChanges) { ...@@ -93,14 +111,16 @@ TEST_F(InstallServiceWorkItemTest, Do_UpgradeNoChanges) {
TEST_F(InstallServiceWorkItemTest, Do_UpgradeChangedCmdLine) { TEST_F(InstallServiceWorkItemTest, Do_UpgradeChangedCmdLine) {
auto item = std::make_unique<InstallServiceWorkItem>( auto item = std::make_unique<InstallServiceWorkItem>(
kServiceName, kServiceDisplayName, kServiceCmdLine); kServiceName, kServiceDisplayName,
base::CommandLine(base::FilePath(kServiceProgramPath)));
ASSERT_TRUE(item->Do()); ASSERT_TRUE(item->Do());
EXPECT_TRUE(IsServiceCorrectlyConfigured(item.get())); EXPECT_TRUE(IsServiceCorrectlyConfigured(item.get()));
// New command line. // New command line.
auto item_upgrade = std::make_unique<InstallServiceWorkItem>( auto item_upgrade = std::make_unique<InstallServiceWorkItem>(
kServiceName, kServiceDisplayName, L"NewCmd.exe new cmd line"); kServiceName, kServiceDisplayName,
base::CommandLine::FromString(L"NewCmd.exe arg1 arg2"));
EXPECT_TRUE(item_upgrade->Do()); EXPECT_TRUE(item_upgrade->Do());
item_upgrade->Rollback(); item_upgrade->Rollback();
...@@ -119,7 +139,8 @@ TEST_F(InstallServiceWorkItemTest, Do_ServiceName) { ...@@ -119,7 +139,8 @@ TEST_F(InstallServiceWorkItemTest, Do_ServiceName) {
install_static::GetClientStateKeyPath().c_str(), install_static::GetClientStateKeyPath().c_str(),
KEY_WRITE | KEY_WOW64_32KEY)); KEY_WRITE | KEY_WOW64_32KEY));
auto item = std::make_unique<InstallServiceWorkItem>( auto item = std::make_unique<InstallServiceWorkItem>(
kServiceName, kServiceDisplayName, kServiceCmdLine); kServiceName, kServiceDisplayName,
base::CommandLine(base::FilePath(kServiceProgramPath)));
EXPECT_STREQ(kServiceName, EXPECT_STREQ(kServiceName,
GetImpl(item.get())->GetCurrentServiceName().c_str()); GetImpl(item.get())->GetCurrentServiceName().c_str());
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "chrome/install_static/install_details.h" #include "chrome/install_static/install_details.h"
#include "chrome/install_static/install_modes.h" #include "chrome/install_static/install_modes.h"
#include "chrome/install_static/install_util.h" #include "chrome/install_static/install_util.h"
#include "chrome/installer/setup/install_service_work_item.h"
#include "chrome/installer/setup/installer_state.h" #include "chrome/installer/setup/installer_state.h"
#include "chrome/installer/setup/setup_constants.h" #include "chrome/installer/setup/setup_constants.h"
#include "chrome/installer/setup/setup_util.h" #include "chrome/installer/setup/setup_util.h"
...@@ -429,6 +430,42 @@ void AddMigrateUsageStatsWorkItems(const InstallerState& installer_state, ...@@ -429,6 +430,42 @@ void AddMigrateUsageStatsWorkItems(const InstallerState& installer_state,
static_cast<DWORD>(consent), true); static_cast<DWORD>(consent), true);
} }
// Adds work items to register the Elevation Service with Windows. Only for
// system level installs.
void AddElevationServiceWorkItems(const base::FilePath& elevation_service_path,
WorkItemList* list) {
DCHECK(::IsUserAnAdmin());
const HKEY root = HKEY_LOCAL_MACHINE;
if (elevation_service_path.empty()) {
LOG(DFATAL) << "The path to elevation_service.exe is invalid.";
return;
}
const base::string16 clsid_reg_path = GetElevationServiceClsidRegistryPath();
const base::string16 appid_reg_path = GetElevationServiceAppidRegistryPath();
// Delete any old registrations first, taking into account 32-bit -> 64-bit or
// 64-bit -> 32-bit migration.
for (const auto& reg_path : {clsid_reg_path, appid_reg_path}) {
for (const auto& key_flag : {KEY_WOW64_32KEY, KEY_WOW64_64KEY})
list->AddDeleteRegKeyWorkItem(root, reg_path, key_flag);
}
list->AddWorkItem(new InstallServiceWorkItem(
install_static::GetElevationServiceName(),
install_static::GetElevationServiceDisplayName(),
base::CommandLine(elevation_service_path)));
list->AddCreateRegKeyWorkItem(root, clsid_reg_path, WorkItem::kWow64Default);
list->AddSetRegValueWorkItem(root, clsid_reg_path, WorkItem::kWow64Default,
L"AppID", GetElevationServiceGuid(L""), true);
list->AddCreateRegKeyWorkItem(root, appid_reg_path, WorkItem::kWow64Default);
list->AddSetRegValueWorkItem(root, appid_reg_path, WorkItem::kWow64Default,
L"LocalService",
install_static::GetElevationServiceName(), true);
}
} // namespace } // namespace
// This method adds work items to create (or update) Chrome uninstall entry in // This method adds work items to create (or update) Chrome uninstall entry in
...@@ -850,6 +887,11 @@ void AddInstallWorkItems(const InstallationState& original_state, ...@@ -850,6 +887,11 @@ void AddInstallWorkItems(const InstallationState& original_state,
installer_state.root_key(), installer_state.root_key(),
GetNotificationHelperPath(target_path, new_version), install_list); GetNotificationHelperPath(target_path, new_version), install_list);
if (installer_state.system_install()) {
AddElevationServiceWorkItems(
GetElevationServicePath(target_path, new_version), install_list);
}
InstallUtil::AddUpdateDowngradeVersionItem( InstallUtil::AddUpdateDowngradeVersionItem(
installer_state.root_key(), current_version, new_version, install_list); installer_state.root_key(), current_version, new_version, install_list);
......
...@@ -858,4 +858,25 @@ base::FilePath GetNotificationHelperPath(const base::FilePath& target_path, ...@@ -858,4 +858,25 @@ base::FilePath GetNotificationHelperPath(const base::FilePath& target_path,
.Append(kNotificationHelperExe); .Append(kNotificationHelperExe);
} }
base::FilePath GetElevationServicePath(const base::FilePath& target_path,
const base::Version& version) {
return target_path.AppendASCII(version.GetString())
.Append(kElevationServiceExe);
}
base::string16 GetElevationServiceGuid(base::StringPiece16 prefix) {
base::string16 result =
InstallUtil::String16FromGUID(install_static::GetElevatorClsid());
result.insert(0, prefix.data(), prefix.size());
return result;
}
base::string16 GetElevationServiceClsidRegistryPath() {
return GetElevationServiceGuid(L"Software\\Classes\\CLSID\\");
}
base::string16 GetElevationServiceAppidRegistryPath() {
return GetElevationServiceGuid(L"Software\\Classes\\AppID\\");
}
} // namespace installer } // namespace installer
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <stdint.h> #include <stdint.h>
#include <memory> #include <memory>
#include <string>
#include <vector> #include <vector>
#include "base/optional.h" #include "base/optional.h"
...@@ -157,6 +158,17 @@ bool StoreDMToken(const std::string& token); ...@@ -157,6 +158,17 @@ bool StoreDMToken(const std::string& token);
base::FilePath GetNotificationHelperPath(const base::FilePath& target_path, base::FilePath GetNotificationHelperPath(const base::FilePath& target_path,
const base::Version& version); const base::Version& version);
// Returns the file path to elevation_service.exe (in |version| directory).
base::FilePath GetElevationServicePath(const base::FilePath& target_path,
const base::Version& version);
// Returns the Elevation Service GUID prefixed with |prefix|.
base::string16 GetElevationServiceGuid(base::StringPiece16 prefix);
// Return the elevation service registry paths.
base::string16 GetElevationServiceClsidRegistryPath();
base::string16 GetElevationServiceAppidRegistryPath();
} // namespace installer } // namespace installer
#endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "chrome/install_static/install_util.h" #include "chrome/install_static/install_util.h"
#include "chrome/installer/setup/brand_behaviors.h" #include "chrome/installer/setup/brand_behaviors.h"
#include "chrome/installer/setup/install.h" #include "chrome/installer/setup/install.h"
#include "chrome/installer/setup/install_service_work_item.h"
#include "chrome/installer/setup/install_worker.h" #include "chrome/installer/setup/install_worker.h"
#include "chrome/installer/setup/installer_state.h" #include "chrome/installer/setup/installer_state.h"
#include "chrome/installer/setup/launch_chrome.h" #include "chrome/installer/setup/launch_chrome.h"
...@@ -633,6 +634,19 @@ bool DeleteChromeRegistrationKeys(const InstallerState& installer_state, ...@@ -633,6 +634,19 @@ bool DeleteChromeRegistrationKeys(const InstallerState& installer_state,
LOG(DFATAL) << "Cannot retrieve the toast activator registry path"; LOG(DFATAL) << "Cannot retrieve the toast activator registry path";
} }
if (installer_state.system_install()) {
// Delete Software\Classes\CLSID and AppId\|elevation_service_clsid|.
const base::string16 clsid_reg_path =
GetElevationServiceClsidRegistryPath();
const base::string16 appid_reg_path =
GetElevationServiceAppidRegistryPath();
for (const auto& reg_path : {clsid_reg_path, appid_reg_path})
InstallUtil::DeleteRegistryKey(root, reg_path, WorkItem::kWow64Default);
LOG_IF(WARNING, !InstallServiceWorkItem::DeleteService(
install_static::GetElevationServiceName()));
}
// Delete all Start Menu Internet registrations that refer to this Chrome. // Delete all Start Menu Internet registrations that refer to this Chrome.
{ {
using base::win::RegistryKeyIterator; using base::win::RegistryKeyIterator;
......
...@@ -392,18 +392,23 @@ bool InstallUtil::IsStartMenuShortcutWithActivatorGuidInstalled() { ...@@ -392,18 +392,23 @@ bool InstallUtil::IsStartMenuShortcutWithActivatorGuidInstalled() {
} }
// static // static
base::string16 InstallUtil::GetToastActivatorRegistryPath() { base::string16 InstallUtil::String16FromGUID(const GUID& guid) {
// CLSID has a string format of "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}", // A GUID has a string format of "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}",
// which contains 38 characters. The length is 39 to make space for the // which contains 38 characters. The length is 39 inclusive of the string
// string terminator. // terminator.
constexpr int kGuidLength = 39; constexpr int kGuidLength = 39;
base::string16 guid_string; base::string16 guid_string;
if (::StringFromGUID2(install_static::GetToastActivatorClsid(),
base::WriteInto(&guid_string, kGuidLength), const int length_with_terminator = ::StringFromGUID2(
kGuidLength) != kGuidLength) { guid, base::WriteInto(&guid_string, kGuidLength), kGuidLength);
return base::string16(); DCHECK_EQ(length_with_terminator, kGuidLength);
} return guid_string;
return L"Software\\Classes\\CLSID\\" + guid_string; }
// static
base::string16 InstallUtil::GetToastActivatorRegistryPath() {
return L"Software\\Classes\\CLSID\\" +
String16FromGUID(install_static::GetToastActivatorClsid());
} }
// static // static
......
...@@ -81,8 +81,10 @@ class InstallUtil { ...@@ -81,8 +81,10 @@ class InstallUtil {
// CLSID registered. // CLSID registered.
static bool IsStartMenuShortcutWithActivatorGuidInstalled(); static bool IsStartMenuShortcutWithActivatorGuidInstalled();
// Returns the toast activator registry path if found, or an empty string in // Returns a string representation of |guid|.
// case of error. static base::string16 String16FromGUID(const GUID& guid);
// Returns the toast activator registry path.
static base::string16 GetToastActivatorRegistryPath(); static base::string16 GetToastActivatorRegistryPath();
// Populates |path| with EULA sentinel file path. Returns false on error. // Populates |path| with EULA sentinel file path. Returns false on error.
......
...@@ -205,6 +205,10 @@ const wchar_t kUninstallArgumentsField[] = L"UninstallArguments"; ...@@ -205,6 +205,10 @@ const wchar_t kUninstallArgumentsField[] = L"UninstallArguments";
const wchar_t kUninstallDisplayNameField[] = L"DisplayName"; const wchar_t kUninstallDisplayNameField[] = L"DisplayName";
const wchar_t kUninstallInstallationDate[] = L"installation_date"; const wchar_t kUninstallInstallationDate[] = L"installation_date";
// Elevation Service constants.
const base::FilePath::CharType kElevationServiceExe[] =
FILE_PATH_LITERAL("elevation_service.exe");
// Google Update installer result API. // Google Update installer result API.
const wchar_t kInstallerError[] = L"InstallerError"; const wchar_t kInstallerError[] = L"InstallerError";
const wchar_t kInstallerExtraCode1[] = L"InstallerExtraCode1"; const wchar_t kInstallerExtraCode1[] = L"InstallerExtraCode1";
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#include <stddef.h> #include <stddef.h>
#include "base/files/file_path.h"
namespace installer { namespace installer {
// Return status of installer. Values in this enum must not change. Always add // Return status of installer. Values in this enum must not change. Always add
...@@ -218,6 +220,9 @@ extern const wchar_t kUninstallDisplayNameField[]; ...@@ -218,6 +220,9 @@ extern const wchar_t kUninstallDisplayNameField[];
extern const wchar_t kUninstallInstallationDate[]; extern const wchar_t kUninstallInstallationDate[];
extern const wchar_t kUninstallStringField[]; extern const wchar_t kUninstallStringField[];
// Elevation Service constants.
extern const base::FilePath::CharType kElevationServiceExe[];
// Google Update installer result API. // Google Update installer result API.
extern const wchar_t kInstallerError[]; extern const wchar_t kInstallerError[];
extern const wchar_t kInstallerExtraCode1[]; extern const wchar_t kInstallerExtraCode1[];
......
...@@ -50,6 +50,12 @@ ...@@ -50,6 +50,12 @@
"data": "$LOCAL_APPDATA\\$CHROME_DIR_BETA\\Application\\$MINI_INSTALLER_FILE_VERSION\\notification_helper.exe" "data": "$LOCAL_APPDATA\\$CHROME_DIR_BETA\\Application\\$MINI_INSTALLER_FILE_VERSION\\notification_helper.exe"
} }
}, },
"HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\$CHROME_ELEVATOR_CLSID_BETA": {
"exists": "forbidden"
},
"HKEY_CURRENT_USER\\Software\\Classes\\AppID\\$CHROME_ELEVATOR_CLSID_BETA": {
"exists": "forbidden"
},
"HKEY_CURRENT_USER\\Software\\Classes\\$CHROME_SHORT_NAME_BETA$USER_SPECIFIC_REGISTRY_SUFFIX": { "HKEY_CURRENT_USER\\Software\\Classes\\$CHROME_SHORT_NAME_BETA$USER_SPECIFIC_REGISTRY_SUFFIX": {
"exists": "forbidden" "exists": "forbidden"
} }
......
...@@ -31,6 +31,12 @@ ...@@ -31,6 +31,12 @@
}, },
"HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\$CHROME_TOAST_ACTIVATOR_CLSID_BETA": { "HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\$CHROME_TOAST_ACTIVATOR_CLSID_BETA": {
"exists": "forbidden" "exists": "forbidden"
},
"HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\$CHROME_ELEVATOR_CLSID_BETA": {
"exists": "forbidden"
},
"HKEY_CURRENT_USER\\Software\\Classes\\AppID\\$CHROME_ELEVATOR_CLSID_BETA": {
"exists": "forbidden"
} }
} }
} }
...@@ -50,6 +50,12 @@ ...@@ -50,6 +50,12 @@
"data": "$LOCAL_APPDATA\\$CHROME_DIR_SXS\\Application\\$MINI_INSTALLER_FILE_VERSION\\notification_helper.exe" "data": "$LOCAL_APPDATA\\$CHROME_DIR_SXS\\Application\\$MINI_INSTALLER_FILE_VERSION\\notification_helper.exe"
} }
}, },
"HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\$CHROME_ELEVATOR_CLSID_SXS": {
"exists": "forbidden"
},
"HKEY_CURRENT_USER\\Software\\Classes\\AppID\\$CHROME_ELEVATOR_CLSID_SXS": {
"exists": "forbidden"
},
"HKEY_CURRENT_USER\\Software\\Classes\\$CHROME_SHORT_NAME_SXS$USER_SPECIFIC_REGISTRY_SUFFIX": { "HKEY_CURRENT_USER\\Software\\Classes\\$CHROME_SHORT_NAME_SXS$USER_SPECIFIC_REGISTRY_SUFFIX": {
"exists": "forbidden" "exists": "forbidden"
} }
......
...@@ -31,6 +31,12 @@ ...@@ -31,6 +31,12 @@
}, },
"HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\$CHROME_TOAST_ACTIVATOR_CLSID_SXS": { "HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\$CHROME_TOAST_ACTIVATOR_CLSID_SXS": {
"exists": "forbidden" "exists": "forbidden"
},
"HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\$CHROME_ELEVATOR_CLSID_SXS": {
"exists": "forbidden"
},
"HKEY_CURRENT_USER\\Software\\Classes\\AppID\\$CHROME_ELEVATOR_CLSID_SXS": {
"exists": "forbidden"
} }
} }
} }
...@@ -50,6 +50,12 @@ ...@@ -50,6 +50,12 @@
"data": "$LOCAL_APPDATA\\$CHROME_DIR_DEV\\Application\\$MINI_INSTALLER_FILE_VERSION\\notification_helper.exe" "data": "$LOCAL_APPDATA\\$CHROME_DIR_DEV\\Application\\$MINI_INSTALLER_FILE_VERSION\\notification_helper.exe"
} }
}, },
"HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\$CHROME_ELEVATOR_CLSID_DEV": {
"exists": "forbidden"
},
"HKEY_CURRENT_USER\\Software\\Classes\\AppID\\$CHROME_ELEVATOR_CLSID_DEV": {
"exists": "forbidden"
},
"HKEY_CURRENT_USER\\Software\\Classes\\$CHROME_SHORT_NAME_DEV$USER_SPECIFIC_REGISTRY_SUFFIX": { "HKEY_CURRENT_USER\\Software\\Classes\\$CHROME_SHORT_NAME_DEV$USER_SPECIFIC_REGISTRY_SUFFIX": {
"exists": "forbidden" "exists": "forbidden"
} }
......
...@@ -31,6 +31,12 @@ ...@@ -31,6 +31,12 @@
}, },
"HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\$CHROME_TOAST_ACTIVATOR_CLSID_DEV": { "HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\$CHROME_TOAST_ACTIVATOR_CLSID_DEV": {
"exists": "forbidden" "exists": "forbidden"
},
"HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\$CHROME_ELEVATOR_CLSID_DEV": {
"exists": "forbidden"
},
"HKEY_CURRENT_USER\\Software\\Classes\\AppID\\$CHROME_ELEVATOR_CLSID_DEV": {
"exists": "forbidden"
} }
} }
} }
...@@ -62,6 +62,53 @@ ...@@ -62,6 +62,53 @@
"data": "$PROGRAM_FILES\\$CHROME_DIR\\Application\\$PREVIOUS_VERSION_MINI_INSTALLER_FILE_VERSION\\notification_helper.exe" "data": "$PROGRAM_FILES\\$CHROME_DIR\\Application\\$PREVIOUS_VERSION_MINI_INSTALLER_FILE_VERSION\\notification_helper.exe"
} }
}, },
"HKEY_LOCAL_MACHINE\\Software\\Classes\\CLSID\\$CHROME_ELEVATOR_CLSID": {
"exists": "required",
"values": {
"AppID": {
"type": "SZ",
"data": "$CHROME_ELEVATOR_CLSID"
}
}
},
"HKEY_LOCAL_MACHINE\\Software\\Classes\\AppID\\$CHROME_ELEVATOR_CLSID": {
"exists": "required",
"values": {
"LocalService": {
"type": "SZ",
"data": "$CHROME_ELEVATION_SERVICE_NAME"
}
}
},
"HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\$CHROME_ELEVATION_SERVICE_NAME": {
"exists": "required",
"values": {
"Type": {
"type": "DWORD",
"data": 16
},
"Start": {
"type": "DWORD",
"data": 3
},
"ErrorControl": {
"type": "DWORD",
"data": 1
},
"ImagePath": {
"type": "EXPAND_SZ",
"data": "\"$PROGRAM_FILES\\$CHROME_DIR\\Application\\$PREVIOUS_VERSION_MINI_INSTALLER_FILE_VERSION\\elevation_service.exe\""
},
"DisplayName": {
"type": "SZ",
"data": "$CHROME_ELEVATION_SERVICE_DISPLAY_NAME"
},
"ObjectName": {
"type": "SZ",
"data": "LocalSystem"
}
}
},
"HKEY_LOCAL_MACHINE\\Software\\Classes\\$CHROME_SHORT_NAME": { "HKEY_LOCAL_MACHINE\\Software\\Classes\\$CHROME_SHORT_NAME": {
"exists": "forbidden" "exists": "forbidden"
} }
......
...@@ -62,6 +62,12 @@ ...@@ -62,6 +62,12 @@
"data": "$LOCAL_APPDATA\\$CHROME_DIR\\Application\\$PREVIOUS_VERSION_MINI_INSTALLER_FILE_VERSION\\notification_helper.exe" "data": "$LOCAL_APPDATA\\$CHROME_DIR\\Application\\$PREVIOUS_VERSION_MINI_INSTALLER_FILE_VERSION\\notification_helper.exe"
} }
}, },
"HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\$CHROME_ELEVATOR_CLSID": {
"exists": "forbidden"
},
"HKEY_CURRENT_USER\\Software\\Classes\\AppID\\$CHROME_ELEVATOR_CLSID": {
"exists": "forbidden"
},
"HKEY_CURRENT_USER\\Software\\Classes\\$CHROME_SHORT_NAME$USER_SPECIFIC_REGISTRY_SUFFIX": { "HKEY_CURRENT_USER\\Software\\Classes\\$CHROME_SHORT_NAME$USER_SPECIFIC_REGISTRY_SUFFIX": {
"exists": "forbidden" "exists": "forbidden"
} }
......
...@@ -73,6 +73,53 @@ ...@@ -73,6 +73,53 @@
"data": "$PROGRAM_FILES\\$CHROME_DIR\\Application\\$MINI_INSTALLER_FILE_VERSION\\notification_helper.exe" "data": "$PROGRAM_FILES\\$CHROME_DIR\\Application\\$MINI_INSTALLER_FILE_VERSION\\notification_helper.exe"
} }
}, },
"HKEY_LOCAL_MACHINE\\Software\\Classes\\CLSID\\$CHROME_ELEVATOR_CLSID": {
"exists": "required",
"values": {
"AppID": {
"type": "SZ",
"data": "$CHROME_ELEVATOR_CLSID"
}
}
},
"HKEY_LOCAL_MACHINE\\Software\\Classes\\AppID\\$CHROME_ELEVATOR_CLSID": {
"exists": "required",
"values": {
"LocalService": {
"type": "SZ",
"data": "$CHROME_ELEVATION_SERVICE_NAME"
}
}
},
"HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\$CHROME_ELEVATION_SERVICE_NAME": {
"exists": "required",
"values": {
"Type": {
"type": "DWORD",
"data": 16
},
"Start": {
"type": "DWORD",
"data": 3
},
"ErrorControl": {
"type": "DWORD",
"data": 1
},
"ImagePath": {
"type": "EXPAND_SZ",
"data": "\"$PROGRAM_FILES\\$CHROME_DIR\\Application\\$MINI_INSTALLER_FILE_VERSION\\elevation_service.exe\""
},
"DisplayName": {
"type": "SZ",
"data": "$CHROME_ELEVATION_SERVICE_DISPLAY_NAME"
},
"ObjectName": {
"type": "SZ",
"data": "LocalSystem"
}
}
},
"HKEY_LOCAL_MACHINE\\Software\\Classes\\$CHROME_SHORT_NAME": { "HKEY_LOCAL_MACHINE\\Software\\Classes\\$CHROME_SHORT_NAME": {
"exists": "forbidden" "exists": "forbidden"
}, },
......
...@@ -37,6 +37,15 @@ ...@@ -37,6 +37,15 @@
}, },
"HKEY_LOCAL_MACHINE\\Software\\Classes\\CLSID\\$CHROME_TOAST_ACTIVATOR_CLSID": { "HKEY_LOCAL_MACHINE\\Software\\Classes\\CLSID\\$CHROME_TOAST_ACTIVATOR_CLSID": {
"exists": "forbidden" "exists": "forbidden"
},
"HKEY_LOCAL_MACHINE\\Software\\Classes\\CLSID\\$CHROME_ELEVATOR_CLSID": {
"exists": "forbidden"
},
"HKEY_LOCAL_MACHINE\\Software\\Classes\\AppID\\$CHROME_ELEVATOR_CLSID": {
"exists": "forbidden"
},
"HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\$CHROME_ELEVATION_SERVICE_NAME": {
"exists": "forbidden"
} }
} }
} }
...@@ -58,6 +58,12 @@ ...@@ -58,6 +58,12 @@
"data": "$LOCAL_APPDATA\\$CHROME_DIR\\Application\\$MINI_INSTALLER_FILE_VERSION\\notification_helper.exe" "data": "$LOCAL_APPDATA\\$CHROME_DIR\\Application\\$MINI_INSTALLER_FILE_VERSION\\notification_helper.exe"
} }
}, },
"HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\$CHROME_ELEVATOR_CLSID": {
"exists": "forbidden"
},
"HKEY_CURRENT_USER\\Software\\Classes\\AppID\\$CHROME_ELEVATOR_CLSID": {
"exists": "forbidden"
},
"HKEY_CURRENT_USER\\Software\\Classes\\$CHROME_SHORT_NAME$USER_SPECIFIC_REGISTRY_SUFFIX": { "HKEY_CURRENT_USER\\Software\\Classes\\$CHROME_SHORT_NAME$USER_SPECIFIC_REGISTRY_SUFFIX": {
"exists": "forbidden" "exists": "forbidden"
} }
......
...@@ -37,6 +37,12 @@ ...@@ -37,6 +37,12 @@
}, },
"HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\$CHROME_TOAST_ACTIVATOR_CLSID": { "HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\$CHROME_TOAST_ACTIVATOR_CLSID": {
"exists": "forbidden" "exists": "forbidden"
},
"HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\$CHROME_ELEVATOR_CLSID": {
"exists": "forbidden"
},
"HKEY_CURRENT_USER\\Software\\Classes\\AppID\\$CHROME_ELEVATOR_CLSID": {
"exists": "forbidden"
} }
} }
} }
...@@ -42,6 +42,12 @@ ...@@ -42,6 +42,12 @@
"data": "$LOCAL_APPDATA\\$CHROME_DIR_SXS\\Application\\$PREVIOUS_VERSION_MINI_INSTALLER_FILE_VERSION\\notification_helper.exe" "data": "$LOCAL_APPDATA\\$CHROME_DIR_SXS\\Application\\$PREVIOUS_VERSION_MINI_INSTALLER_FILE_VERSION\\notification_helper.exe"
} }
}, },
"HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\$CHROME_ELEVATOR_CLSID_SXS": {
"exists": "forbidden"
},
"HKEY_CURRENT_USER\\Software\\Classes\\AppID\\$CHROME_ELEVATOR_CLSID_SXS": {
"exists": "forbidden"
},
"HKEY_CURRENT_USER\\Software\\Classes\\$CHROME_SHORT_NAME_SXS$USER_SPECIFIC_REGISTRY_SUFFIX": { "HKEY_CURRENT_USER\\Software\\Classes\\$CHROME_SHORT_NAME_SXS$USER_SPECIFIC_REGISTRY_SUFFIX": {
"exists": "forbidden" "exists": "forbidden"
} }
......
...@@ -71,6 +71,53 @@ ...@@ -71,6 +71,53 @@
"data": "$PROGRAM_FILES\\$CHROME_DIR\\Application\\$PREVIOUS_VERSION_MINI_INSTALLER_FILE_VERSION\\notification_helper.exe" "data": "$PROGRAM_FILES\\$CHROME_DIR\\Application\\$PREVIOUS_VERSION_MINI_INSTALLER_FILE_VERSION\\notification_helper.exe"
} }
}, },
"HKEY_LOCAL_MACHINE\\Software\\Classes\\CLSID\\$CHROME_ELEVATOR_CLSID": {
"exists": "required",
"values": {
"AppID": {
"type": "SZ",
"data": "$CHROME_ELEVATOR_CLSID"
}
}
},
"HKEY_LOCAL_MACHINE\\Software\\Classes\\AppID\\$CHROME_ELEVATOR_CLSID": {
"exists": "required",
"values": {
"LocalService": {
"type": "SZ",
"data": "$CHROME_ELEVATION_SERVICE_NAME"
}
}
},
"HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\$CHROME_ELEVATION_SERVICE_NAME": {
"exists": "required",
"values": {
"Type": {
"type": "DWORD",
"data": 16
},
"Start": {
"type": "DWORD",
"data": 3
},
"ErrorControl": {
"type": "DWORD",
"data": 1
},
"ImagePath": {
"type": "EXPAND_SZ",
"data": "\"$PROGRAM_FILES\\$CHROME_DIR\\Application\\$PREVIOUS_VERSION_MINI_INSTALLER_FILE_VERSION\\elevation_service.exe\""
},
"DisplayName": {
"type": "SZ",
"data": "$CHROME_ELEVATION_SERVICE_DISPLAY_NAME"
},
"ObjectName": {
"type": "SZ",
"data": "LocalSystem"
}
}
},
"HKEY_LOCAL_MACHINE\\Software\\Classes\\$CHROME_SHORT_NAME": { "HKEY_LOCAL_MACHINE\\Software\\Classes\\$CHROME_SHORT_NAME": {
"exists": "forbidden" "exists": "forbidden"
}, },
......
...@@ -56,6 +56,12 @@ ...@@ -56,6 +56,12 @@
"data": "$LOCAL_APPDATA\\$CHROME_DIR\\Application\\$PREVIOUS_VERSION_MINI_INSTALLER_FILE_VERSION\\notification_helper.exe" "data": "$LOCAL_APPDATA\\$CHROME_DIR\\Application\\$PREVIOUS_VERSION_MINI_INSTALLER_FILE_VERSION\\notification_helper.exe"
} }
}, },
"HKEY_CURRENT_USER\\Software\\Classes\\CLSID\\$CHROME_ELEVATOR_CLSID": {
"exists": "forbidden"
},
"HKEY_CURRENT_USER\\Software\\Classes\\AppID\\$CHROME_ELEVATOR_CLSID": {
"exists": "forbidden"
},
"HKEY_CURRENT_USER\\Software\\Classes\\$CHROME_SHORT_NAME$USER_SPECIFIC_REGISTRY_SUFFIX": { "HKEY_CURRENT_USER\\Software\\Classes\\$CHROME_SHORT_NAME$USER_SPECIFIC_REGISTRY_SUFFIX": {
"exists": "forbidden" "exists": "forbidden"
} }
......
...@@ -121,6 +121,25 @@ class VariableExpander: ...@@ -121,6 +121,25 @@ class VariableExpander:
Chrome Dev. Chrome Dev.
* $CHROME_TOAST_ACTIVATOR_CLSID_SXS: NotificationActivator's CLSID for * $CHROME_TOAST_ACTIVATOR_CLSID_SXS: NotificationActivator's CLSID for
Chrome SxS. Chrome SxS.
* $CHROME_ELEVATOR_CLSID: Elevator Service CLSID for Chrome.
* $CHROME_ELEVATOR_CLSID_BETA: Elevator Service CLSID for Chrome Beta.
* $CHROME_ELEVATOR_CLSID_DEV: Elevator Service CLSID for Chrome Dev.
* $CHROME_ELEVATOR_CLSID_SXS: Elevator Service CLSID for Chrome SxS.
* $CHROME_ELEVATION_SERVICE_NAME: Elevation Service Name for Chrome.
* $CHROME_ELEVATION_SERVICE_NAME_BETA: Elevation Service Name for Chrome
Beta.
* $CHROME_ELEVATION_SERVICE_NAME_DEV: Elevation Service Name for Chrome
Dev.
* $CHROME_ELEVATION_SERVICE_NAME_SXS: Elevation Service Name for Chrome
SxS.
* $CHROME_ELEVATION_SERVICE_DISPLAY_NAME: Elevation Service Display Name
for Chrome.
* $CHROME_ELEVATION_SERVICE_DISPLAY_NAME_BETA: Elevation Service Display
Name for Chrome Beta.
* $CHROME_ELEVATION_SERVICE_DISPLAY_NAME_DEV: Elevation Service Display
Name for Chrome Dev.
* $CHROME_ELEVATION_SERVICE_DISPLAY_NAME_SXS: Elevation Service Display
Name for Chrome SxS.
Args: Args:
mini_installer_path: The path to a mini_installer. mini_installer_path: The path to a mini_installer.
...@@ -206,6 +225,29 @@ class VariableExpander: ...@@ -206,6 +225,29 @@ class VariableExpander:
'{F01C03EB-D431-4C83-8D7A-902771E732FA}'), '{F01C03EB-D431-4C83-8D7A-902771E732FA}'),
'CHROME_TOAST_ACTIVATOR_CLSID_SXS': ( 'CHROME_TOAST_ACTIVATOR_CLSID_SXS': (
'{FA372A6E-149F-4E95-832D-8F698D40AD7F}'), '{FA372A6E-149F-4E95-832D-8F698D40AD7F}'),
'CHROME_ELEVATOR_CLSID': ('{708860E0-F641-4611-8895-7D867DD3675B}'),
'CHROME_ELEVATOR_CLSID_BETA': (
'{DD2646BA-3707-4BF8-B9A7-038691A68FC2}'),
'CHROME_ELEVATOR_CLSID_DEV': (
'{DA7FDCA5-2CAA-4637-AA17-0740584DE7DA}'),
'CHROME_ELEVATOR_CLSID_SXS': (
'{704C2872-2049-435E-A469-0A534313C42B}'),
'CHROME_ELEVATION_SERVICE_NAME': (
'GoogleChromeElevationService'),
'CHROME_ELEVATION_SERVICE_NAME_BETA': (
'GoogleChromeBetaElevationService'),
'CHROME_ELEVATION_SERVICE_NAME_DEV': (
'GoogleChromeDevElevationService'),
'CHROME_ELEVATION_SERVICE_NAME_SXS': (
'GoogleChromeCanaryElevationService'),
'CHROME_ELEVATION_SERVICE_DISPLAY_NAME': (
'Google Chrome Elevation Service'),
'CHROME_ELEVATION_SERVICE_DISPLAY_NAME_BETA': (
'Google Chrome Beta Elevation Service'),
'CHROME_ELEVATION_SERVICE_DISPLAY_NAME_DEV': (
'Google Chrome Dev Elevation Service'),
'CHROME_ELEVATION_SERVICE_DISPLAY_NAME_SXS': (
'Google Chrome Canary Elevation Service'),
}) })
elif mini_installer_product_name == 'Chromium Installer': elif mini_installer_product_name == 'Chromium Installer':
self._variable_mapping.update({ self._variable_mapping.update({
...@@ -219,6 +261,10 @@ class VariableExpander: ...@@ -219,6 +261,10 @@ class VariableExpander:
'CHROME_CLIENT_STATE_KEY': 'Software\\Chromium', 'CHROME_CLIENT_STATE_KEY': 'Software\\Chromium',
'CHROME_TOAST_ACTIVATOR_CLSID': ( 'CHROME_TOAST_ACTIVATOR_CLSID': (
'{635EFA6F-08D6-4EC9-BD14-8A0FDE975159}'), '{635EFA6F-08D6-4EC9-BD14-8A0FDE975159}'),
'CHROME_ELEVATOR_CLSID': ('{D133B120-6DB4-4D6B-8BFE-83BF8CA1B1B0}'),
'CHROME_ELEVATION_SERVICE_NAME': 'ChromiumElevationService',
'CHROME_ELEVATION_SERVICE_DISPLAY_NAME': (
'Chromium Elevation Service'),
}) })
else: else:
raise KeyError("Unknown mini_installer product name '%s'" % raise KeyError("Unknown mini_installer product name '%s'" %
......
...@@ -803,4 +803,15 @@ FILES = [ ...@@ -803,4 +803,15 @@ FILES = [
'archive': 'chromedriver_win32-syms.zip', 'archive': 'chromedriver_win32-syms.zip',
'optional': ['official'], 'optional': ['official'],
}, },
# Elevation service files:
{
'filename': 'elevation_service.exe',
'buildtype': ['dev', 'official'],
'filegroup': ['default', 'symsrc'],
},
{
'filename': 'elevation_service.exe.pdb',
'buildtype': ['dev', 'official'],
'archive': 'chrome-win32-syms.zip',
},
] ]
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