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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
222 } | 222 } |
223 | 223 |
224 // Gets the setup.exe path from Registry by looking the value of Uninstall | 224 // Gets the setup.exe path from Registry by looking the value of Uninstall |
225 // string. |size| is measured in wchar_t units. | 225 // string. |size| is measured in wchar_t units. |
226 bool GetSetupExePathForGuidFromRegistry(bool system_level, | 226 bool GetSetupExePathForGuidFromRegistry(bool system_level, |
227 const wchar_t* app_guid, | 227 const wchar_t* app_guid, |
228 wchar_t* path, | 228 wchar_t* path, |
229 size_t size) { | 229 size_t size) { |
230 const HKEY root_key = system_level ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; | 230 const HKEY root_key = system_level ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; |
231 RegKey key; | 231 RegKey key; |
232 return OpenClientStateKey(root_key, app_guid, KEY_QUERY_VALUE, &key) && | 232 wchar_t unquoted_path[MAX_PATH] = {0}; |
233 (key.ReadValue(kUninstallRegistryValueName, path, size) == ERROR_SUCCESS); | 233 if (!OpenClientStateKey(root_key, app_guid, KEY_QUERY_VALUE, &key) || |
234 (key.ReadValue(kUninstallRegistryValueName, | |
235 unquoted_path, | |
tommi (sloooow) - chröme
2014/02/04 21:55:14
I mean here. Since unquoted_path will contain a v
Cris Neckar
2014/02/04 22:53:05
Ah I misunderstood, thought you were asking if thi
| |
236 MAX_PATH) != ERROR_SUCCESS)) { | |
237 return false; | |
238 } | |
239 | |
240 return !SafeStrCopy(path, size, L"\"") && | |
241 !SafeStrCat(path, size, unquoted_path) && | |
242 !SafeStrCat(path, size, L"\""); | |
234 } | 243 } |
235 | 244 |
236 // Gets the setup.exe path from Registry by looking the value of Uninstall | 245 // Gets the setup.exe path from Registry by looking the value of Uninstall |
237 // string. |size| is measured in wchar_t units. | 246 // string. |size| is measured in wchar_t units. |
238 bool GetSetupExePathFromRegistry(const Configuration& configuration, | 247 bool GetSetupExePathFromRegistry(const Configuration& configuration, |
239 wchar_t* path, | 248 wchar_t* path, |
240 size_t size) { | 249 size_t size) { |
241 bool system_level = configuration.is_system_level(); | 250 bool system_level = configuration.is_system_level(); |
242 | 251 |
243 // If this is a multi install, first try looking in the binaries for the path. | 252 // If this is a multi install, first try looking in the binaries for the path. |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
853 case 1: | 862 case 1: |
854 dest8[count - 1] = c; | 863 dest8[count - 1] = c; |
855 } | 864 } |
856 | 865 |
857 while (adjcount-- > 0) // Copy the rest, 4 bytes/32 bits at a time | 866 while (adjcount-- > 0) // Copy the rest, 4 bytes/32 bits at a time |
858 *(dest32++) = fill; | 867 *(dest32++) = fill; |
859 | 868 |
860 return dest; | 869 return dest; |
861 } | 870 } |
862 } // extern "C" | 871 } // extern "C" |
OLD | NEW |