OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // mini_installer.exe is the first exe that is run when chrome is being | 5 // mini_installer.exe is the first exe that is run when chrome is being |
6 // installed or upgraded. It is designed to be extremely small (~5KB with no | 6 // installed or upgraded. It is designed to be extremely small (~5KB with no |
7 // extra resources linked) and it has two main jobs: | 7 // extra resources linked) and it has two main jobs: |
8 // 1) unpack the resources (possibly decompressing some) | 8 // 1) unpack the resources (possibly decompressing some) |
9 // 2) run the real installer (setup.exe) with appropiate flags. | 9 // 2) run the real installer (setup.exe) with appropiate flags. |
10 // | 10 // |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 | 146 |
147 // This function sets the flag in registry to indicate that Google Update | 147 // This function sets the flag in registry to indicate that Google Update |
148 // should try full installer next time. If the current installer works, this | 148 // should try full installer next time. If the current installer works, this |
149 // flag is cleared by setup.exe at the end of install. | 149 // flag is cleared by setup.exe at the end of install. |
150 void SetFullInstallerFlag(HKEY root_key) { | 150 void SetFullInstallerFlag(HKEY root_key) { |
151 HKEY key; | 151 HKEY key; |
152 wchar_t ap_registry_key[128]; | 152 wchar_t ap_registry_key[128]; |
153 const wchar_t* app_guid = google_update::kAppGuid; | 153 const wchar_t* app_guid = google_update::kAppGuid; |
154 | 154 |
155 int args_num; | 155 int args_num; |
| 156 |
156 wchar_t* cmd_line = ::GetCommandLine(); | 157 wchar_t* cmd_line = ::GetCommandLine(); |
157 wchar_t** args = ::CommandLineToArgvW(cmd_line, &args_num); | 158 wchar_t** args = ::CommandLineToArgvW(cmd_line, &args_num); |
158 for (int i = 1; i < args_num; ++i) { | 159 for (int i = 1; i < args_num; ++i) { |
159 if (0 == ::lstrcmpi(args[i], L"--chrome-sxs")) | 160 if (0 == ::lstrcmpi(args[i], L"--chrome-sxs")) |
160 app_guid = google_update::kSxSAppGuid; | 161 app_guid = google_update::kSxSAppGuid; |
| 162 else if (0 == ::lstrcmpi(args[i], L"--chrome-frame")) |
| 163 app_guid = google_update::kChromeFrameAppGuid; |
161 } | 164 } |
162 | 165 |
163 if (!SafeStrCopy(ap_registry_key, _countof(ap_registry_key), | 166 if (!SafeStrCopy(ap_registry_key, _countof(ap_registry_key), |
164 kApRegistryKeyBase) || | 167 kApRegistryKeyBase) || |
165 !SafeStrCat(ap_registry_key, _countof(ap_registry_key), | 168 !SafeStrCat(ap_registry_key, _countof(ap_registry_key), |
166 app_guid)) { | 169 app_guid)) { |
167 return; | 170 return; |
168 } | 171 } |
169 if (::RegOpenKeyEx(root_key, ap_registry_key, NULL, | 172 if (::RegOpenKeyEx(root_key, ap_registry_key, NULL, |
170 KEY_READ | KEY_SET_VALUE, &key) != ERROR_SUCCESS) | 173 KEY_READ | KEY_SET_VALUE, &key) != ERROR_SUCCESS) |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 | 552 |
550 return exit_code; | 553 return exit_code; |
551 } | 554 } |
552 } // namespace mini_installer | 555 } // namespace mini_installer |
553 | 556 |
554 | 557 |
555 int MainEntryPoint() { | 558 int MainEntryPoint() { |
556 int result = mini_installer::WMain(::GetModuleHandle(NULL)); | 559 int result = mini_installer::WMain(::GetModuleHandle(NULL)); |
557 ::ExitProcess(result); | 560 ::ExitProcess(result); |
558 } | 561 } |
OLD | NEW |