tree: 2176dd555c89babcd8e2293dd2255ed9d9710400 [path history] [tgz]
  1. eula/
  2. archive_patch_helper.cc
  3. archive_patch_helper.h
  4. archive_patch_helper_unittest.cc
  5. brand_behaviors.h
  6. BUILD.gn
  7. channel_override_work_item.cc
  8. channel_override_work_item.h
  9. channel_override_work_item_unittest.cc
  10. chromium_behaviors.cc
  11. configure_app_container_sandbox.cc
  12. configure_app_container_sandbox.h
  13. configure_app_container_sandbox_unittest.cc
  14. DEPS
  15. downgrade_cleanup.cc
  16. downgrade_cleanup.h
  17. downgrade_cleanup_unittest.cc
  18. google_chrome_behaviors.cc
  19. install.cc
  20. install.h
  21. install_params.h
  22. install_unittest.cc
  23. install_worker.cc
  24. install_worker.h
  25. install_worker_unittest.cc
  26. installer_crash_reporter_client.cc
  27. installer_crash_reporter_client.h
  28. installer_crash_reporting.cc
  29. installer_crash_reporting.h
  30. installer_state.cc
  31. installer_state.h
  32. installer_state_unittest.cc
  33. last_breaking_installer_version.cc
  34. last_breaking_installer_version.h
  35. launch_chrome.cc
  36. launch_chrome.h
  37. memory_unittest.cc
  38. modify_params.h
  39. progress_calculator.cc
  40. progress_calculator.h
  41. progress_calculator_unittest.cc
  42. README.md
  43. run_all_unittests.cc
  44. setup.exe.manifest
  45. setup.ico
  46. setup.rc
  47. setup_constants.cc
  48. setup_constants.h
  49. setup_exe_version.rc.version
  50. setup_install_details.cc
  51. setup_install_details.h
  52. setup_install_details_unittest.cc
  53. setup_main.cc
  54. setup_main.h
  55. setup_resource.h
  56. setup_singleton.cc
  57. setup_singleton.h
  58. setup_singleton_unittest.cc
  59. setup_util.cc
  60. setup_util.h
  61. setup_util_unittest.cc
  62. setup_util_unittest.h
  63. taskbar_util_unittest.cc
  64. uninstall.cc
  65. uninstall.h
  66. unpack_archive.cc
  67. unpack_archive.h
  68. unpack_archive_unittest.cc
  69. update_active_setup_version_work_item.cc
  70. update_active_setup_version_work_item.h
  71. update_active_setup_version_work_item_unittest.cc
  72. user_hive_visitor.cc
  73. user_hive_visitor.h
  74. user_hive_visitor_unittest.cc
chrome/installer/setup/README.md

Chrome's Installer for Windows

Overview

Generally speaking, we talk about setup.exe as “the installer”, although mini_installer.exe is the thing that is delivered to devices to install Chrome. The installer's primary concern is putting the browser on-disk in the proper location and registering it with Windows as a browser. It is also used to uninstall and remove Chrome and to perform various one-off tasks.

Operational environment

Chrome can be installed for all users on a machine or for a single user. The former is called a “system-level” install and the latter is a “user-level” install. setup.exe defaults to performaing a user-level install (note: the Chrome download page defaults to system-level). System-level can be chosen via any of:

  • --system-level on the command line,
  • {"distribution":{"system_level":true}} in an “initial_preferences” file passed via the --installerdata=<PATH> command line switch, or
  • GoogleUpdateIsMachine=1 in the process environment block.

A user-level install is always expected to be run within the context of an interactive user. A system-level install may run in the context of an interactive user (e.g., one who has downloaded Chrome's installer and passed a UAC prompt) or in the context of a machine account such as SYSTEM (e.g., installation via msiexec.exe or an update driven by a system-level install of Google Update).

Use of the Windows Registry

Chrome and its installer use portions of the Windows registry established by Google Update to maintain installation-related state (not user state). This state is saved in ...\Software\Google\Update\Clients and ...\Software\Google\Update\ClientState. These are unconditionally located in the 32-bit registry hive, so KEY_WOW64_32KEY must always be used when accessing them.

By and large, new state should we written to Chrome‘s ClientState key. The Clients key should be used for the version number and app commands (both as required by Google Update) and Chrome’s channel.

setup.exe as a Helper

setup.exe is run to perform a variety of one-off tasks. In all cases, these invocations must carry certain command line switches from the original installation. These include --system-level, --channel=FOO, and one of the install mode switches, if used (e.g., --chrome-sxs). This ensures that the proper install is used and that metrics and crashes have the proper annotations.

Executables

  • setup.exe (//chrome/installer/setup): The workhorse installer.
  • mini_installer.exe (//chrome/installer/mini_installer): Carries setup.exe and the Chrome 7zip archive as resources; knows how to extract them and run setup.exe.
  • Chrome “standalone” (.exe) installer: A self-contained executable that installs Google Update and then runs Chrome's mini_installer. The tooling to build this is not in the Chromium repository.
  • Chrome “enterprise” (.msi) installer: A self-contained Windows Installer file that runs a standalone installer (yielding Google Update and Chrome). The tooling to build this is not in the Chromium repository.

Code Layers

From the bottom heading up:

  • //chrome/install_static: Core functionality with minimal dependencies used by chrome.exe, chrome_elf.dll, chrome.dll, setup.exe, and any other binary that must be aware of install level, channel, stats collection, etc.
  • //chrome/installer/util: Higher-level functionality used by chrome.exe, chrome.dll, and setup.exe. This is for code shared by the browser and the installer.
  • //chrome/installer/setup: Handles installation, uninstallation, and various helper operations.
  • //chrome/installer/mini_installer: Outer installer that extracts resources and runs the contained setup.exe. This also has minimal dependencies.

Testing

  • Unit tests in //chrome/install_static, //chrome/installer/util, and //chrome/installer/setup.
  • End-to-end integration tests that run/verify the installer and ensure that the browser runs in //chrome/test/mini_installer.

Development Tips

Where should my code go?

Generally, prefer //chrome/installer/setup if the new code is only for use by the installer. If it must be shared by Chrome, put it in //chrome/installer/util.