| OLD | NEW |
| (Empty) |
| 1 // Copyright 2007-2009 Google Inc. | |
| 2 // | |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | |
| 4 // you may not use this file except in compliance with the License. | |
| 5 // You may obtain a copy of the License at | |
| 6 // | |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | |
| 8 // | |
| 9 // Unless required by applicable law or agreed to in writing, software | |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 12 // See the License for the specific language governing permissions and | |
| 13 // limitations under the License. | |
| 14 // ======================================================================== | |
| 15 | |
| 16 #ifndef OMAHA_SETUP_SETUP_GOOGLE_UPDATE_H__ | |
| 17 #define OMAHA_SETUP_SETUP_GOOGLE_UPDATE_H__ | |
| 18 | |
| 19 #include <windows.h> | |
| 20 #include <atlstr.h> | |
| 21 #include "base/basictypes.h" | |
| 22 #include "omaha/base/constants.h" | |
| 23 | |
| 24 namespace omaha { | |
| 25 | |
| 26 class SetupGoogleUpdate { | |
| 27 public: | |
| 28 explicit SetupGoogleUpdate(bool is_machine); | |
| 29 ~SetupGoogleUpdate(); | |
| 30 | |
| 31 HRESULT FinishInstall(); | |
| 32 | |
| 33 HRESULT InstallBrowserPlugins(); | |
| 34 | |
| 35 // Uninstalls Google Update registrations created by FinishInstall(). | |
| 36 void Uninstall(); | |
| 37 | |
| 38 // Build the command line to execute the installed core. | |
| 39 CString BuildCoreProcessCommandLine() const; | |
| 40 | |
| 41 int extra_code1() const { return extra_code1_; } | |
| 42 | |
| 43 private: | |
| 44 HRESULT FinishMachineInstall(); | |
| 45 | |
| 46 // Installs appropriate launch mechanism(s) starts one of them if appropriate. | |
| 47 HRESULT InstallLaunchMechanisms(); | |
| 48 | |
| 49 // Uninstalls appropriate launch mechanism(s). | |
| 50 void UninstallLaunchMechanisms(); | |
| 51 | |
| 52 // Installs the scheduled task which runs the GoogleUpdate core. | |
| 53 HRESULT InstallScheduledTask(); | |
| 54 | |
| 55 // Installs the service and scheduled task. | |
| 56 HRESULT InstallMachineLaunchMechanisms(); | |
| 57 | |
| 58 // Add Google Update to the user's Run key. | |
| 59 HRESULT InstallUserLaunchMechanisms(); | |
| 60 | |
| 61 // Configures goopdate to run at startup. | |
| 62 // | |
| 63 // @param install: true if we should configure to run at startup, false if we | |
| 64 // should clean up the configuration (meaning that we should not run at | |
| 65 // startup) | |
| 66 HRESULT ConfigureUserRunAtStartup(bool install); | |
| 67 | |
| 68 HRESULT InstallRegistryValues(); | |
| 69 | |
| 70 // Create's the ClientStateMedium key with relaxed ACLs. | |
| 71 // Only call for machine installs. | |
| 72 HRESULT CreateClientStateMedium(); | |
| 73 | |
| 74 // Writes the Installation ID to the registry. | |
| 75 HRESULT SetInstallationId(); | |
| 76 | |
| 77 // Register COM classes and interfaces. | |
| 78 HRESULT RegisterOrUnregisterCOMLocalServer(bool register); | |
| 79 | |
| 80 // Installs the helper (MSI). | |
| 81 HRESULT InstallMsiHelper(); | |
| 82 | |
| 83 // Uninstalls the helper (MSI). | |
| 84 HRESULT UninstallMsiHelper(); | |
| 85 | |
| 86 HRESULT UninstallBrowserPlugins(); | |
| 87 | |
| 88 // Build the install file path for support files. For example, | |
| 89 CString BuildSupportFileInstallPath(const CString& filename) const; | |
| 90 | |
| 91 // Deletes the Omaha registry keys except the machine id and the user id | |
| 92 // values under the main update key. | |
| 93 HRESULT DeleteRegistryKeys(); | |
| 94 | |
| 95 // Uninstall previous versions after an overinstall of the new version. We do | |
| 96 // the following: | |
| 97 // * Delete all sub-directories under Google\\Update, except the running | |
| 98 // version's directory and the cache directory. | |
| 99 // * Uninstall the BHO, so IE does not load it in the future. | |
| 100 HRESULT UninstallPreviousVersions(); | |
| 101 | |
| 102 const bool is_machine_; | |
| 103 CString this_version_; | |
| 104 int extra_code1_; | |
| 105 | |
| 106 #ifdef _DEBUG | |
| 107 bool have_called_uninstall_previous_versions_; | |
| 108 #endif | |
| 109 | |
| 110 friend class SetupGoogleUpdateTest; | |
| 111 friend class AppManagerTestBase; | |
| 112 | |
| 113 DISALLOW_EVIL_CONSTRUCTORS(SetupGoogleUpdate); | |
| 114 }; | |
| 115 | |
| 116 } // namespace omaha | |
| 117 | |
| 118 #endif // OMAHA_SETUP_SETUP_GOOGLE_UPDATE_H__ | |
| 119 | |
| OLD | NEW |