1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371
|
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//base/win/embedded_i18n/generate_embedded_i18n.gni")
import("//build/config/chrome_build.gni")
import("//testing/test.gni")
if (is_win) {
source_set("metainstaller_utils") {
sources = [
"delete_after_reboot_helper.cc",
"delete_after_reboot_helper.h",
"lzma_util.cc",
"lzma_util.h",
"self_cleaning_temp_dir.cc",
"self_cleaning_temp_dir.h",
]
deps = [ "//third_party/lzma_sdk/google:seven_zip_reader" ]
public_deps = [
"//base",
"//third_party/abseil-cpp:absl",
]
}
source_set("work_item") {
sources = [
"callback_work_item.cc",
"callback_work_item.h",
"conditional_work_item_list.cc",
"conditional_work_item_list.h",
"copy_tree_work_item.cc",
"copy_tree_work_item.h",
"create_dir_work_item.cc",
"create_dir_work_item.h",
"create_reg_key_work_item.cc",
"create_reg_key_work_item.h",
"delete_reg_key_work_item.cc",
"delete_reg_key_work_item.h",
"delete_reg_value_work_item.cc",
"delete_reg_value_work_item.h",
"delete_tree_work_item.cc",
"delete_tree_work_item.h",
"duplicate_tree_detector.cc",
"duplicate_tree_detector.h",
"install_service_work_item.cc",
"install_service_work_item.h",
"install_service_work_item_impl.cc",
"install_service_work_item_impl.h",
"move_tree_work_item.cc",
"move_tree_work_item.h",
"registry_key_backup.cc",
"registry_key_backup.h",
"registry_util.cc",
"registry_util.h",
"set_reg_value_work_item.cc",
"set_reg_value_work_item.h",
"work_item.cc",
"work_item.h",
"work_item_list.cc",
"work_item_list.h",
]
public_deps = [ "//base" ]
}
}
# This file deliberately has no default "util" target so dependants have to
# specify with the ":with_no_strings" or ":with_rc_strings" variants. Random
# code that ends up getting linked into chrome proper should depend on the
# ":with_no_strings" variant. Other standalone apps will need to decide if they
# need the resource strings or not.
#
# chrome/installer/util has generated strings on Windows. These appear as
# Windows resources and are fairly large (~200KB). They are generated by the
# ":generate_strings" target and compiled by the ":strings" target.
#
# Some code, like the Windows chrome.exe (the small bootstrap binary, not
# all of chrome.dll) code uses installer_util functions without calling any
# functions that use the strings. And historically in the GYP build the strings
# resource had to be manually linked, so the strings never ended up being in
# chrome.exe and everything was fine.
#
# Other code, like chrome.dll links to installer util, and hooks up a
# TranslationDelegate which overrides the strings retrieved from the resources
# with grit pak strings.
#
# In both of these cases, link to the ":with_no_strings" variant. However, this
# is obviously a fragile and confusing situation. In the "I don't use strings at
# all case", there is no definition of what works and doesn't work, and this may
# also change over time. As an example at the time of this writing, chrome.exe
# calls GoogleUpdateSettings::UpdateDidRunState. This function doesn't use any
# strings, but other functions in InstallUtil do use localized strings.
#
# Ideally, this should be cleaved in two parts: the main "installer util" and
# some kind of mini installer util that just contains the functions needed by
# chrome.exe and any other clients that don't need the strings. It's likely
# we would still need the variant with no strings for when chrome.dll replaces
# all strings with its own versions.
static_library("with_no_strings") {
public_deps = [ ":constants" ]
deps = [
"//base",
"//chrome:strings",
"//chrome/common:constants",
"//components/variations",
"//third_party/abseil-cpp:absl",
]
# The constants target checks the Chrome distribution from this target. Both
# targets have to be linked together in practice.
allow_circular_includes_from = [ "//chrome/common:constants" ]
if (is_win) {
sources = [
"additional_parameters.cc",
"additional_parameters.h",
"advanced_firewall_manager_win.cc",
"advanced_firewall_manager_win.h",
"app_command.cc",
"app_command.h",
"app_commands.cc",
"app_commands.h",
"auto_launch_util.cc",
"auto_launch_util.h",
"beacons.cc",
"beacons.h",
"delete_old_versions.cc",
"delete_old_versions.h",
"firewall_manager_win.cc",
"firewall_manager_win.h",
"google_update_settings.cc",
"google_update_settings.h",
"google_update_util.cc",
"google_update_util.h",
"helper.cc",
"helper.h",
"html_dialog.h",
"html_dialog_impl.cc",
"initial_preferences.cc",
"initial_preferences.h",
"install_util.cc",
"install_util.h",
"installation_state.cc",
"installation_state.h",
"l10n_string_util.cc",
"l10n_string_util.h",
"logging_installer.cc",
"logging_installer.h",
"per_install_values.cc",
"per_install_values.h",
"registry_entry.cc",
"registry_entry.h",
"scoped_token_privilege.cc",
"scoped_token_privilege.h",
"shell_util.cc",
"shell_util.h",
"system_tracing_util.cc",
"system_tracing_util.h",
"taskbar_util.cc",
"taskbar_util.h",
]
public_deps += [
":did_run_support",
":metainstaller_utils",
":work_item",
# Need to depend on the generated strings target since files here
# depend on the generated header, but only depend on the ":strings"
# target (which actually compiles and causes the generated code to be
# linked) from the ":util" target.
":generate_strings",
]
deps += [
"//base:i18n",
"//base/win:pe_image",
"//build:branding_buildflags",
"//chrome/install_static:install_static_util",
"//components/app_launch_prefetch",
"//components/base32",
"//components/metrics:client_info",
"//components/version_info:channel",
"//crypto",
"//rlz/buildflags",
"//third_party/icu",
]
libs = [
"urlmon.lib",
"wtsapi32.lib",
]
configs += [ "//build/config:precompiled_headers" ]
} else {
sources = [
"initial_preferences.cc",
"initial_preferences.h",
]
}
}
# Use this version of installer_util to link to the generated strings in .rc
# format.
group("with_rc_strings") {
public_deps = [ ":with_no_strings" ]
if (is_win) {
public_deps += [ ":strings" ]
}
}
generate_embedded_i18n("generate_strings") {
visibility = [
":strings",
":with_no_strings",
]
extractor_datafile =
"//chrome/installer/util/prebuild/create_installer_string_rc.py"
grdfile_folder = "//chrome/app/"
grdfile_name = "${branding_path_product}_strings"
xtb_relative_path = "resources"
grd_files_info = [ [
grdfile_folder,
grdfile_name,
xtb_relative_path,
default_embedded_i18_locales,
] ]
output_file_name_base = "installer_util_strings"
branding = branding_path_product
}
# Compile the generated .rc file.
source_set("strings") {
sources = get_target_outputs(":generate_strings")
public_deps = [ ":generate_strings" ]
}
source_set("constants") {
public = [ "initial_preferences_constants.h" ]
sources = [ "initial_preferences_constants.cc" ]
if (is_win) {
public += [
"google_update_constants.h",
"util_constants.h",
]
sources += [
"google_update_constants.cc",
"util_constants.cc",
]
public_deps = [ "//base" ]
}
}
if (is_win) {
source_set("did_run_support") {
public = [ "update_did_run_state.h" ]
sources = [ "update_did_run_state.cc" ]
deps = [
":constants",
"//base",
"//chrome/install_static:install_static_util",
]
}
source_set("test_support") {
testonly = true
sources = [
"fake_installation_state.h",
"fake_product_state.h",
]
deps = [
":with_no_strings",
"//base",
]
}
# This source set contains tests that must run serially. These are linked into
# setup_unittests, which does so.
source_set("serial_unittests") {
testonly = true
sources = [
"install_service_work_item_unittest.cc",
"per_install_values_unittest.cc",
]
deps = [
":with_no_strings",
"//base",
"//chrome/install_static:install_static_util",
"//chrome/install_static/test:test_support",
"//testing/gtest",
]
}
test("installer_util_unittests") {
sources = [
"additional_parameters_unittest.cc",
"advanced_firewall_manager_win_unittest.cc",
"auto_launch_util_unittest.cc",
"beacons_unittest.cc",
"callback_work_item_unittest.cc",
"conditional_work_item_list_unittest.cc",
"copy_tree_work_item_unittest.cc",
"create_dir_work_item_unittest.cc",
"create_reg_key_work_item_unittest.cc",
"delete_after_reboot_helper_unittest.cc",
"delete_old_versions_unittest.cc",
"delete_reg_key_work_item_unittest.cc",
"delete_reg_value_work_item_unittest.cc",
"delete_tree_work_item_unittest.cc",
"duplicate_tree_detector_unittest.cc",
"google_update_settings_unittest.cc",
"helper_unittest.cc",
"initial_preferences_unittest.cc",
"install_util_unittest.cc",
"installation_state_unittest.cc",
"l10n_string_util_unittest.cc",
"logging_installer_unittest.cc",
"lzma_util_unittest.cc",
"move_tree_work_item_unittest.cc",
"product_state_unittest.cc",
"product_unittest.cc",
"registry_key_backup_unittest.cc",
"registry_test_data.cc",
"registry_test_data.h",
"registry_util_unittest.cc",
"run_all_unittests.cc",
"scoped_token_privilege_unittest.cc",
"self_cleaning_temp_dir_unittest.cc",
"set_reg_value_work_item_unittest.cc",
"shell_util_unittest.cc",
"work_item_list_unittest.cc",
"work_item_mocks.cc",
"work_item_mocks.h",
"work_item_unittest.cc",
]
deps = [
":test_support",
":with_rc_strings",
"//base",
"//base/test:test_support",
"//build:branding_buildflags",
"//chrome:other_version",
"//chrome/common:constants",
"//chrome/install_static:install_static_util",
"//chrome/install_static/test:test_support",
"//chrome/installer/test:alternate_version_generator_lib",
"//components/variations",
"//components/version_info:channel",
"//rlz/buildflags",
"//testing/gmock",
"//testing/gtest",
]
data = [
"//chrome/test/data/extensions/",
"//chrome/test/data/installer/",
]
}
} # is_win
|