OLD | NEW |
| (Empty) |
1 // Copyright 2003-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 // | |
17 // Constants used by Omaha project | |
18 | |
19 #ifndef OMAHA_BASE_CONSTANTS_H_ | |
20 #define OMAHA_BASE_CONSTANTS_H_ | |
21 | |
22 #include <windows.h> | |
23 #include <tchar.h> | |
24 | |
25 namespace omaha { | |
26 | |
27 // | |
28 // Begin vendor-specific constants. | |
29 // | |
30 // When adding values here or using these values for a constant, add a test for | |
31 // the value to common\omaha_customization_unittest.cc. | |
32 // NOTE: The following are defined in main.scons: | |
33 // + FULL_COMPANY_NAME_ANSI | |
34 // + SHORT_COMPANY_NAME_ANSI | |
35 // + PRODUCT_NAME_ANSI | |
36 // + COMPANY_DOMAIN_ANSI | |
37 // + MAIN_DLL_BASE_NAME_ANSI | |
38 // | |
39 // *_IDENTIFIER assume that SHORT_COMPANY_NAME_ANSI and PRODUCT_NAME_ANSI are | |
40 // legal identifiers (i.e. one word). | |
41 | |
42 // TODO(omaha3): Move vendor-specific constants to a single file to make use | |
43 // of open source code by other vendors simpler. | |
44 // TODO(omaha3): Only use very specific const variables outside that file. Do | |
45 // not build values in other source files by concatenating preprocessor defines. | |
46 | |
47 // Full company name. | |
48 // FULL_COMPANY_NAME == "Google Inc." | |
49 const TCHAR* const kFullCompanyName = _T(FULL_COMPANY_NAME_ANSI); | |
50 | |
51 // Short company name (for use in paths and messages and to combine with product | |
52 // name). Does not include "Inc." and similar formal parts of the company name. | |
53 // SHORT_COMPANY_NAME == "Google" | |
54 #define SHORT_COMPANY_NAME _T(SHORT_COMPANY_NAME_ANSI) | |
55 const TCHAR* const kShortCompanyName = SHORT_COMPANY_NAME; | |
56 | |
57 // Product name. | |
58 // PRODUCT_NAME == "Update" | |
59 #define PRODUCT_NAME _T(PRODUCT_NAME_ANSI) | |
60 | |
61 // Company domain name base. Used for MIME type names. | |
62 // COMPANY_DOMAIN_BASE_ANSI = "google" | |
63 #define COMPANY_DOMAIN_BASE _T(COMPANY_DOMAIN_BASE_ANSI) | |
64 | |
65 // Company domain name base. Used for addresses. | |
66 // COMPANY_DOMAIN_ANSI = "google.com" | |
67 #define COMPANY_DOMAIN _T(COMPANY_DOMAIN_ANSI) | |
68 | |
69 // Company's internal network DNS domain. Used for detecting internal users. | |
70 // If the internal network uses a different domain than the public-facing | |
71 // COMPANY_DOMAIN, this will need to be changed. | |
72 // kCompanyInternalDnsName = ".google.com" | |
73 const TCHAR* const kCompanyInternalDnsName = _T(".") COMPANY_DOMAIN; | |
74 | |
75 // Company's internal network NetBIOS name. Used for detecting internal users. | |
76 // If the internal network uses a different domain than the public-facing | |
77 // COMPANY_DOMAIN_BASE, this will need to be changed. | |
78 // kCompanyInternalLanGroupName = "google" | |
79 const TCHAR* const kCompanyInternalLanGroupName = COMPANY_DOMAIN_BASE; | |
80 | |
81 // The base name of the main executable. Everything except the ".exe". | |
82 // Most files start with the main .exe's base name. | |
83 // MAIN_EXE_BASE_NAME = "GoogleUpdate" | |
84 #define MAIN_EXE_BASE_NAME _T(MAIN_EXE_BASE_NAME_ANSI) | |
85 | |
86 // Base name of the main DLL. | |
87 // MAIN_DLL_BASE_NAME = "goopdate" | |
88 #define MAIN_DLL_BASE_NAME _T(MAIN_DLL_BASE_NAME_ANSI) | |
89 | |
90 // Application name. | |
91 // Use the localized IDS_PRODUCT_DISPLAY_NAME or the formatted | |
92 // IDS_INSTALLER_DISPLAY_NAME instead when string is displayed to user. | |
93 // kAppName == "Google Update" | |
94 // TODO(omaha): Maybe rename all of these kOmahaAppName. | |
95 const TCHAR* const kAppName = _T(OMAHA_APP_NAME_ANSI); | |
96 | |
97 #define COMPANY_NAME_IDENTIFIER SHORT_COMPANY_NAME | |
98 #define PRODUCT_NAME_IDENTIFIER PRODUCT_NAME | |
99 #define APP_NAME_IDENTIFIER SHORT_COMPANY_NAME PRODUCT_NAME | |
100 | |
101 // Prefix for any Win32 objects (mutexes, events, etc.). | |
102 // TODO(omaha): This is used by several files in base/. Maybe we can use a | |
103 // similar prefix to avoid conflicts with some values in const_object_names.h. | |
104 // Consider moving this constant to const_object_names.h. | |
105 #define kLockPrefix \ | |
106 _T("_") COMPANY_NAME_IDENTIFIER _T("_") PRODUCT_NAME_IDENTIFIER _T("_") | |
107 | |
108 const TCHAR* const kOmahaShellFileName = MAIN_EXE_BASE_NAME _T(".exe"); | |
109 const TCHAR* const kCrashHandlerFileName = CRASH_HANDLER_NAME _T(".exe"); | |
110 const TCHAR* const kOmahaDllName = MAIN_DLL_BASE_NAME _T(".dll"); | |
111 const TCHAR* const kOmahaResourceDllNameFormat = | |
112 MAIN_DLL_BASE_NAME _T("res_%s.dll"); | |
113 const TCHAR* const kOmahaBrokerFileName = | |
114 MAIN_EXE_BASE_NAME _T("Broker.exe"); | |
115 const TCHAR* const kOmahaOnDemandFileName = | |
116 MAIN_EXE_BASE_NAME _T("OnDemand.exe"); | |
117 const TCHAR* const kPSFileNameMachine = _T("psmachine.dll"); | |
118 const TCHAR* const kPSFileNameUser = _T("psuser.dll"); | |
119 | |
120 // TODO(omaha): Replace the following literal in clickonce\build.scons. | |
121 // '%s/GoogleUpdateSetup.exe' | |
122 | |
123 // These must be in sync with the WiX files. | |
124 // TODO(omaha): Make these constants in main.scons and use them in the .wxs | |
125 // files, kMsiUninstallKey, and elsewhere this GUID appears. | |
126 const TCHAR* const kHelperInstallerName = MAIN_EXE_BASE_NAME _T("Helper.msi"); | |
127 const TCHAR* const kHelperInstallerProductGuid = | |
128 _T("{A92DAB39-4E2C-4304-9AB6-BC44E68B55E2}"); | |
129 const TCHAR* const kHelperPatchName = MAIN_EXE_BASE_NAME _T("HelperPatch.msp"); | |
130 const TCHAR* const kHelperPatchGuid = | |
131 _T("{E0D0D2C9-5836-4023-AB1D-54EC3B90AD03}"); | |
132 | |
133 // The value that is used in the run key. | |
134 const TCHAR* const kRunValueName = kAppName; | |
135 | |
136 // The company and organization names as expected in Authenticode certificates. | |
137 const TCHAR* const kCertificateSubjectName = _T("Google Inc"); | |
138 | |
139 // TODO(omaha): Try to use the above constants in the IDL file help strings. | |
140 // TODO(omaha): Consider moving uuid's from the IDL files to here too. | |
141 // TODO(omaha): Use these values for the registry maps definitions, and progid | |
142 // uses, such as ondemand.h. | |
143 | |
144 // | |
145 // Omaha's app ID | |
146 // | |
147 // TODO(omaha): Rename all of these "Omaha". | |
148 #define GOOPDATE_APP_ID _T("{430FD4D0-B729-4F61-AA34-91526481799D}") | |
149 const TCHAR* const kGoogleUpdateAppId = GOOPDATE_APP_ID; | |
150 const GUID kGoopdateGuid = {0x430FD4D0, 0xB729, 0x4F61, | |
151 {0xAA, 0x34, 0x91, 0x52, 0x64, 0x81, 0x79, 0x9D}}; | |
152 | |
153 // | |
154 // Directory names | |
155 // | |
156 #define OFFLINE_DIR_NAME _T("Offline") | |
157 | |
158 #define OMAHA_REL_COMPANY_DIR SHORT_COMPANY_NAME | |
159 #define OMAHA_REL_CRASH_DIR OMAHA_REL_COMPANY_DIR _T("\\CrashReports") | |
160 #define OMAHA_REL_GOOPDATE_INSTALL_DIR \ | |
161 OMAHA_REL_COMPANY_DIR _T("\\") PRODUCT_NAME | |
162 #define OMAHA_REL_LOG_DIR OMAHA_REL_GOOPDATE_INSTALL_DIR _T("\\Log") | |
163 #define OMAHA_REL_OFFLINE_STORAGE_DIR \ | |
164 OMAHA_REL_GOOPDATE_INSTALL_DIR _T("\\") OFFLINE_DIR_NAME | |
165 #define OMAHA_REL_DOWNLOAD_STORAGE_DIR \ | |
166 OMAHA_REL_GOOPDATE_INSTALL_DIR _T("\\Download") | |
167 #define OMAHA_REL_INSTALL_WORKING_DIR \ | |
168 OMAHA_REL_GOOPDATE_INSTALL_DIR _T("\\Install") | |
169 | |
170 // This directory is relative to the user profile app data local. | |
171 #define LOCAL_APPDATA_REL_TEMP_DIR _T("\\Temp") | |
172 | |
173 // | |
174 // Registry keys and values | |
175 // | |
176 #define MACHINE_KEY_NAME _T("HKLM") | |
177 #define MACHINE_KEY MACHINE_KEY_NAME _T("\\") | |
178 #define USER_KEY_NAME _T("HKCU") | |
179 #define USER_KEY USER_KEY_NAME _T("\\") | |
180 #define USERS_KEY _T("HKU\\") | |
181 #define COMPANY_MAIN_KEY _T("Software\\") SHORT_COMPANY_NAME _T("\\") | |
182 #define GOOPDATE_MAIN_KEY COMPANY_MAIN_KEY PRODUCT_NAME _T("\\") | |
183 #define GOOPDATE_REG_RELATIVE_CLIENTS GOOPDATE_MAIN_KEY _T("Clients\\") | |
184 #define GOOPDATE_REG_RELATIVE_CLIENT_STATE GOOPDATE_MAIN_KEY _T("ClientState\\") | |
185 #define GOOPDATE_REG_RELATIVE_CLIENT_STATE_MEDIUM \ | |
186 GOOPDATE_MAIN_KEY _T("ClientStateMedium\\") | |
187 #define COMPANY_POLICIES_MAIN_KEY \ | |
188 _T("Software\\Policies\\") SHORT_COMPANY_NAME _T("\\") | |
189 #define GOOPDATE_POLICIES_RELATIVE COMPANY_POLICIES_MAIN_KEY \ | |
190 PRODUCT_NAME _T("\\") | |
191 | |
192 #define USER_REG_GOOGLE USER_KEY COMPANY_MAIN_KEY | |
193 #define USER_REG_UPDATE USER_KEY GOOPDATE_MAIN_KEY | |
194 #define USER_REG_CLIENTS USER_KEY GOOPDATE_REG_RELATIVE_CLIENTS | |
195 #define USER_REG_CLIENTS_GOOPDATE USER_REG_CLIENTS GOOPDATE_APP_ID | |
196 #define USER_REG_CLIENT_STATE USER_KEY GOOPDATE_REG_RELATIVE_CLIENT_STATE | |
197 #define USER_REG_CLIENT_STATE_GOOPDATE USER_REG_CLIENT_STATE GOOPDATE_APP_ID | |
198 | |
199 #define MACHINE_REG_GOOGLE MACHINE_KEY COMPANY_MAIN_KEY | |
200 #define MACHINE_REG_UPDATE MACHINE_KEY GOOPDATE_MAIN_KEY | |
201 #define MACHINE_REG_CLIENTS MACHINE_KEY GOOPDATE_REG_RELATIVE_CLIENTS | |
202 #define MACHINE_REG_CLIENTS_GOOPDATE MACHINE_REG_CLIENTS GOOPDATE_APP_ID | |
203 #define MACHINE_REG_CLIENT_STATE MACHINE_KEY GOOPDATE_REG_RELATIVE_CLIENT_STATE | |
204 #define MACHINE_REG_CLIENT_STATE_GOOPDATE \ | |
205 MACHINE_REG_CLIENT_STATE GOOPDATE_APP_ID | |
206 #define MACHINE_REG_CLIENT_STATE_MEDIUM \ | |
207 MACHINE_KEY GOOPDATE_REG_RELATIVE_CLIENT_STATE_MEDIUM | |
208 | |
209 // Expands to HKEY_LOCAL_MACHINE\SOFTWARE\Google\UpdateDev | |
210 #define MACHINE_REG_UPDATE_DEV \ | |
211 MACHINE_KEY COMPANY_MAIN_KEY PRODUCT_NAME _T("Dev\\") | |
212 | |
213 // Regular expressions for the servers allowed to use the Omaha plugins. | |
214 const TCHAR* const kSiteLockPatternStrings[] = { | |
215 _T("^(gears)|(mail)|(tools)|(www)|(desktop)|(pack)\\.google\\.com$"), | |
216 _T("^www\\.google\\.(ad)|(bg)|(ca)|(cn)|(cz)|(de)|(es)|(fi)|(fr)|(gr)|(hr)|(hu
)|(it)|(ki)|(kr)|(lt)|(lv)|(nl)|(no)|(pl)|(pt)|(ro)|(ru)|(sk)|(sg)|(sl)|(sr)|(vn
)$"), // NOLINT | |
217 _T("^www\\.google\\.co\\.(hu)|(id)|(il)|(it)|(jp)|(kr)|(th)|(uk)$"), | |
218 _T("^www\\.google\\.com\\.(ar)|(au)|(br)|(cn)|(et)|(gr)|(hr)|(ki)|(lv)|(om)|(p
l)|(pt)|(ru)|(sg)|(sv)|(tr)|(vn)$"), // NOLINT | |
219 }; | |
220 | |
221 // | |
222 // Compatible shell versions | |
223 // The following shell versions are compatible with the current version of | |
224 // goopdate.dll and do not need be replaced: 1.2.131.7 and 1.2.183.9. | |
225 // | |
226 const ULONGLONG kCompatibleOlderShellVersions[] = { 0x0001000200830007, | |
227 0x0001000200B70009, | |
228 }; | |
229 | |
230 // | |
231 // End vendor-specific constants. | |
232 // | |
233 | |
234 // | |
235 // Registry values under MACHINE_REG_UPDATE_DEV allow customization of the | |
236 // default behavior. The overrides apply for both user and machine | |
237 // instances of omaha. | |
238 // | |
239 // The values below can only be overriden in debug builds. | |
240 const TCHAR* const kRegValueNameOverInstall = _T("OverInstall"); | |
241 const TCHAR* const kRegValueNameCrashIfSpecificError | |
242 = _T("CrashIfSpecificError"); | |
243 | |
244 // The values below can be overriden in both debug and opt builds. Code Red url | |
245 // can be overriden but its value is defined in the Code Red module. The value | |
246 // name is "CodeRedUrl". | |
247 const TCHAR* const kRegValueNameUrl = _T("url"); | |
248 const TCHAR* const kRegValueNamePingUrl = _T("PingUrl"); | |
249 const TCHAR* const kRegValueNameCrashReportUrl = _T("CrashReportUrl"); | |
250 const TCHAR* const kRegValueNameGetMoreInfoUrl = _T("MoreInfoUrl"); | |
251 const TCHAR* const kRegValueNameUsageStatsReportUrl = _T("UsageStatsReportUrl"); | |
252 const TCHAR* const kRegValueTestSource = _T("TestSource"); | |
253 const TCHAR* const kRegValueAuCheckPeriodMs = _T("AuCheckPeriodMs"); | |
254 const TCHAR* const kRegValueCrCheckPeriodMs = _T("CrCheckPeriodMs"); | |
255 const TCHAR* const kRegValueProxyHost = _T("ProxyHost"); | |
256 const TCHAR* const kRegValueProxyPort = _T("ProxyPort"); | |
257 const TCHAR* const kRegValueMID = _T("mid"); | |
258 | |
259 // The values below can be overriden in unofficial builds. | |
260 const TCHAR* const kRegValueNameWindowsInstalling = _T("WindowsInstalling"); | |
261 | |
262 // Allows Omaha to log events in the Windows Event Log. This is | |
263 // a DWORD value 0: Log nothing, 1: Log warnings and errors, 2: Log everything. | |
264 const TCHAR* const kRegValueEventLogLevel = _T("LogEventLevel"); | |
265 | |
266 enum LogEventLevel { | |
267 LOG_EVENT_LEVEL_NONE = 0, | |
268 LOG_EVENT_LEVEL_WARN_AND_ERROR = 1, | |
269 LOG_EVENT_LEVEL_ALL = 2 | |
270 }; | |
271 | |
272 // How often Omaha checks the server for updates. | |
273 const TCHAR* const kRegValueLastCheckPeriodSec = _T("LastCheckPeriodSec"); | |
274 | |
275 // Uses the production or the test cup keys. Once the client has negotiated | |
276 // CUP credentials {sk, c} and it has saved them under the corresponding | |
277 // Google\Update\network key then the client does not need any of the CUP keys. | |
278 // To force the client to use test or production keys, {sk, c} credentials must | |
279 // be cleared too. | |
280 const TCHAR* const kRegValueCupKeys = _T("TestKeys"); | |
281 | |
282 // Allow a custom host pattern to be specified. For example, | |
283 // "^https?://some_test_server\.google\.com/". For other examples, see | |
284 // kSiteLockPatternStrings. The detailed regular expression syntax is documented | |
285 // in the MSDN documentation for the CAtlRegExp class: | |
286 // http://msdn.microsoft.com/en-us/library/k3zs4axe.aspx. | |
287 const TCHAR* const kRegValueOneClickHostPattern = _T("OneClickHostPattern"); | |
288 | |
289 // Disables the Code Red check. | |
290 const TCHAR* const kRegValueNoCodeRedCheck = _T("NoCrCheck"); | |
291 | |
292 // Enables sending usage stats always if the value is present. | |
293 const TCHAR* const kRegValueForceUsageStats = _T("UsageStats"); | |
294 | |
295 // Enables crash uploads if the value is 1. Crashes can be uploaded only if | |
296 // certain conditions are met. This value allows overriding of the default | |
297 // crash uploading behavior. | |
298 const TCHAR* const kRegValueAlwaysAllowCrashUploads = | |
299 _T("AlwaysAllowCrashUploads"); | |
300 | |
301 // Enables monitoring the 'LastChecked' value for testing purposes. When | |
302 // the 'LastChecked' is deleted, the core starts a worker process to do an | |
303 // update check. This value must be set before the core process starts. | |
304 const TCHAR* const kRegValueMonitorLastChecked = _T("MonitorLastChecked"); | |
305 | |
306 // The test_source value to use for Omaha instances that have | |
307 // customizations, and hence should be discarded from metrics. | |
308 const TCHAR* const kRegValueTestSourceAuto = _T("auto"); | |
309 | |
310 // The network configuration to override the network detection. | |
311 // The corresponding value must have the following format: | |
312 // wpad=[false|true];script=script_url;proxy=host:port | |
313 const TCHAR* const kRegValueNetConfig = _T("NetConfig"); | |
314 | |
315 // The maximum length of application and bundle names. | |
316 const int kMaxNameLength = 512; | |
317 | |
318 // Specifies whether a tristate item has a value and if so what the value is. | |
319 enum Tristate { | |
320 TRISTATE_FALSE, | |
321 TRISTATE_TRUE, | |
322 TRISTATE_NONE | |
323 }; | |
324 | |
325 // Number of periods to use when abbreviating URLs | |
326 #define kAbbreviationPeriodLength 3 | |
327 | |
328 // The Unicode "Byte Order Marker" character. This is the native | |
329 // encoding, i.e. after conversion from UTF-8 or whatever. | |
330 const wchar_t kUnicodeBom = 0xFEFF; | |
331 | |
332 // Using these constants will make ATL load the | |
333 // typelib directly from a DLL instead of looking up typelib | |
334 // registration in registry. | |
335 const DWORD kMajorTypeLibVersion = 0xFFFF; | |
336 const DWORD kMinorTypeLibVersion = 0xFFFF; | |
337 | |
338 // Brand id length | |
339 const int kBrandIdLength = 4; | |
340 | |
341 // Country code length according to ISO 3166-3. | |
342 const int kCountryCodeMaxLength = 5; | |
343 | |
344 // Language code length. | |
345 const int kLangMaxLength = 10; | |
346 | |
347 // When not specified, the country code defaults to USA | |
348 const TCHAR* const kDefaultCountryCode = _T("us"); | |
349 | |
350 // the max length of the extra info we can store inside the install stubs. | |
351 const int kExtraMaxLength = 64 * 1024; // 64 KB | |
352 | |
353 // Default brand code value when one is not specified. | |
354 // This has been specifically assigned to Omaha. | |
355 const TCHAR* const kDefaultGoogleUpdateBrandCode = _T("GGLS"); | |
356 | |
357 // The platform named used for Windows. | |
358 const TCHAR* const kPlatformWin = _T("win"); | |
359 | |
360 // TODO(omaha3): Move goopdate-specific values in this file to const_goopdate.h. | |
361 // Maybe there should be a const_server_api.h file so the server API is | |
362 // documented in one location. | |
363 | |
364 // The following are response strings returned by the server. | |
365 // They must exactly match the strings returned by the server. | |
366 const TCHAR* const kResponseStatusOkValue = _T("ok"); | |
367 const TCHAR* const kResponseStatusNoUpdate = _T("noupdate"); | |
368 const TCHAR* const kResponseStatusRestrictedExportCountry = _T("restricted"); | |
369 const TCHAR* const kResponseStatusOsNotSupported = _T("error-osnotsupported"); | |
370 const TCHAR* const kResponseStatusUnKnownApplication = | |
371 _T("error-UnKnownApplication"); | |
372 const TCHAR* const kResponseStatusInternalError = _T("error-internal"); | |
373 const TCHAR* const kResponseStatusHashError = _T("error-hash"); | |
374 const TCHAR* const kResponseStatusUnsupportedProtocol = | |
375 _T("error-unsupportedprotocol"); | |
376 const TCHAR* const kResponseDataStatusNoData = _T("error-nodata"); | |
377 | |
378 const TCHAR* const kLocalSystemSid = _T("S-1-5-18"); | |
379 | |
380 // Time-related constants for defining durations. | |
381 const int kMsPerSec = 1000; | |
382 const int kSecPerMin = 60; | |
383 const int kMinPerHour = 60; | |
384 const int kSecondsPerHour = 60 * 60; | |
385 const int kSecondsPerDay = 24 * kSecondsPerHour; | |
386 | |
387 // Defines LastCheckPeriodSec: the time interval between actual server | |
388 // update checks. Opt builds have an aggressive check for updates every 5 hours. | |
389 // This introduces some time shift for computers connected all the time, for | |
390 // example, the update checks occur at: 12, 17, 22, 3, 8, 13, 18, etc... | |
391 // | |
392 // Since time computation for LastChecked is done in seconds, sometimes it | |
393 // can miss an update check, depending on arithmetic truncations. | |
394 // Adjust down the LastCheckPeriod so that the update worker does not miss it. | |
395 // | |
396 // Almost 5 hours for production users and almost hourly for internal users. | |
397 const int kLastCheckPeriodSec = 5 * 59 * kMinPerHour; | |
398 const int kLastCheckPeriodInternalUserSec = 1 * 59 * kMinPerHour; | |
399 | |
400 | |
401 const int kMinLastCheckPeriodSec = 60; // 60 seconds minimum. | |
402 | |
403 // Defines the time interval when the core is kicking off silent workers. When | |
404 // there is nothing to do, a worker does not take more than 200 ms to run. | |
405 // Internal users are supposed to update at least once every hour. Therefore, | |
406 // start workers every 30 minutes. | |
407 const int kAUCheckPeriodMs = 60 * 60 * 1000; // Hourly. | |
408 const int kAUCheckPeriodInternalUserMs = 30 * 60 * 1000; // 30 minutes. | |
409 | |
410 // Avoids starting workers too soon. This helps reduce disk thrashing at | |
411 // boot or logon, as well as needlessly starting a worker after setting up. | |
412 const int kUpdateTimerStartupDelayMinMs = 5 * 60 * 1000; // 5 minutes. | |
413 | |
414 // Maximum amount of time to wait before starting an update worker. | |
415 const int kUpdateTimerStartupDelayMaxMs = 15 * 60 * 1000; // 15 minutes. | |
416 | |
417 // Minimum AU check interval is lowered to 3 seconds to speed up test | |
418 // automation. | |
419 const int kMinAUCheckPeriodMs = 1000 * 3; // 3 seconds. | |
420 | |
421 // The Code Red check frequency. | |
422 const int kCodeRedCheckPeriodMs = 24 * 60 * 60 * 1000; // 24 hours. | |
423 const int kMinCodeRedCheckPeriodMs = 60 * 1000; // 1 minute. | |
424 | |
425 // The minimum amount of time after a /oem install that Omaha is considered to | |
426 // be in OEM mode regardless of audit mode. | |
427 const int kMinOemModeSec = 72 * 60 * 60; // 72 hours. | |
428 | |
429 // The amount of time to wait for the setup lock before giving up. | |
430 const int kSetupLockWaitMs = 1000; // 1 second. | |
431 | |
432 // The amount of time to wait for other instances to shutdown before giving up. | |
433 const int kSetupInstallShutdownWaitMs = 45 * 1000; // 45 seconds. | |
434 const int kSetupUpdateShutdownWaitMs = 3 * 60 * 1000; // 3 minutes. | |
435 | |
436 // Time to wait for the busy MSI when uninstalling. If MSI is found busy, | |
437 // Omaha won't uninstall. The timeout should be high enough so that it allows | |
438 // a normal application uninstall to finish and trigger an Omaha uninstall | |
439 // when needed. | |
440 const int kWaitForMSIExecuteMs = 5 * 60000; // 5 minutes. | |
441 | |
442 // Name of the language key-value pair inside the version resource. | |
443 const TCHAR* const kLanguageVersionName = _T("LanguageId"); | |
444 | |
445 // Group name to use to read/write INI files for custom crash client info. | |
446 const TCHAR* const kCustomClientInfoGroup = _T("ClientCustomData"); | |
447 | |
448 // *** *** | |
449 // *** Custom HTTP request headers sent by Omaha. *** | |
450 // *** *** | |
451 const TCHAR* const kHeaderUserAgent = _T("User-Agent"); | |
452 | |
453 // The HRESULT and HTTP status code updated by the prior | |
454 // NetworkRequestImpl::DoSendHttpRequest() call. | |
455 const TCHAR* const kHeaderXLastHR = _T("X-Last-HR"); | |
456 const TCHAR* const kHeaderXLastHTTPStatusCode = _T("X-Last-HTTP-Status-Code"); | |
457 | |
458 // The "mid" value if it exists in HKLM\SOFTWARE\Google\UpdateDev. | |
459 const TCHAR* const kHeaderXMID = _T("X-MID"); | |
460 | |
461 // The 407 retry count in the case of authenticated proxies. | |
462 const TCHAR* const kHeaderXProxyRetryCount = _T("X-Proxy-Retry-Count"); | |
463 | |
464 // Indicates that we had to prompt the user for proxy credentials. | |
465 const TCHAR* const kHeaderXProxyManualAuth = _T("X-Proxy-Manual-Auth"); | |
466 | |
467 // The age in seconds between the current time and when a ping was first | |
468 // persisted. | |
469 const TCHAR* const kHeaderXRequestAge = _T("X-RequestAge"); | |
470 | |
471 // The current retry count defined by the outermost | |
472 // NetworkRequestImpl::DoSendWithRetries() call. | |
473 const TCHAR* const kHeaderXRetryCount = _T("X-Retry-Count"); | |
474 | |
475 } // namespace omaha | |
476 | |
477 #endif // OMAHA_BASE_CONSTANTS_H_ | |
OLD | NEW |