| 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 #include "chrome/installer/setup/install.h" | 5 #include "chrome/installer/setup/install.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <shlobj.h> | 8 #include <shlobj.h> |
| 9 #include <time.h> | 9 #include <time.h> |
| 10 | 10 |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 base::string16 display_name(dist->GetDisplayName()); | 345 base::string16 display_name(dist->GetDisplayName()); |
| 346 EscapeXmlAttributeValueInSingleQuotes(&display_name); | 346 EscapeXmlAttributeValueInSingleQuotes(&display_name); |
| 347 | 347 |
| 348 // Fill the manifest with the desired values. | 348 // Fill the manifest with the desired values. |
| 349 base::string16 manifest16(base::StringPrintf( | 349 base::string16 manifest16(base::StringPrintf( |
| 350 manifest_template.c_str(), display_name.c_str(), elements_dir.c_str())); | 350 manifest_template.c_str(), display_name.c_str(), elements_dir.c_str())); |
| 351 | 351 |
| 352 // Write the manifest to |src_path|. | 352 // Write the manifest to |src_path|. |
| 353 const std::string manifest(UTF16ToUTF8(manifest16)); | 353 const std::string manifest(UTF16ToUTF8(manifest16)); |
| 354 int size = base::checked_cast<int>(manifest.size()); | 354 int size = base::checked_cast<int>(manifest.size()); |
| 355 if (file_util::WriteFile( | 355 if (base::WriteFile( |
| 356 src_path.Append(installer::kVisualElementsManifest), | 356 src_path.Append(installer::kVisualElementsManifest), |
| 357 manifest.c_str(), size) == size) { | 357 manifest.c_str(), size) == size) { |
| 358 VLOG(1) << "Successfully wrote " << installer::kVisualElementsManifest | 358 VLOG(1) << "Successfully wrote " << installer::kVisualElementsManifest |
| 359 << " to " << src_path.value(); | 359 << " to " << src_path.value(); |
| 360 return true; | 360 return true; |
| 361 } else { | 361 } else { |
| 362 PLOG(ERROR) << "Error writing " << installer::kVisualElementsManifest | 362 PLOG(ERROR) << "Error writing " << installer::kVisualElementsManifest |
| 363 << " to " << src_path.value(); | 363 << " to " << src_path.value(); |
| 364 return false; | 364 return false; |
| 365 } | 365 } |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 if (app_host_path.empty()) | 702 if (app_host_path.empty()) |
| 703 return false; | 703 return false; |
| 704 | 704 |
| 705 CommandLine cmd(app_host_path); | 705 CommandLine cmd(app_host_path); |
| 706 cmd.AppendSwitchASCII(::switches::kInstallFromWebstore, app_code); | 706 cmd.AppendSwitchASCII(::switches::kInstallFromWebstore, app_code); |
| 707 VLOG(1) << "App install command: " << cmd.GetCommandLineString(); | 707 VLOG(1) << "App install command: " << cmd.GetCommandLineString(); |
| 708 return base::LaunchProcess(cmd, base::LaunchOptions(), NULL); | 708 return base::LaunchProcess(cmd, base::LaunchOptions(), NULL); |
| 709 } | 709 } |
| 710 | 710 |
| 711 } // namespace installer | 711 } // namespace installer |
| OLD | NEW |