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 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 | 501 |
502 installer_state.SetStage(COPYING_PREFERENCES_FILE); | 502 installer_state.SetStage(COPYING_PREFERENCES_FILE); |
503 | 503 |
504 if (result == FIRST_INSTALL_SUCCESS && !prefs_path.empty()) | 504 if (result == FIRST_INSTALL_SUCCESS && !prefs_path.empty()) |
505 CopyPreferenceFileForFirstRun(installer_state, prefs_path); | 505 CopyPreferenceFileForFirstRun(installer_state, prefs_path); |
506 | 506 |
507 installer_state.SetStage(CREATING_SHORTCUTS); | 507 installer_state.SetStage(CREATING_SHORTCUTS); |
508 | 508 |
509 // Creates shortcuts for Chrome. | 509 // Creates shortcuts for Chrome. |
510 const Product& chrome_product = installer_state.product(); | 510 const Product& chrome_product = installer_state.product(); |
511 BrowserDistribution* chrome_dist = chrome_product.distribution(); | |
512 const base::FilePath chrome_exe( | 511 const base::FilePath chrome_exe( |
513 installer_state.target_path().Append(kChromeExe)); | 512 installer_state.target_path().Append(kChromeExe)); |
514 | 513 |
515 // Install per-user shortcuts on user-level installs and all-users shortcuts | 514 // Install per-user shortcuts on user-level installs and all-users shortcuts |
516 // on system-level installs. Note that Active Setup will take care of | 515 // on system-level installs. Note that Active Setup will take care of |
517 // installing missing per-user shortcuts on system-level install (i.e., | 516 // installing missing per-user shortcuts on system-level install (i.e., |
518 // quick launch, taskbar pin, and possibly deleted all-users shortcuts). | 517 // quick launch, taskbar pin, and possibly deleted all-users shortcuts). |
519 InstallShortcutLevel install_level = | 518 InstallShortcutLevel install_level = |
520 installer_state.system_install() ? ALL_USERS : CURRENT_USER; | 519 installer_state.system_install() ? ALL_USERS : CURRENT_USER; |
521 | 520 |
522 InstallShortcutOperation install_operation = | 521 InstallShortcutOperation install_operation = |
523 INSTALL_SHORTCUT_REPLACE_EXISTING; | 522 INSTALL_SHORTCUT_REPLACE_EXISTING; |
524 if (result == installer::FIRST_INSTALL_SUCCESS || | 523 if (result == installer::FIRST_INSTALL_SUCCESS || |
525 result == installer::INSTALL_REPAIRED || | 524 result == installer::INSTALL_REPAIRED || |
526 !original_state.GetProductState(installer_state.system_install(), | 525 !original_state.GetProductState(installer_state.system_install())) { |
527 chrome_dist->GetType())) { | |
528 // Always create the shortcuts on a new install, a repair install, and | 526 // Always create the shortcuts on a new install, a repair install, and |
529 // when the Chrome product is being added to the current install. | 527 // when the Chrome product is being added to the current install. |
530 install_operation = INSTALL_SHORTCUT_CREATE_ALL; | 528 install_operation = INSTALL_SHORTCUT_CREATE_ALL; |
531 } | 529 } |
532 | 530 |
533 CreateOrUpdateShortcuts(chrome_exe, chrome_product, prefs, install_level, | 531 CreateOrUpdateShortcuts(chrome_exe, chrome_product, prefs, install_level, |
534 install_operation); | 532 install_operation); |
535 | 533 |
536 // Register Chrome and, if requested, make Chrome the default browser. | 534 // Register Chrome and, if requested, make Chrome the default browser. |
537 installer_state.SetStage(REGISTERING_CHROME); | 535 installer_state.SetStage(REGISTERING_CHROME); |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 // Read master_preferences copied beside chrome.exe at install. | 690 // Read master_preferences copied beside chrome.exe at install. |
693 MasterPreferences prefs(installation_root.AppendASCII(kDefaultMasterPrefs)); | 691 MasterPreferences prefs(installation_root.AppendASCII(kDefaultMasterPrefs)); |
694 base::FilePath chrome_exe(installation_root.Append(kChromeExe)); | 692 base::FilePath chrome_exe(installation_root.Append(kChromeExe)); |
695 CreateOrUpdateShortcuts( | 693 CreateOrUpdateShortcuts( |
696 chrome_exe, chrome, prefs, CURRENT_USER, install_operation); | 694 chrome_exe, chrome, prefs, CURRENT_USER, install_operation); |
697 | 695 |
698 UpdateDefaultBrowserBeaconForPath(chrome_exe); | 696 UpdateDefaultBrowserBeaconForPath(chrome_exe); |
699 } | 697 } |
700 | 698 |
701 } // namespace installer | 699 } // namespace installer |
OLD | NEW |