| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 appropriate flags. | 9 // 2) run the real installer (setup.exe) with appropriate flags. |
| 10 // | 10 // |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 } | 138 } |
| 139 return false; | 139 return false; |
| 140 } | 140 } |
| 141 | 141 |
| 142 // Opens the Google Update ClientState key for a product. | 142 // Opens the Google Update ClientState key for a product. |
| 143 bool OpenClientStateKey(HKEY root_key, const wchar_t* app_guid, REGSAM access, | 143 bool OpenClientStateKey(HKEY root_key, const wchar_t* app_guid, REGSAM access, |
| 144 RegKey* key) { | 144 RegKey* key) { |
| 145 PathString client_state_key; | 145 PathString client_state_key; |
| 146 return client_state_key.assign(kApRegistryKeyBase) && | 146 return client_state_key.assign(kApRegistryKeyBase) && |
| 147 client_state_key.append(app_guid) && | 147 client_state_key.append(app_guid) && |
| 148 (key->Open(root_key, client_state_key.get(), access) == ERROR_SUCCESS); | 148 (key->Open(root_key, |
| 149 client_state_key.get(), |
| 150 access | KEY_WOW64_32KEY) == ERROR_SUCCESS); |
| 149 } | 151 } |
| 150 | 152 |
| 151 // This function sets the flag in registry to indicate that Google Update | 153 // This function sets the flag in registry to indicate that Google Update |
| 152 // should try full installer next time. If the current installer works, this | 154 // should try full installer next time. If the current installer works, this |
| 153 // flag is cleared by setup.exe at the end of install. The flag will by default | 155 // flag is cleared by setup.exe at the end of install. The flag will by default |
| 154 // be written to HKCU, but if --system-level is included in the command line, | 156 // be written to HKCU, but if --system-level is included in the command line, |
| 155 // it will be written to HKLM instead. | 157 // it will be written to HKLM instead. |
| 156 // TODO(grt): Write a unit test for this that uses registry virtualization. | 158 // TODO(grt): Write a unit test for this that uses registry virtualization. |
| 157 void SetInstallerFlags(const Configuration& configuration) { | 159 void SetInstallerFlags(const Configuration& configuration) { |
| 158 RegKey key; | 160 RegKey key; |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 #pragma function(memset) | 837 #pragma function(memset) |
| 836 void* memset(void* dest, int c, size_t count) { | 838 void* memset(void* dest, int c, size_t count) { |
| 837 void* start = dest; | 839 void* start = dest; |
| 838 while (count--) { | 840 while (count--) { |
| 839 *reinterpret_cast<char*>(dest) = static_cast<char>(c); | 841 *reinterpret_cast<char*>(dest) = static_cast<char>(c); |
| 840 dest = reinterpret_cast<char*>(dest) + 1; | 842 dest = reinterpret_cast<char*>(dest) + 1; |
| 841 } | 843 } |
| 842 return start; | 844 return start; |
| 843 } | 845 } |
| 844 } // extern "C" | 846 } // extern "C" |
| OLD | NEW |