Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / installer / util / BUILD.gn
blobe21ff8cfda1eaabdfe2218623fcd518ee14a28b9
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//build/config/chrome_build.gni")
6 import("//testing/test.gni")
8 static_library("util") {
9   deps = [
10     "//base",
11     "//chrome:strings",
12     "//chrome/common:constants",
13     "//chrome/common:result_codes",
14     "//content/public/common:result_codes",
15   ]
17   if (is_win) {
18     # TODO(GYP) installer_util on Windows.
19     # This is a bit tricky. It seems that what's currently called
20     # installer_util_nacl_win64 should be a different target with a different
21     # name ("installer_util_minimal"?) since it's not strictly the 64-bit build
22     # of that target.
23     sources = [
24       "chrome_binaries_operations.cc",
25       "chrome_binaries_operations.h",
26       "chrome_browser_operations.cc",
27       "chrome_browser_operations.h",
28       "chrome_browser_sxs_operations.cc",
29       "chrome_browser_sxs_operations.h",
30       "chrome_frame_operations.cc",
31       "chrome_frame_operations.h",
32       "compat_checks.cc",
33       "compat_checks.h",
34       "delete_after_reboot_helper.cc",
35       "delete_after_reboot_helper.h",
36       "google_chrome_distribution.cc",
37       "google_chrome_distribution.h",
38       "html_dialog.h",
39       "html_dialog_impl.cc",
40       "installation_validator.cc",
41       "installation_validator.h",
42       "logging_installer.cc",
43       "logging_installer.h",
44       "lzma_util.cc",
45       "lzma_util.h",
46       "master_preferences.cc",
47       "master_preferences.h",
48       "product.cc",
49       "product.h",
50       "product_operations.h",
51       "self_cleaning_temp_dir.cc",
52       "self_cleaning_temp_dir.h",
53       "shell_util.cc",
54       "shell_util.h",
55       "uninstall_metrics.cc",
56       "uninstall_metrics.h",
57       "user_experiment.cc",
58       "user_experiment.h",
59     ]
60     deps += [
61       ":strings",
62       "//base/third_party/dynamic_annotations",
63       "//components/metrics",
64       "//courgette:courgette_lib",
65       "//crypto",
66       "//third_party/bspatch",
67       "//third_party/icu",
68       "//third_party/lzma_sdk",
69     ]
71     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
72     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
74     # TODO(GYP) hook up corresponding version of installer_util_nacl_win64 in GN
75     sources += [
76       "advanced_firewall_manager_win.cc",
77       "advanced_firewall_manager_win.h",
78       "app_command.cc",
79       "app_command.h",
80       "app_commands.cc",
81       "app_commands.h",
82       "app_registration_data.h",
83       "auto_launch_util.cc",
84       "auto_launch_util.h",
85       "beacons.cc",
86       "beacons.h",
87       "browser_distribution.cc",
88       "browser_distribution.h",
89       "callback_work_item.cc",
90       "callback_work_item.h",
91       "channel_info.cc",
92       "channel_info.h",
93       "chrome_frame_distribution.cc",
94       "chrome_frame_distribution.h",
95       "chromium_binaries_distribution.cc",
96       "chromium_binaries_distribution.h",
97       "conditional_work_item_list.cc",
98       "conditional_work_item_list.h",
99       "copy_tree_work_item.cc",
100       "copy_tree_work_item.h",
101       "create_dir_work_item.cc",
102       "create_dir_work_item.h",
103       "create_reg_key_work_item.cc",
104       "create_reg_key_work_item.h",
105       "delete_reg_key_work_item.cc",
106       "delete_reg_key_work_item.h",
107       "delete_reg_value_work_item.cc",
108       "delete_reg_value_work_item.h",
109       "delete_tree_work_item.cc",
110       "delete_tree_work_item.h",
111       "duplicate_tree_detector.cc",
112       "duplicate_tree_detector.h",
113       "firewall_manager_win.cc",
114       "firewall_manager_win.h",
115       "google_chrome_binaries_distribution.cc",
116       "google_chrome_binaries_distribution.h",
117       "google_chrome_sxs_distribution.cc",
118       "google_chrome_sxs_distribution.h",
119       "google_update_constants.cc",
120       "google_update_constants.h",
121       "google_update_experiment_util.cc",
122       "google_update_experiment_util.h",
123       "google_update_settings.cc",
124       "google_update_settings.h",
125       "google_update_util.cc",
126       "google_update_util.h",
127       "helper.cc",
128       "helper.h",
129       "install_util.cc",
130       "install_util.h",
131       "installation_state.cc",
132       "installation_state.h",
133       "installer_state.cc",
134       "installer_state.h",
135       "l10n_string_util.cc",
136       "l10n_string_util.h",
137       "language_selector.cc",
138       "language_selector.h",
139       "legacy_firewall_manager_win.cc",
140       "legacy_firewall_manager_win.h",
141       "master_preferences_constants.cc",
142       "master_preferences_constants.h",
143       "move_tree_work_item.cc",
144       "move_tree_work_item.h",
145       "non_updating_app_registration_data.cc",
146       "non_updating_app_registration_data.h",
147       "registry_key_backup.cc",
148       "registry_key_backup.h",
149       "self_reg_work_item.cc",
150       "self_reg_work_item.h",
151       "set_reg_value_work_item.cc",
152       "set_reg_value_work_item.h",
153       "updating_app_registration_data.cc",
154       "updating_app_registration_data.h",
155       "util_constants.cc",
156       "util_constants.h",
157       "wmi.cc",
158       "wmi.h",
159       "work_item.cc",
160       "work_item.h",
161       "work_item_list.cc",
162       "work_item_list.h",
163     ]
164   } else {
165     sources = [
166       "google_update_experiment_util.cc",
167       "google_update_experiment_util.h",
168       "master_preferences.cc",
169       "master_preferences.h",
170       "master_preferences_constants.cc",
171       "master_preferences_constants.h",
172     ]
173   }
176 action("generate_strings") {
177   visibility = [ ":strings" ]
178   script = "prebuild/create_string_rc.py"
180   if (is_chrome_branded) {
181     grdfile = "//chrome/app/google_chrome_strings.grd"
182   } else {
183     grdfile = "//chrome/app/chromium_strings.grd"
184   }
186   inputs = [
187     grdfile,
188   ]
190   outputs = [
191     "$target_gen_dir/installer_util_strings.h",
192     "$target_gen_dir/installer_util_strings.rc",
193   ]
195   args = [
196     "-i",
197     rebase_path(grdfile, root_build_dir) + ":resources",
198     "-n",
199     "installer_util_strings",
200     "-o",
201     rebase_path(target_gen_dir, root_build_dir),
202   ]
205 # Compile the generated .rc file.
206 source_set("strings") {
207   sources = get_target_outputs(":generate_strings")
208   deps = [
209     ":generate_strings",
210   ]
213 if (is_win) {
214   test("installer_util_unittests") {
215     sources = [
216       "../setup/compat_checks_unittest.cc",
217       "../setup/setup_constants.cc",
218       "advanced_firewall_manager_win_unittest.cc",
219       "beacons_unittest.cc",
220       "callback_work_item_unittest.cc",
221       "channel_info_unittest.cc",
222       "copy_tree_work_item_unittest.cc",
223       "create_dir_work_item_unittest.cc",
224       "create_reg_key_work_item_unittest.cc",
225       "delete_after_reboot_helper_unittest.cc",
226       "delete_reg_key_work_item_unittest.cc",
227       "delete_reg_value_work_item_unittest.cc",
228       "delete_tree_work_item_unittest.cc",
229       "duplicate_tree_detector_unittest.cc",
230       "fake_installation_state.h",
231       "fake_product_state.h",
232       "google_update_settings_unittest.cc",
233       "install_util_unittest.cc",
234       "installation_validation_helper.cc",
235       "installation_validation_helper.h",
236       "installation_validator_unittest.cc",
237       "installer_state_unittest.cc",
238       "installer_util_test_common.cc",
239       "installer_util_test_common.h",
240       "language_selector_unittest.cc",
241       "legacy_firewall_manager_win_unittest.cc",
242       "logging_installer_unittest.cc",
243       "lzma_util_unittest.cc",
244       "master_preferences_unittest.cc",
245       "move_tree_work_item_unittest.cc",
246       "product_state_unittest.cc",
247       "product_unittest.cc",
248       "product_unittest.h",
249       "registry_key_backup_unittest.cc",
250       "registry_test_data.cc",
251       "registry_test_data.h",
252       "run_all_unittests.cc",
253       "self_cleaning_temp_dir_unittest.cc",
254       "set_reg_value_work_item_unittest.cc",
255       "shell_util_unittest.cc",
256       "test_app_registration_data.cc",
257       "test_app_registration_data.h",
258       "uninstall_metrics_unittest.cc",
259       "wmi_unittest.cc",
260       "work_item_list_unittest.cc",
261     ]
263     deps = [
264       ":strings",
265       ":util",
266       "//base",
267       "//base:i18n",
268       "//base/test:test_support",
269       "//chrome:other_version",
270       "//chrome/common",
271       "//chrome/installer/test:alternate_version_generator_lib",
272       "//content/public/common",
274       # TODO(rockot): Remove this hack when we fix mojo environment deps.
275       # See http://crbug.com/501385
276       "//mojo/environment:chromium",
277       "//testing/gmock",
278       "//testing/gtest",
279     ]
281     # TODO(GYP) manifest: $(ProjectDir)\\installer\\mini_installer\\mini_installer.exe.manifest
282   }
283 }  # is_win