diff options
author | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-07 01:27:57 +0000 |
---|---|---|
committer | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-07 01:27:57 +0000 |
commit | 2414e84fdc99feb8e3a674a1776cddf5d24529fd (patch) | |
tree | a7735239d78bdbc37dcaf5a6428b3076d8a5ff33 /chrome/installer/util/work_item.h | |
parent | 0c294877146c3812e0a69a5a6ec0cf3e29803954 (diff) | |
download | chromium_src-2414e84fdc99feb8e3a674a1776cddf5d24529fd.zip chromium_src-2414e84fdc99feb8e3a674a1776cddf5d24529fd.tar.gz chromium_src-2414e84fdc99feb8e3a674a1776cddf5d24529fd.tar.bz2 |
Implement the new mechanism we are going to use for handling Chromium updates
while it is in use. This should work for per user as well as system level
installs (after some additional changes once Google Update changes are ready).
The following scenarios should work now:
- If Chromium is using two different profiles at the same time we do not switch
chrome executables until all of them are closed.
- The old version of Chromium can be run after a restart if the renaming of
executables fails.
- We will not use environment variable any more but we need to keep it until all
the users get this change on their machines.
- opv/rename registry keys and new_chrome.exe should always together. If one
exist all three should exist because they are created and deleted as one atomic
operation (as much as possible given laws of physics).
BUG=1463346
Review URL: http://codereview.chromium.org/9436
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4949 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util/work_item.h')
-rw-r--r-- | chrome/installer/util/work_item.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/chrome/installer/util/work_item.h b/chrome/installer/util/work_item.h index 267b61b..08942a1 100644 --- a/chrome/installer/util/work_item.h +++ b/chrome/installer/util/work_item.h @@ -6,8 +6,8 @@ // out during install/update/uninstall. Supports rollback of actions if this // process fails. -#ifndef CHROME_INSTALLER_UTIL_WORK_ITEM_H__ -#define CHROME_INSTALLER_UTIL_WORK_ITEM_H__ +#ifndef CHROME_INSTALLER_UTIL_WORK_ITEM_H_ +#define CHROME_INSTALLER_UTIL_WORK_ITEM_H_ #include <string> #include <windows.h> @@ -16,6 +16,7 @@ class CopyTreeWorkItem; class CreateDirWorkItem; class CreateRegKeyWorkItem; class DeleteTreeWorkItem; +class DeleteRegValueWorkItem; class SetRegValueWorkItem; class WorkItemList; @@ -29,16 +30,17 @@ class WorkItem { NEVER, // Not used currently. IF_DIFFERENT, // Overwrite if different. Currently only applies to file. IF_NOT_PRESENT, // Copy only if file/directory do not exist already. - RENAME_IF_IN_USE // Copy to a new path instead of overwriting (only files). + NEW_NAME_IF_IN_USE // Copy to a new path if dest is in use(only files). }; virtual ~WorkItem(); // Create a CopyTreeWorkItem that recursively copies a file system hierarchy - // from source path to destination path. If overwrite_option is ALWAYS, the - // created CopyTreeWorkItem always overwrites files. If overwrite_option is - // RENAME_IF_IN_USE, file is copied with an alternate name specified by - // alternative_path. + // from source path to destination path. + // * If overwrite_option is ALWAYS, the created CopyTreeWorkItem always + // overwrites files. + // * If overwrite_option is NEW_NAME_IF_IN_USE, file is copied with an + // alternate name specified by alternative_path. static CopyTreeWorkItem* CreateCopyTreeWorkItem(std::wstring source_path, std::wstring dest_path, std::wstring temp_dir, CopyOverWriteOption overwrite_option, @@ -52,6 +54,11 @@ class WorkItem { static CreateRegKeyWorkItem* CreateCreateRegKeyWorkItem( HKEY predefined_root, std::wstring path); + // Create a DeleteRegValueWorkItem that deletes a registry value + static DeleteRegValueWorkItem* CreateDeleteRegValueWorkItem( + HKEY predefined_root, std::wstring key_path, + std::wstring value_name, bool is_str_type); + // Create a DeleteTreeWorkItem that recursively deletes a file system // hierarchy at the given root path. A key file can be optionally specified // by key_path. @@ -97,5 +104,5 @@ class WorkItem { WorkItem(); }; -#endif // CHROME_INSTALLER_UTIL_WORK_ITEM_H__ +#endif // CHROME_INSTALLER_UTIL_WORK_ITEM_H_ |