Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(757)

Side by Side Diff: chrome/installer/setup/install_worker.cc

Issue 6533009: Switch from wcsftime to GetDateFormat to avoid crash in setup.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 browser_dist->GetPublisherName(), 213 browser_dist->GetPublisherName(),
214 true); 214 true);
215 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, 215 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg,
216 L"Version", 216 L"Version",
217 UTF8ToWide(new_version.GetString()), 217 UTF8ToWide(new_version.GetString()),
218 true); 218 true);
219 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, 219 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg,
220 L"DisplayVersion", 220 L"DisplayVersion",
221 UTF8ToWide(new_version.GetString()), 221 UTF8ToWide(new_version.GetString()),
222 true); 222 true);
223 time_t rawtime = time(NULL); 223 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg,
224 struct tm timeinfo = {0}; 224 L"InstallDate",
225 localtime_s(&timeinfo, &rawtime); 225 InstallUtil::GetCurrentDate(),
226 wchar_t buffer[9]; 226 false);
227 if (wcsftime(buffer, 9, L"%Y%m%d", &timeinfo) == 8) {
228 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg,
229 L"InstallDate",
230 buffer, false);
231 }
232 } 227 }
233 } 228 }
234 229
235 // Create Version key for a product (if not already present) and sets the new 230 // Create Version key for a product (if not already present) and sets the new
236 // product version as the last step. 231 // product version as the last step.
237 void AddVersionKeyWorkItems(HKEY root, 232 void AddVersionKeyWorkItems(HKEY root,
238 BrowserDistribution* dist, 233 BrowserDistribution* dist,
239 const Version& new_version, 234 const Version& new_version,
240 WorkItemList* list) { 235 WorkItemList* list) {
241 // Create Version key for each distribution (if not already present) and set 236 // Create Version key for each distribution (if not already present) and set
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 VLOG(1) << kIERefreshPolicy << " not supported."; 896 VLOG(1) << kIERefreshPolicy << " not supported.";
902 } 897 }
903 898
904 FreeLibrary(ieframe); 899 FreeLibrary(ieframe);
905 } else { 900 } else {
906 VLOG(1) << "Cannot load " << kIEFrameDll; 901 VLOG(1) << "Cannot load " << kIEFrameDll;
907 } 902 }
908 } 903 }
909 904
910 } // namespace installer 905 } // namespace installer
OLDNEW
« no previous file with comments | « no previous file | chrome/installer/util/install_util.h » ('j') | chrome/installer/util/install_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698