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

Side by Side Diff: chrome/browser/first_run.cc

Issue 12650: The first run sentinel does not get created for system install... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <atlbase.h> 5 #include <atlbase.h>
6 #include <atlcom.h> 6 #include <atlcom.h>
7 #include <windows.h> 7 #include <windows.h>
8 #include <shlobj.h> 8 #include <shlobj.h>
9 9
10 #include <sstream> 10 #include <sstream>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 #include "google_update_idl.h" 43 #include "google_update_idl.h"
44 44
45 namespace { 45 namespace {
46 46
47 // The kSentinelFile file absence will tell us it is a first run. 47 // The kSentinelFile file absence will tell us it is a first run.
48 const wchar_t kSentinelFile[] = L"First Run"; 48 const wchar_t kSentinelFile[] = L"First Run";
49 49
50 // Gives the full path to the sentinel file. The file might not exist. 50 // Gives the full path to the sentinel file. The file might not exist.
51 bool GetFirstRunSentinelFilePath(std::wstring* path) { 51 bool GetFirstRunSentinelFilePath(std::wstring* path) {
52 std::wstring exe_path;
53 if (!PathService::Get(base::DIR_EXE, &exe_path))
54 return false;
55
52 std::wstring first_run_sentinel; 56 std::wstring first_run_sentinel;
53 if (!PathService::Get(base::DIR_EXE, &first_run_sentinel)) 57 if (InstallUtil::IsPerUserInstall(exe_path.c_str())) {
54 return false; 58 first_run_sentinel = exe_path;
59 } else {
60 if (!PathService::Get(chrome::DIR_USER_DATA, &first_run_sentinel))
61 return false;
62 }
63
55 file_util::AppendToPath(&first_run_sentinel, kSentinelFile); 64 file_util::AppendToPath(&first_run_sentinel, kSentinelFile);
56 *path = first_run_sentinel; 65 *path = first_run_sentinel;
57 return true; 66 return true;
58 } 67 }
59 68
60 bool GetNewerChromeFile(std::wstring* path) { 69 bool GetNewerChromeFile(std::wstring* path) {
61 if (!PathService::Get(base::DIR_EXE, path)) 70 if (!PathService::Get(base::DIR_EXE, path))
62 return false; 71 return false;
63 file_util::AppendToPath(path, installer_util::kChromeNewExe); 72 file_util::AppendToPath(path, installer_util::kChromeNewExe);
64 return true; 73 return true;
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 bool FirstRun::SetShowWelcomePagePref() { 534 bool FirstRun::SetShowWelcomePagePref() {
526 PrefService* local_state = g_browser_process->local_state(); 535 PrefService* local_state = g_browser_process->local_state();
527 if (!local_state) 536 if (!local_state)
528 return false; 537 return false;
529 if (!local_state->IsPrefRegistered(prefs::kShouldShowWelcomePage)) { 538 if (!local_state->IsPrefRegistered(prefs::kShouldShowWelcomePage)) {
530 local_state->RegisterBooleanPref(prefs::kShouldShowWelcomePage, false); 539 local_state->RegisterBooleanPref(prefs::kShouldShowWelcomePage, false);
531 local_state->SetBoolean(prefs::kShouldShowWelcomePage, true); 540 local_state->SetBoolean(prefs::kShouldShowWelcomePage, true);
532 } 541 }
533 return true; 542 return true;
534 } 543 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698