| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This file contains the definitions of the installer functions that build | 5 // This file contains the definitions of the installer functions that build |
| 6 // the WorkItemList used to install the application. | 6 // the WorkItemList used to install the application. |
| 7 | 7 |
| 8 #include "chrome/installer/setup/install_worker.h" | 8 #include "chrome/installer/setup/install_worker.h" |
| 9 | 9 |
| 10 #include <shlobj.h> | 10 #include <shlobj.h> |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 browser_dist->GetPublisherName(), | 219 browser_dist->GetPublisherName(), |
| 220 true); | 220 true); |
| 221 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, | 221 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, |
| 222 L"Version", | 222 L"Version", |
| 223 UTF8ToWide(new_version.GetString()), | 223 UTF8ToWide(new_version.GetString()), |
| 224 true); | 224 true); |
| 225 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, | 225 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, |
| 226 L"DisplayVersion", | 226 L"DisplayVersion", |
| 227 UTF8ToWide(new_version.GetString()), | 227 UTF8ToWide(new_version.GetString()), |
| 228 true); | 228 true); |
| 229 time_t rawtime = time(NULL); | 229 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, |
| 230 struct tm timeinfo = {0}; | 230 L"InstallDate", |
| 231 localtime_s(&timeinfo, &rawtime); | 231 InstallUtil::GetCurrentDate(), |
| 232 wchar_t buffer[9]; | 232 false); |
| 233 if (wcsftime(buffer, 9, L"%Y%m%d", &timeinfo) == 8) { | |
| 234 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, | |
| 235 L"InstallDate", | |
| 236 buffer, false); | |
| 237 } | |
| 238 } | 233 } |
| 239 } | 234 } |
| 240 | 235 |
| 241 // Create Version key for a product (if not already present) and sets the new | 236 // Create Version key for a product (if not already present) and sets the new |
| 242 // product version as the last step. | 237 // product version as the last step. |
| 243 void AddVersionKeyWorkItems(HKEY root, | 238 void AddVersionKeyWorkItems(HKEY root, |
| 244 const Product& product, | 239 const Product& product, |
| 245 const Version& new_version, | 240 const Version& new_version, |
| 246 WorkItemList* list) { | 241 WorkItemList* list) { |
| 247 // Create Version key for each distribution (if not already present) and set | 242 // Create Version key for each distribution (if not already present) and set |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 if (prefs.is_multi_install()) { | 853 if (prefs.is_multi_install()) { |
| 859 uninstall_cmd->AppendSwitch(installer::switches::kMultiInstall); | 854 uninstall_cmd->AppendSwitch(installer::switches::kMultiInstall); |
| 860 } | 855 } |
| 861 bool value = false; | 856 bool value = false; |
| 862 if (prefs.GetBool(installer::master_preferences::kVerboseLogging, | 857 if (prefs.GetBool(installer::master_preferences::kVerboseLogging, |
| 863 &value) && value) | 858 &value) && value) |
| 864 uninstall_cmd->AppendSwitch(installer::switches::kVerboseLogging); | 859 uninstall_cmd->AppendSwitch(installer::switches::kVerboseLogging); |
| 865 } | 860 } |
| 866 | 861 |
| 867 } // namespace installer | 862 } // namespace installer |
| OLD | NEW |