| 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 // Constants used as command line arguments. | |
| 17 | |
| 18 #ifndef OMAHA_COMMON_CONST_CMD_LINE_H__ | |
| 19 #define OMAHA_COMMON_CONST_CMD_LINE_H__ | |
| 20 | |
| 21 namespace omaha { | |
| 22 | |
| 23 // | |
| 24 // Externally initiated modes. | |
| 25 // These modes are invoked by or on metainstallers or by the OneClick plugin . | |
| 26 // | |
| 27 | |
| 28 // The "install" switch indicates installing Omaha and the app. | |
| 29 const TCHAR* const kCmdLineInstall = _T("install"); | |
| 30 | |
| 31 // The "installelevated" switch indicates installing after elevating. | |
| 32 const TCHAR* const kCmdLineInstallElevated = _T("installelevated"); | |
| 33 | |
| 34 // The "update" switch indicates an Omaha self-update. | |
| 35 const TCHAR* const kCmdLineUpdate = _T("update"); | |
| 36 | |
| 37 // The "recover" switch indicates Omaha is to be repaired due to a | |
| 38 // Code Red scenario. | |
| 39 const TCHAR* const kCmdLineRecover = _T("recover"); | |
| 40 | |
| 41 // The "pi" switch indicates that this came from a webplugin. | |
| 42 // Requires two subarguments "siteurl" and "{args}" where | |
| 43 // siteurl is the base URL where the plugin ran from and {args} | |
| 44 // are the args to pass on once validation is complete. | |
| 45 const TCHAR* const kCmdLineWebPlugin = _T("pi"); | |
| 46 | |
| 47 // | |
| 48 // Main operating modes | |
| 49 // | |
| 50 | |
| 51 // The "c" option indicates a core process. | |
| 52 const TCHAR* const kCmdLineCore = _T("c"); | |
| 53 | |
| 54 // Specifies to not kick off the crash handler from the Core. | |
| 55 const TCHAR* const kCmdLineNoCrashHandler = _T("nocrashserver"); | |
| 56 | |
| 57 // The "crashhandler" option indicates a crash handler process. | |
| 58 const TCHAR* const kCmdLineCrashHandler = _T("crashhandler"); | |
| 59 | |
| 60 // Types of "Workers" | |
| 61 | |
| 62 // The "handoff" switch indicates a worker to perform an interactive install of | |
| 63 // an application. | |
| 64 const TCHAR* const kCmdLineAppHandoffInstall = _T("handoff"); | |
| 65 | |
| 66 // The "ig" switch was used in Omaha 2 to indicate a worker to finish installing | |
| 67 // Omaha and perform an interactive install of an application. | |
| 68 // ig = Install Google Update. | |
| 69 const TCHAR* const kCmdLineLegacyFinishGoogleUpdateInstall = _T("ig"); | |
| 70 | |
| 71 // The "ua" switch indicates a worker to perform an update check for all | |
| 72 // applications. | |
| 73 // ua = Update Applications. | |
| 74 const TCHAR* const kCmdLineUpdateApps = _T("ua"); | |
| 75 | |
| 76 // The "cr" switch indicates that the worker has been invoked to perform a Code | |
| 77 // Red check. | |
| 78 const TCHAR* const kCmdLineCodeRedCheck = _T("cr"); | |
| 79 | |
| 80 // The "registerproduct" switch will register a product GUID in Clients and | |
| 81 // install only Omaha. | |
| 82 const TCHAR* const kCmdLineRegisterProduct = _T("registerproduct"); | |
| 83 | |
| 84 // The "unregisterproduct" switch will unregister a product GUID from Clients. | |
| 85 const TCHAR* const kCmdLineUnregisterProduct = _T("unregisterproduct"); | |
| 86 | |
| 87 // | |
| 88 // Minor modes | |
| 89 // | |
| 90 | |
| 91 // The "svc" switch indicates that Omaha runs as a service that only accepts | |
| 92 // calls from high integrity COM callers. | |
| 93 const TCHAR* const kCmdLineService = _T("svc"); | |
| 94 | |
| 95 // The "medsvc" switch indicates that Omaha runs as a service that accepts | |
| 96 // calls from medium integrity COM callers. | |
| 97 const TCHAR* const kCmdLineMediumService = _T("medsvc"); | |
| 98 | |
| 99 // The "regsvc" switch is used to register the service. Only used by unit | |
| 100 // tests at the moment. | |
| 101 const TCHAR* const kCmdLineRegisterService = _T("regsvc"); | |
| 102 | |
| 103 // The "unregsvc" switch is used to unregister the service. Only used by | |
| 104 // unit tests at the moment. | |
| 105 const TCHAR* const kCmdLineUnregisterService = _T("unregsvc"); | |
| 106 | |
| 107 // The "/comsvc" switch indicates that has the service is being invoked via COM. | |
| 108 // This switch will be passed in via ServiceParameters. | |
| 109 const TCHAR* const kCmdLineServiceComServer = _T("/comsvc"); | |
| 110 | |
| 111 // The "regserver" switch indicates that Omaha should do its Windows | |
| 112 // service COM server registration including coclasses and its APPID. | |
| 113 const TCHAR* const kCmdRegServer = _T("regserver"); | |
| 114 | |
| 115 // The "unregserver" switch indicates that Omaha should undo its | |
| 116 // COM registration. | |
| 117 const TCHAR* const kCmdUnregServer = _T("unregserver"); | |
| 118 | |
| 119 // The "report" switch makes Omaha upload the crash report. | |
| 120 const TCHAR* const kCmdLineReport = _T("report"); | |
| 121 | |
| 122 // The "custom_info_filename" switch specifies the file that contains custom | |
| 123 // crash info. | |
| 124 const TCHAR* const kCmdLineCustomInfoFileName = _T("custom_info_filename"); | |
| 125 | |
| 126 // The "Embedding" switch indicates that the worker has been invoked to launch | |
| 127 // the browser. The -Embedding switch is automatically added by COM when | |
| 128 // launching the COM server. | |
| 129 const TCHAR* const kCmdLineComServer = _T("Embedding"); | |
| 130 const TCHAR* const kCmdLineComServerDash = _T("-Embedding"); | |
| 131 | |
| 132 // Activates broker mode. Broker mode is intended to facilitate communication | |
| 133 // between low-integrity clients and the high-integrity Omaha DCOM service. | |
| 134 const TCHAR* const kCmdLineComBroker = _T("/broker"); | |
| 135 | |
| 136 // Activates OnDemand mode. | |
| 137 const TCHAR* const kCmdLineOnDemand = _T("/ondemand"); | |
| 138 | |
| 139 // The "uninstall" switch indicates that Omaha should uninstall if appropriate. | |
| 140 const TCHAR* const kCmdLineUninstall = _T("uninstall"); | |
| 141 | |
| 142 // The "ping" switch makes Omaha send a ping with the specified string. The | |
| 143 // string is expected to be web safe base64 encoded and it will be decoded | |
| 144 // before sending it to the server. | |
| 145 const TCHAR* const kCmdLinePing = _T("ping"); | |
| 146 | |
| 147 // | |
| 148 // Non-product modes | |
| 149 // These are used for debug, testing, etc. | |
| 150 // | |
| 151 | |
| 152 // Run network diagnostics. | |
| 153 const TCHAR* const kCmdLineNetDiags = _T("netdiags"); | |
| 154 | |
| 155 // The "crash" switch indicates that Omaha should crash upon startup. | |
| 156 // This option is used to test the crash reporting system. | |
| 157 const TCHAR* const kCmdLineCrash = _T("crash"); | |
| 158 | |
| 159 // | |
| 160 // Parameters for other modes | |
| 161 // | |
| 162 | |
| 163 // The "silent" switch specifies that normally interactive modes should run | |
| 164 // silently. | |
| 165 const TCHAR* const kCmdLineSilent = _T("silent"); | |
| 166 | |
| 167 const TCHAR* const kCmdLineLegacyOfflineInstall = _T("offlineinstall"); | |
| 168 const TCHAR* const kCmdLineOfflineDir = _T("offlinedir"); | |
| 169 | |
| 170 // The "oem" switch specifies that this is an OEM install in Sysprep mode in an | |
| 171 // OEM factory. | |
| 172 const TCHAR* const kCmdLineOem = _T("oem"); | |
| 173 | |
| 174 // The "eularequired" switch specifies that a EULA must be accepted before | |
| 175 // checking for updates or pinging. | |
| 176 const TCHAR* const kCmdLineEulaRequired = _T("eularequired"); | |
| 177 | |
| 178 // The "machine" switch specifies to repair machine Omaha when specified with | |
| 179 // "recover". Also used to tell the setup phase 2 worker to do a machine install | |
| 180 // when doing a recover setup. | |
| 181 const TCHAR* const kCmdLineMachine = _T("machine"); | |
| 182 | |
| 183 // The "i" switch indicates that the crash has happend in an | |
| 184 // interactive process which has a UI up. The switch is an option for | |
| 185 // the "report" switch. | |
| 186 const TCHAR* const kCmdLineInteractive = _T("i"); | |
| 187 | |
| 188 // The "sessionid" switch indicates that a specific session ID should be used by | |
| 189 // this instance of Omaha for network requests. This switch is an option for | |
| 190 // the "install", "handoff", and "update" modes. | |
| 191 const TCHAR* const kCmdLineSessionId = _T("sessionid"); | |
| 192 | |
| 193 // The "installsource" switch that is used to pass the source of installation | |
| 194 // for ping tracking. For example: "/installsource OneClick". | |
| 195 const TCHAR* const kCmdLineInstallSource = _T("installsource"); | |
| 196 | |
| 197 // installsource values generated internally by Omaha. | |
| 198 const TCHAR* const kCmdLineInstallSource_TaggedMetainstaller = _T("taggedmi"); | |
| 199 const TCHAR* const kCmdLineInstallSource_OneClick = _T("oneclick"); | |
| 200 const TCHAR* const kCmdLineInstallSource_ClickOnce = _T("clickonce"); | |
| 201 const TCHAR* const kCmdLineInstallSource_Offline = _T("offline"); | |
| 202 const TCHAR* const kCmdLineInstallSource_InstallDefault = _T("otherinstallcmd"); | |
| 203 const TCHAR* const kCmdLineInstallSource_Scheduler = _T("scheduler"); | |
| 204 const TCHAR* const kCmdLineInstallSource_Core = _T("core"); | |
| 205 const TCHAR* const kCmdLineInstallSource_OnDemandUpdate = _T("ondemandupdate"); | |
| 206 const TCHAR* const kCmdLineInstallSource_OnDemandCheckForUpdate = | |
| 207 _T("ondemandcheckforupdate"); | |
| 208 const TCHAR* const kCmdLineInstallSource_OnDemandUA = _T("ondemandua"); | |
| 209 const TCHAR* const kCmdLineInstallSource_SelfUpdate = _T("selfupdate"); | |
| 210 const TCHAR* const kCmdLineInstallSource_Update3Web = _T("update3web"); | |
| 211 const TCHAR* const kCmdLineInstallSource_Update3Web_NewApps = | |
| 212 _T("update3web-newapps"); | |
| 213 const TCHAR* const kCmdLineInstallSource_Update3Web_OnDemand = | |
| 214 _T("update3web-ondemand"); | |
| 215 const TCHAR* const kCmdLineInstallSource_Update3Web_Components = | |
| 216 _T("update3web-components"); | |
| 217 | |
| 218 // This install source is not used as a command line argument but internally | |
| 219 // created by Omaha. | |
| 220 const TCHAR* const kInstallSource_Uninstall = _T("uninstall"); | |
| 221 | |
| 222 // | |
| 223 // "Extra" arguments provided in the metainstaller tag. | |
| 224 // | |
| 225 | |
| 226 // "bundlename" extra argument is the name of the bundle being installed. If not | |
| 227 // specified, the first app's appname is used. | |
| 228 const TCHAR* const kExtraArgBundleName = _T("bundlename"); | |
| 229 | |
| 230 // "lang" extra argument tells Omaha the language of the product the user is | |
| 231 // installing. | |
| 232 const TCHAR* const kExtraArgLanguage = _T("lang"); | |
| 233 | |
| 234 // "usagestats" extra argument tells Omaha the user has agreed to provide | |
| 235 // usage stats, crashreports etc. | |
| 236 const TCHAR* const kExtraArgUsageStats = _T("usagestats"); | |
| 237 | |
| 238 // "iid" extra argument is a unique value for this installation session. | |
| 239 // It can be used to follow the progress from the website to installation | |
| 240 // completion. | |
| 241 const TCHAR* const kExtraArgInstallationId = _T("iid"); | |
| 242 | |
| 243 // "brand" extra argument is the Brand Code used for branding. | |
| 244 // If a brand value already exists on the system, it is ignored. | |
| 245 // This value is used to set the initial brand for Omaha and the client app. | |
| 246 const TCHAR* const kExtraArgBrandCode = _T("brand"); | |
| 247 | |
| 248 // "client" extra argument is the Client ID used for branding. | |
| 249 // If a client value already exists on the system, it is ignored. | |
| 250 // This value is used to set the initial client for Omaha and the client app. | |
| 251 const TCHAR* const kExtraArgClientId = _T("client"); | |
| 252 | |
| 253 // "experiments" extra argument is a set of experiment labels used to track | |
| 254 // installs that are included in experiments. Use "experiments" for | |
| 255 // per-app arguments; use "omahaexperiments" for Omaha-specific labels. | |
| 256 const TCHAR* const kExtraArgExperimentLabels = _T("experiments"); | |
| 257 const TCHAR* const kExtraArgOmahaExperimentLabels = _T("omahaexperiments"); | |
| 258 | |
| 259 // "referral" extra argument is a referral ID used for tracking referrals. | |
| 260 const TCHAR* const kExtraArgReferralId = _T("referral"); | |
| 261 | |
| 262 // "ap" extra argument tells Omaha to set the ap value in the registry. | |
| 263 const TCHAR* const kExtraArgAdditionalParameters = _T("ap"); | |
| 264 | |
| 265 // "tttoken" extra argument tells Omaha to set the TT value in the registry. | |
| 266 const TCHAR* const kExtraArgTTToken = _T("tttoken"); | |
| 267 | |
| 268 // "browser" extra argument tells Omaha which browser to restart on | |
| 269 // successful install. | |
| 270 const TCHAR* const kExtraArgBrowserType = _T("browser"); | |
| 271 | |
| 272 // "runtime" extra argument tells Omaha to only install itself, staying on | |
| 273 // the system without any associated application for at least 24 hours. | |
| 274 // This is used to expose our COM API to a process that will install | |
| 275 // applications via that API after the meta-installer exits. | |
| 276 const TCHAR* const kExtraArgRuntime = _T("runtime"); | |
| 277 | |
| 278 // The list of arguments that are needed for a meta-installer, to | |
| 279 // indicate which application is being installed. These are stamped | |
| 280 // inside the meta-installer binary. | |
| 281 const TCHAR* const kExtraArgAppGuid = _T("appguid"); | |
| 282 const TCHAR* const kExtraArgAppName = _T("appname"); | |
| 283 const TCHAR* const kExtraArgNeedsAdmin = _T("needsadmin"); | |
| 284 const TCHAR* const kExtraArgInstallDataIndex = _T("installdataindex"); | |
| 285 | |
| 286 // App arguments are arguments explicitly passed on the command line. They are | |
| 287 // formatted similar to the regular extra args. For example: | |
| 288 // /appargs "appguid={GUID}&installerdata=BlahData" | |
| 289 // Unlike the regular extra args, they are not embedded in the executable. | |
| 290 const TCHAR* const kCmdLineAppArgs = _T("appargs"); | |
| 291 | |
| 292 // This switch allows extra data to be communicated to the application | |
| 293 // installer. The extra data needs to be URL-encoded. The data will be decoded | |
| 294 // and written to the file, that is then passed in the command line to the | |
| 295 // application installer in the form "/installerdata=blah.dat". One per | |
| 296 // application. | |
| 297 const TCHAR* const kExtraArgInstallerData = _T("installerdata"); | |
| 298 | |
| 299 // | |
| 300 // Parsing characters | |
| 301 // | |
| 302 | |
| 303 const TCHAR* const kExtraArgsSeparators = _T("&"); | |
| 304 const TCHAR* const kDisallowedCharsInExtraArgs = _T("/"); | |
| 305 const TCHAR kNameValueSeparatorChar = _T('='); | |
| 306 | |
| 307 } // namespace omaha | |
| 308 | |
| 309 #endif // OMAHA_COMMON_CONST_CMD_LINE_H__ | |
| 310 | |
| OLD | NEW |