1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_INSTALLER_UTIL_SELF_REG_WORK_ITEM_H__
6 #define CHROME_INSTALLER_UTIL_SELF_REG_WORK_ITEM_H__
11 #include "chrome/installer/util/work_item.h"
13 // Registers or unregisters the DLL at the given path.
14 class SelfRegWorkItem
: public WorkItem
{
16 virtual ~SelfRegWorkItem();
19 virtual void Rollback();
22 friend class WorkItem
;
24 // Constructs a work item that will call upon a self-registering DLL to
26 // dll_path: The path to the DLL.
27 // do_register: Whether this action is to register or unregister the DLL.
28 // user_level_registration: If true, then the exports called
29 // "DllRegisterUserServer" and "DllUnregisterUserServer" will be called to
30 // register and unregister the DLL. If false, the default exports named
31 // "DllRegisterServer" and "DllUnregisterUserServer" will be used.
32 SelfRegWorkItem(const std::wstring
& dll_path
, bool do_register
,
33 bool user_level_registration
);
35 // Examines the DLL at dll_path looking for either DllRegisterServer (if
36 // do_register is true) or DllUnregisterServer (if do_register is false).
37 // Returns true if the DLL exports the function and it a call to it
38 // succeeds, false otherwise.
39 bool RegisterDll(bool do_register
);
41 // The path to the dll to be registered.
42 std::wstring dll_path_
;
44 // Whether this work item will register or unregister the dll. The rollback
45 // action just inverts this parameter.
48 // Whether to use alternate export names on the DLL that will perform
49 // user level registration.
50 bool user_level_registration_
;
53 #endif // CHROME_INSTALLER_UTIL_SELF_REG_WORK_ITEM_H__