| OLD | NEW |
| (Empty) |
| 1 // Copyright 2007-2010 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 // Goopdate constants - Reduces dependencies on goopdate.h for names that | |
| 17 // are needed outside Goopdate. | |
| 18 // | |
| 19 // TODO(omaha): it appears that the string constants below are not | |
| 20 // optimized out the program image even if not used. Figure out why they still | |
| 21 // show up in the tiny shell in optimized builds. | |
| 22 | |
| 23 #ifndef OMAHA_COMMON_CONST_GOOPDATE_H_ | |
| 24 #define OMAHA_COMMON_CONST_GOOPDATE_H_ | |
| 25 | |
| 26 #include <tchar.h> | |
| 27 #include "omaha/base/constants.h" | |
| 28 | |
| 29 // TODO(omaha3): Many of these values are specific to the COM server and a few | |
| 30 // may apply to the client. Move most of them to the goopdate directory. | |
| 31 | |
| 32 namespace omaha { | |
| 33 | |
| 34 enum ActiveStates { | |
| 35 ACTIVE_NOTRUN = 0, | |
| 36 ACTIVE_RUN, | |
| 37 ACTIVE_UNKNOWN | |
| 38 }; | |
| 39 | |
| 40 // Specifies what Omaha should do on successful installation. | |
| 41 enum SuccessfulInstallAction { | |
| 42 SUCCESS_ACTION_DEFAULT = 0, | |
| 43 SUCCESS_ACTION_EXIT_SILENTLY, | |
| 44 SUCCESS_ACTION_EXIT_SILENTLY_ON_LAUNCH_CMD, | |
| 45 }; | |
| 46 | |
| 47 // Specifies the type of result the app installer returned. | |
| 48 enum InstallerResultType { | |
| 49 INSTALLER_RESULT_UNKNOWN, | |
| 50 INSTALLER_RESULT_SUCCESS, | |
| 51 INSTALLER_RESULT_ERROR_MSI, | |
| 52 INSTALLER_RESULT_ERROR_SYSTEM, | |
| 53 INSTALLER_RESULT_ERROR_OTHER, | |
| 54 }; | |
| 55 | |
| 56 // The enumeration of the events. Some of the events are used in IPC, | |
| 57 // these are named events, the rest are not named. Of the named events there | |
| 58 // are two types the global and the local events. | |
| 59 // Global Events: | |
| 60 // The events which are global are indicated with the Global suffix in the | |
| 61 // enum. These events have the Global prefix attached to the event name and | |
| 62 // are used for IPC across terminal server sessions, these events are used | |
| 63 // as barriers, i.e. all waiting threads are release on these events. | |
| 64 // Local Events: | |
| 65 // The local counter parts of these events have the Local prefix attached | |
| 66 // to their names, and dont have any suffix in the enum names. The local events | |
| 67 // are used to release only one thread, this works as we know that there is | |
| 68 // only one user goopdate process in a user session and one machine goopdate. | |
| 69 // The local events also have the user sid added to the event name. This is to | |
| 70 // work around a bug in win2K and on XP where in case of TS, the event names | |
| 71 // will collide, inspite of the name changes. | |
| 72 enum GoopdateEvents { | |
| 73 EVENT_INVALID = -1, | |
| 74 EVENT_KILL_MESSAGE_LOOP = 0, | |
| 75 EVENT_UPDATE_TIMER, | |
| 76 EVENT_NEW_MANIFEST, // Used in IPC. | |
| 77 EVENT_QUIET_MODE, // Used in IPC. | |
| 78 EVENT_LEGACY_QUIET_MODE, // Only used to shut down pre-i18n goopdates. | |
| 79 EVENT_CODE_RED_TIMER, | |
| 80 }; | |
| 81 | |
| 82 // Represents the values that are used by the application to indicate its | |
| 83 // requirement for admin. | |
| 84 enum NeedsAdmin { | |
| 85 NEEDS_ADMIN_NO = 0, // The application will install per user. | |
| 86 NEEDS_ADMIN_YES, // The application will install machine-wide. | |
| 87 NEEDS_ADMIN_PREFERS, // The application will install machine-wide if | |
| 88 // permissions allow, else will install per-user. | |
| 89 }; | |
| 90 | |
| 91 // Using extern or intern linkage for these strings yields the same code size | |
| 92 // for the executable DLL. | |
| 93 | |
| 94 // The string representation of the NeedsAdmin enum as specified in the tag or | |
| 95 // command line. This is eventually parsed into the needs_admin member of | |
| 96 // CommandLineAppArgs. | |
| 97 const TCHAR* const kNeedsAdminNo = _T("&needsadmin=false"); | |
| 98 const TCHAR* const kNeedsAdminYes = _T("&needsadmin=true"); | |
| 99 const TCHAR* const kNeedsAdminPrefers = _T("&needsadmin=prefers"); | |
| 100 | |
| 101 // Environment variable inherited by an installer child process that indicates | |
| 102 // whether GoogleUpdate is running as user or machine. | |
| 103 const TCHAR* const kEnvVariableIsMachine = APP_NAME_IDENTIFIER _T("IsMachine"); | |
| 104 | |
| 105 // Registry values read from the Clients key for transmitting custom install | |
| 106 // errors, messages, etc. On an update, the InstallerXXX values are renamed to | |
| 107 // LastInstallerXXX values. The LastInstallerXXX values remain around until the | |
| 108 // next update. | |
| 109 const TCHAR* const kRegValueInstallerResult = _T("InstallerResult"); | |
| 110 const TCHAR* const kRegValueInstallerError = _T("InstallerError"); | |
| 111 const TCHAR* const kRegValueInstallerExtraCode1 = _T("InstallerExtraCode1"); | |
| 112 const TCHAR* const kRegValueInstallerResultUIString = | |
| 113 _T("InstallerResultUIString"); | |
| 114 const TCHAR* const kRegValueInstallerSuccessLaunchCmdLine = | |
| 115 _T("InstallerSuccessLaunchCmdLine"); | |
| 116 | |
| 117 const TCHAR* const kRegValueLastInstallerResult = | |
| 118 _T("LastInstallerResult"); | |
| 119 const TCHAR* const kRegValueLastInstallerError = | |
| 120 _T("LastInstallerError"); | |
| 121 const TCHAR* const kRegValueLastInstallerExtraCode1 = | |
| 122 _T("LastInstallerExtraCode1"); | |
| 123 const TCHAR* const kRegValueLastInstallerResultUIString = | |
| 124 _T("LastInstallerResultUIString"); | |
| 125 const TCHAR* const kRegValueLastInstallerSuccessLaunchCmdLine = | |
| 126 _T("LastInstallerSuccessLaunchCmdLine"); | |
| 127 | |
| 128 | |
| 129 // Registry subkey in an app's Clients key that contains its commands. | |
| 130 const TCHAR* const kCommandsRegKeyName = _T("Commands"); | |
| 131 | |
| 132 // Registry values read from the Clients commands key. | |
| 133 const TCHAR* const kRegValueCommandLine = _T("CommandLine"); | |
| 134 const TCHAR* const kRegValueSendsPings = _T("SendsPings"); | |
| 135 const TCHAR* const kRegValueWebAccessible = _T("WebAccessible"); | |
| 136 const TCHAR* const kRegValueReportingId = _T("ReportingId"); | |
| 137 | |
| 138 // Registry value in an app's Clients key that contains a registration update | |
| 139 // hook CLSID. | |
| 140 const TCHAR* const kRegValueUpdateHookClsid = _T("RegistrationUpdateHook"); | |
| 141 | |
| 142 // Registry values read from the Clients key and stored in the ClientState key. | |
| 143 const TCHAR* const kRegValueLanguage = _T("lang"); | |
| 144 const TCHAR* const kRegValueAppName = _T("name"); | |
| 145 const TCHAR* const kRegValueProductVersion = _T("pv"); | |
| 146 | |
| 147 // Registry values stored in the ClientState key. | |
| 148 const TCHAR* const kRegValueAdditionalParams = _T("ap"); | |
| 149 const TCHAR* const kRegValueBrandCode = _T("brand"); | |
| 150 const TCHAR* const kRegValueBrowser = _T("browser"); | |
| 151 const TCHAR* const kRegValueClientId = _T("client"); | |
| 152 const TCHAR* const kRegValueDidRun = _T("dr"); | |
| 153 const TCHAR* const kRegValueExperimentLabels = _T("experiment_labels"); | |
| 154 const TCHAR* const kRegValueInstallationId = _T("iid"); | |
| 155 const TCHAR* const kRegValueOemInstall = _T("oeminstall"); | |
| 156 const TCHAR* const kRegValueReferralId = _T("referral"); | |
| 157 | |
| 158 // This two registries hold client UTC timestamp of server's midnight of the day | |
| 159 // that last active ping/roll call happened. | |
| 160 const TCHAR* const kRegValueActivePingDayStartSec = _T("ActivePingDayStartSec"); | |
| 161 const TCHAR* const kRegValueRollCallDayStartSec = _T("RollCallDayStartSec"); | |
| 162 | |
| 163 // Registry values stored in the ClientState key related to Omaha's actions. | |
| 164 // A "successful check" means "noupdate" received from the server or an update | |
| 165 // was successfully applied. | |
| 166 const TCHAR* const kRegValueInstallTimeSec = _T("InstallTime"); | |
| 167 const TCHAR* const kRegValueLastSuccessfulCheckSec = _T("LastCheckSuccess"); | |
| 168 const TCHAR* const kRegValueLastUpdateTimeSec = _T("UpdateTime"); | |
| 169 | |
| 170 // Registry values stored in the ClientState or ClientStateMedium keys. | |
| 171 // Use accessor methods rather than reading them directly. | |
| 172 const TCHAR* const kRegValueEulaAccepted = _T("eulaaccepted"); | |
| 173 const TCHAR* const kRegValueUsageStats = _T("usagestats"); | |
| 174 | |
| 175 // Registry values stored in the ClientState key for Omaha's internal use. | |
| 176 const TCHAR* const kRegValueTTToken = _T("tttoken"); | |
| 177 const TCHAR* const kRegValueUpdateAvailableCount = _T("UpdateAvailableCount"); | |
| 178 const TCHAR* const kRegValueUpdateAvailableSince = _T("UpdateAvailableSince"); | |
| 179 | |
| 180 // Registry values stored in the Update key. | |
| 181 const TCHAR* const kRegValueDelayOmahaUninstall = _T("DelayUninstall"); | |
| 182 const TCHAR* const kRegValueOmahaEulaAccepted = _T("eulaaccepted"); | |
| 183 // TODO(omaha3): Consider renaming these if there is not a upgrade problem. | |
| 184 // If we can't consider moving all "gupdate" values to the customization file. | |
| 185 const TCHAR* const kRegValueServiceName = _T("omaha_service_name"); | |
| 186 const TCHAR* const kRegValueMediumServiceName = _T("omaham_service_name"); | |
| 187 const TCHAR* const kRegValueTaskNameC = _T("omaha_task_name_c"); | |
| 188 const TCHAR* const kRegValueTaskNameUA = _T("omaha_task_name_ua"); | |
| 189 const TCHAR* const kRegValueLastChecked = _T("LastChecked"); | |
| 190 const TCHAR* const kRegValueOemInstallTimeSec = _T("OemInstallTime"); | |
| 191 const TCHAR* const kRegValueCacheSizeLimitMBytes = _T("PackageCacheSizeLimit"); | |
| 192 const TCHAR* const kRegValueCacheLifeLimitDays = _T("PackageCacheLifeLimit"); | |
| 193 const TCHAR* const kRegValueInstalledPath = _T("path"); | |
| 194 const TCHAR* const kRegValueUserId = _T("uid"); | |
| 195 const TCHAR* const kRegValueSelfUpdateExtraCode1 = _T("UpdateCode1"); | |
| 196 const TCHAR* const kRegValueSelfUpdateErrorCode = _T("UpdateError"); | |
| 197 const TCHAR* const kRegValueSelfUpdateVersion = _T("UpdateVersion"); | |
| 198 const TCHAR* const kRegValueInstalledVersion = _T("version"); | |
| 199 | |
| 200 // TODO(omaha3): Consider moving all "gupdate" values to the customization file. | |
| 201 // Use a non-gupdate name for the new medium service. | |
| 202 const TCHAR* const kServicePrefix = _T("omaha"); | |
| 203 const TCHAR* const kMediumServicePrefix = _T("omaham"); | |
| 204 | |
| 205 const TCHAR* const kScheduledTaskNameUserPrefix = | |
| 206 APP_NAME_IDENTIFIER _T("TaskUser"); | |
| 207 const TCHAR* const kScheduledTaskNameMachinePrefix = | |
| 208 APP_NAME_IDENTIFIER _T("TaskMachine"); | |
| 209 const TCHAR* const kScheduledTaskNameCoreSuffix = _T("Core"); | |
| 210 const TCHAR* const kScheduledTaskNameUASuffix = _T("UA"); | |
| 211 | |
| 212 const TCHAR* const kServiceFileName = kOmahaShellFileName; | |
| 213 const char* const kGoopdateDllEntryAnsi = "DllEntry"; | |
| 214 | |
| 215 | |
| 216 // Event Id's used for reporting in the event log. | |
| 217 // Crash Report events. | |
| 218 const int kCrashReportEventId = 1; | |
| 219 const int kCrashUploadEventId = 2; | |
| 220 | |
| 221 // Update Check events. | |
| 222 const int kUpdateCheckEventId = 11; | |
| 223 const int kUpdateEventId = 12; | |
| 224 const int kUninstallEventId = 13; | |
| 225 const int kWorkerStartEventId = 14; | |
| 226 const int kDownloadEventId = 15; | |
| 227 | |
| 228 // Network Request events. | |
| 229 const int kNetworkRequestEventId = 20; | |
| 230 | |
| 231 // Maximum value the server can respond for elapsed_seconds attribute in | |
| 232 // <daystart ...> element. The value is one day plus an hour ("fall back" | |
| 233 // daylight savings). | |
| 234 const int kMaxTimeSinceMidnightSec = ((24 + 1) * 60 * 60); | |
| 235 | |
| 236 // Maximum time to keep the Installation ID. If the app was installed longer | |
| 237 // than this time ago, the Installation ID will be deleted regardless of | |
| 238 // whether the application has been run or not. | |
| 239 const int kMaxLifeOfInstallationIDSec = (7 * 24 * 60 * 60); // 7 days | |
| 240 | |
| 241 // Documented in the IDL for certain properties of ICurrentState. | |
| 242 const int kCurrentStateProgressUnknown = -1; | |
| 243 | |
| 244 // COM ProgIDs. | |
| 245 #define kProgIDUpdate3COMClassUser \ | |
| 246 APP_NAME_IDENTIFIER _T(".Update3COMClassUser") | |
| 247 #define kProgIDUpdate3COMClassService \ | |
| 248 APP_NAME_IDENTIFIER _T(".Update3COMClassService") | |
| 249 | |
| 250 const TCHAR* const kProgIDOnDemandUser = | |
| 251 APP_NAME_IDENTIFIER _T(".OnDemandCOMClassUser"); | |
| 252 #define kProgIDOnDemandMachine \ | |
| 253 APP_NAME_IDENTIFIER _T(".OnDemandCOMClassMachine") | |
| 254 const TCHAR* const kProgIDOnDemandMachineFallback = | |
| 255 APP_NAME_IDENTIFIER _T(".OnDemandCOMClassMachineFallback"); | |
| 256 const TCHAR* const kProgIDOnDemandSvc = | |
| 257 APP_NAME_IDENTIFIER _T(".OnDemandCOMClassSvc"); | |
| 258 | |
| 259 const TCHAR* const kProgIDUpdate3WebUser = | |
| 260 APP_NAME_IDENTIFIER _T(".Update3WebUser"); | |
| 261 #define kProgIDUpdate3WebMachine \ | |
| 262 APP_NAME_IDENTIFIER _T(".Update3WebMachine") | |
| 263 const TCHAR* const kProgIDUpdate3WebMachineFallback = | |
| 264 APP_NAME_IDENTIFIER _T(".Update3WebMachineFallback"); | |
| 265 const TCHAR* const kProgIDUpdate3WebSvc = | |
| 266 APP_NAME_IDENTIFIER _T(".Update3WebSvc"); | |
| 267 | |
| 268 const TCHAR* const kProgIDGoogleUpdateCoreService = | |
| 269 APP_NAME_IDENTIFIER _T(".CoreClass"); | |
| 270 const TCHAR* const kProgIDGoogleUpdateCoreMachine = | |
| 271 APP_NAME_IDENTIFIER _T(".CoreMachineClass"); | |
| 272 | |
| 273 const TCHAR* const kProgIDProcessLauncher = | |
| 274 APP_NAME_IDENTIFIER _T(".ProcessLauncher"); | |
| 275 | |
| 276 const TCHAR* const kProgIDOneClickProcessLauncherUser = | |
| 277 _T(SHORT_COMPANY_NAME_ANSI) _T(".OneClickProcessLauncherUser"); | |
| 278 const TCHAR* const kProgIDOneClickProcessLauncherMachine = | |
| 279 _T(SHORT_COMPANY_NAME_ANSI) _T(".OneClickProcessLauncherMachine"); | |
| 280 | |
| 281 const TCHAR* const kProgIDCoCreateAsync = | |
| 282 APP_NAME_IDENTIFIER _T(".CoCreateAsync"); | |
| 283 | |
| 284 const TCHAR* const kProgIDCredentialDialogUser = | |
| 285 APP_NAME_IDENTIFIER _T(".CredentialDialogUser"); | |
| 286 const TCHAR* const kProgIDCredentialDialogMachine = | |
| 287 APP_NAME_IDENTIFIER _T(".CredentialDialogMachine"); | |
| 288 | |
| 289 // Offline v3 manifest name. | |
| 290 const TCHAR* const kOfflineManifestFileName = _T("OfflineManifest.gup"); | |
| 291 | |
| 292 } // namespace omaha | |
| 293 | |
| 294 #endif // OMAHA_COMMON_CONST_GOOPDATE_H_ | |
| OLD | NEW |