Supervised user interstitial: Handle missing custodian profile URL.
[chromium-blink-merge.git] / remoting / remoting_host_win.gypi
blob91e13e5a28197425a39b8771c1d2e8184470fbde
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.
6   'variables': {
7     'remoting_host_installer_win_roots': [
8       'host/installer/win/',
9     ],
10     'remoting_host_installer_win_files': [
11       'host/installer/win/chromoting.wxs',
12       'host/installer/win/parameters.json',
13     ],
14   },
16   'conditions': [
17     ['OS=="win"', {
18       'targets': [
19         {
20           'target_name': 'remoting_breakpad_tester',
21           'type': 'executable',
22           'variables': { 'enable_wexit_time_destructors': 1, },
23           'dependencies': [
24             '../base/base.gyp:base',
25             'remoting_host',
26           ],
27           'sources': [
28             'tools/breakpad_tester_win.cc',
29           ],
30         },  # end of target 'remoting_breakpad_tester'
31         {
32           'target_name': 'remoting_lib_idl',
33           'type': 'static_library',
34           'sources': [
35             'host/win/chromoting_lib_idl.templ',
36             '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib.h',
37             '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib.idl',
38             '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib_i.c',
39           ],
40           # This target exports a hard dependency because dependent targets may
41           # include chromoting_lib.h, a generated header.
42           'hard_dependency': 1,
43           'msvs_settings': {
44             'VCMIDLTool': {
45               'OutputDirectory': '<(SHARED_INTERMEDIATE_DIR)/remoting/host',
46             },
47           },
48           'direct_dependent_settings': {
49             'include_dirs': [
50               '<(SHARED_INTERMEDIATE_DIR)',
51             ],
52           },
53           'rules': [
54             {
55               'rule_name': 'generate_idl',
56               'extension': 'templ',
57               'outputs': [
58                 '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib.idl',
59               ],
60               'action': [
61                 'python', '<(version_py_path)',
62                 '-e', "DAEMON_CONTROLLER_CLSID='<(daemon_controller_clsid)'",
63                 '-e', "RDP_DESKTOP_SESSION_CLSID='<(rdp_desktop_session_clsid)'",
64                 '<(RULE_INPUT_PATH)',
65                 '<@(_outputs)',
66               ],
67               'process_outputs_as_sources': 1,
68               'message': 'Generating <@(_outputs)',
69             },
70           ],
71         },  # end of target 'remoting_lib_idl'
73         # remoting_lib_ps builds the proxy/stub code generated by MIDL (see
74         # remoting_lib_idl).
75         {
76           'target_name': 'remoting_lib_ps',
77           'type': 'static_library',
78           'defines': [
79             # Prepend 'Ps' to the MIDL-generated routines. This includes
80             # DllGetClassObject, DllCanUnloadNow, DllRegisterServer,
81             # DllUnregisterServer, and DllMain.
82             'ENTRY_PREFIX=Ps',
83             'REGISTER_PROXY_DLL',
84           ],
85           'dependencies': [
86             'remoting_lib_idl',
87           ],
88           'sources': [
89             '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib.dlldata.c',
90             '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib_p.c',
91           ],
92         },  # end of target 'remoting_lib_ps'
94         # Regenerates 'chromoting_lib.rc' (used to embed 'chromoting_lib.tlb'
95         # into remoting_core.dll's resources) every time
96         # 'chromoting_lib_idl.templ' changes. Making remoting_core depend on
97         # both this and 'remoting_lib_idl' targets ensures that the resorces
98         # are rebuilt every time the type library is updated. GYP alone is
99         # not smart enough to figure out this dependency on its own.
100         {
101           'target_name': 'remoting_lib_rc',
102           'type': 'none',
103           'sources': [
104             'host/win/chromoting_lib_idl.templ',
105           ],
106           'hard_dependency': 1,
107           'direct_dependent_settings': {
108             'include_dirs': [
109               '<(SHARED_INTERMEDIATE_DIR)',
110             ],
111           },
112           'rules': [
113             {
114               'rule_name': 'generate_rc',
115               'extension': 'templ',
116               'outputs': [
117                 '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib.rc',
118               ],
119               'action': [
120                 'echo 1 typelib "remoting/host/chromoting_lib.tlb" > <@(_outputs)',
121               ],
122               'message': 'Generating <@(_outputs)',
123             },
124           ],
125         },  # end of target 'remoting_lib_rc'
126         # The only difference between |remoting_console.exe| and
127         # |remoting_host.exe| is that the former is a console application.
128         # |remoting_console.exe| is used for debugging purposes.
129         {
130           'target_name': 'remoting_console',
131           'type': 'executable',
132           'variables': { 'enable_wexit_time_destructors': 1, },
133           'defines': [
134             'BINARY=BINARY_HOST_ME2ME',
135           ],
136           'dependencies': [
137             'remoting_core',
138             'remoting_windows_resources',
139           ],
140           'sources': [
141             '<(SHARED_INTERMEDIATE_DIR)/remoting/version.rc',
142             'host/win/entry_point.cc',
143           ],
144           'msvs_settings': {
145             'VCManifestTool': {
146               'AdditionalManifestFiles': [
147                 'host/win/dpi_aware.manifest',
148               ],
149             },
150             'VCLinkerTool': {
151               'EntryPointSymbol': 'HostEntryPoint',
152               'IgnoreAllDefaultLibraries': 'true',
153               'SubSystem': '1', # /SUBSYSTEM:CONSOLE
154             },
155           },
156         },  # end of target 'remoting_console'
157         {
158           'target_name': 'remoting_core',
159           'type': 'shared_library',
160           'variables': { 'enable_wexit_time_destructors': 1, },
161           'defines' : [
162             '_ATL_APARTMENT_THREADED',
163             '_ATL_CSTRING_EXPLICIT_CONSTRUCTORS',
164             '_ATL_NO_AUTOMATIC_NAMESPACE',
165             '_ATL_NO_EXCEPTIONS',
166             'BINARY=BINARY_CORE',
167             'DAEMON_CONTROLLER_CLSID="{<(daemon_controller_clsid)}"',
168             'RDP_DESKTOP_SESSION_CLSID="{<(rdp_desktop_session_clsid)}"',
169             'HOST_IMPLEMENTATION',
170             'ISOLATION_AWARE_ENABLED=1',
171             'STRICT',
172             'VERSION=<(version_full)',
173           ],
174           'dependencies': [
175             '../base/base.gyp:base',
176             '../base/base.gyp:base_static',
177             '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
178             '../ipc/ipc.gyp:ipc',
179             '../net/net.gyp:net',
180             '../third_party/webrtc/modules/modules.gyp:desktop_capture',
181             'remoting_base',
182             'remoting_breakpad',
183             'remoting_host',
184             'remoting_host_setup_base',
185             'remoting_it2me_host_static',
186             'remoting_lib_idl',
187             'remoting_lib_ps',
188             'remoting_lib_rc',
189             'remoting_me2me_host_static',
190             'remoting_native_messaging_base',
191             'remoting_protocol',
192             'remoting_windows_resources',
193           ],
194           'sources': [
195             '<(SHARED_INTERMEDIATE_DIR)/remoting/core.rc',
196             '<(SHARED_INTERMEDIATE_DIR)/remoting/host/chromoting_lib.rc',
197             '<(SHARED_INTERMEDIATE_DIR)/remoting/host/remoting_host_messages.rc',
198             '<(SHARED_INTERMEDIATE_DIR)/remoting/version.rc',
199             'host/desktop_process_main.cc',
200             'host/host_main.cc',
201             'host/host_main.h',
202             'host/it2me/it2me_native_messaging_host_main.cc',
203             'host/it2me/it2me_native_messaging_host_main.h',
204             'host/setup/me2me_native_messaging_host_main.cc',
205             'host/setup/me2me_native_messaging_host_main.h',
206             'host/verify_config_window_win.cc',
207             'host/verify_config_window_win.h',
208             'host/win/chromoting_module.cc',
209             'host/win/chromoting_module.h',
210             'host/win/core.cc',
211             'host/win/core_resource.h',
212             'host/win/elevated_controller.cc',
213             'host/win/elevated_controller.h',
214             'host/win/host_service.cc',
215             'host/win/host_service.h',
216             'host/win/omaha.cc',
217             'host/win/omaha.h',
218             'host/win/rdp_desktop_session.cc',
219             'host/win/rdp_desktop_session.h',
220             'host/win/unprivileged_process_delegate.cc',
221             'host/win/unprivileged_process_delegate.h',
222             'host/win/worker_process_launcher.cc',
223             'host/win/worker_process_launcher.h',
224             'host/win/wts_session_process_delegate.cc',
225             'host/win/wts_session_process_delegate.h',
226             'host/worker_process_ipc_delegate.h',
227           ],
228           'msvs_settings': {
229             'VCManifestTool': {
230               'EmbedManifest': 'true',
231               'AdditionalManifestFiles': [
232                 'host/win/common-controls.manifest',
233               ],
234             },
235             'VCLinkerTool': {
236               'AdditionalDependencies': [
237                 'comctl32.lib',
238                 'rpcns4.lib',
239                 'rpcrt4.lib',
240                 'uuid.lib',
241                 'wtsapi32.lib',
242               ],
243               'AdditionalOptions': [
244                 # Export the proxy/stub entry points. Note that the generated
245                 # routines have 'Ps' prefix to avoid conflicts with our own
246                 # DllMain().
247                 '/EXPORT:DllGetClassObject=PsDllGetClassObject,PRIVATE',
248                 '/EXPORT:DllCanUnloadNow=PsDllCanUnloadNow,PRIVATE',
249                 '/EXPORT:DllRegisterServer=PsDllRegisterServer,PRIVATE',
250                 '/EXPORT:DllUnregisterServer=PsDllUnregisterServer,PRIVATE',
251               ],
252             },
253           },
254         },  # end of target 'remoting_core'
255         {
256           'target_name': 'remoting_desktop',
257           'type': 'executable',
258           'variables': { 'enable_wexit_time_destructors': 1, },
259           'defines': [
260             'BINARY=BINARY_DESKTOP',
261           ],
262           'dependencies': [
263             'remoting_core',
264             'remoting_windows_resources',
265           ],
266           'sources': [
267             '<(SHARED_INTERMEDIATE_DIR)/remoting/version.rc',
268             'host/win/entry_point.cc',
269           ],
270           'msvs_settings': {
271             'VCManifestTool': {
272               'AdditionalManifestFiles': [
273                 'host/win/dpi_aware.manifest',
274               ],
275             },
276             'VCLinkerTool': {
277               'EnableUAC': 'true',
278               # Add 'level="requireAdministrator" uiAccess="true"' to
279               # the manifest only for the official builds because it requires
280               # the binary to be signed to work.
281               'conditions': [
282                 ['buildtype == "Official"', {
283                   'UACExecutionLevel': 2,
284                   'UACUIAccess': 'true',
285                 }],
286               ],
287               'EntryPointSymbol': 'HostEntryPoint',
288               'IgnoreAllDefaultLibraries': 'true',
289               'SubSystem': '2', # /SUBSYSTEM:WINDOWS
290             },
291           },
292         },  # end of target 'remoting_desktop'
293         {
294           'target_name': 'remoting_me2me_host',
295           'product_name': 'remoting_host',
296           'type': 'executable',
297           'variables': { 'enable_wexit_time_destructors': 1, },
298           'defines': [
299             'BINARY=BINARY_HOST_ME2ME',
300           ],
301           'dependencies': [
302             'remoting_core',
303             'remoting_windows_resources',
304           ],
305           'sources': [
306             '<(SHARED_INTERMEDIATE_DIR)/remoting/version.rc',
307             'host/win/entry_point.cc',
308           ],
309           'msvs_settings': {
310             'VCManifestTool': {
311               'AdditionalManifestFiles': [
312                 'host/win/dpi_aware.manifest',
313               ],
314             },
315             'VCLinkerTool': {
316               'EntryPointSymbol': 'HostEntryPoint',
317               'IgnoreAllDefaultLibraries': 'true',
318               'OutputFile': '$(OutDir)\\remoting_host.exe',
319               'SubSystem': '2', # /SUBSYSTEM:WINDOWS
320             },
321           },
322         },  # end of target 'remoting_me2me_host'
323         {
324           'target_name': 'remoting_me2me_native_messaging_host',
325           'type': 'executable',
326           'product_name': 'remoting_native_messaging_host',
327           'variables': { 'enable_wexit_time_destructors': 1, },
328           'defines' : [
329             'BINARY=BINARY_NATIVE_MESSAGING_HOST',
330           ],
331           'dependencies': [
332             'remoting_core',
333             'remoting_windows_resources',
334           ],
335           'sources': [
336             '<(SHARED_INTERMEDIATE_DIR)/remoting/version.rc',
337             'host/setup/me2me_native_messaging_host_entry_point.cc',
338           ],
339           'msvs_settings': {
340             'VCLinkerTool': {
341               'IgnoreAllDefaultLibraries': 'true',
342               'SubSystem': '1', # /SUBSYSTEM:CONSOLE
343             },
344           },
345         },  # end of target 'remoting_me2me_native_messaging_host'
346         {
347           'target_name': 'remoting_it2me_native_messaging_host',
348           'type': 'executable',
349           'product_name': 'remote_assistance_host',
350           'variables': { 'enable_wexit_time_destructors': 1, },
351           'dependencies': [
352             'remoting_core',
353             'remoting_windows_resources',
354           ],
355           'sources': [
356             '<(SHARED_INTERMEDIATE_DIR)/remoting/version.rc',
357             'host/it2me/it2me_native_messaging_host_entry_point.cc',
358           ],
359           'defines' : [
360             'BINARY=BINARY_REMOTE_ASSISTANCE_HOST',
361           ],
362           'msvs_settings': {
363             'VCManifestTool': {
364               'EmbedManifest': 'true',
365               'AdditionalManifestFiles': [
366                 'host/win/common-controls.manifest',
367                 'host/win/dpi_aware.manifest',
368               ],
369             },
370             'VCLinkerTool': {
371               'IgnoreAllDefaultLibraries': 'true',
372               'SubSystem': '1', # /SUBSYSTEM:CONSOLE
373               'AdditionalDependencies': [
374                 'comctl32.lib',
375               ],
376             },
377           },
378         },  # end of target 'remoting_it2me_native_messaging_host'
379         {
380           'target_name': 'remoting_host_messages',
381           'type': 'none',
382           'dependencies': [
383             'remoting_resources',
384           ],
385           'hard_dependency': 1,
386           'direct_dependent_settings': {
387             'include_dirs': [
388               '<(SHARED_INTERMEDIATE_DIR)',
389             ],
390           },
391           'sources': [
392             'host/win/host_messages.mc.jinja2'
393           ],
394           'rules': [
395             {
396               'rule_name': 'localize',
397               'extension': 'jinja2',
398               'outputs': [
399                 '<(SHARED_INTERMEDIATE_DIR)/remoting/host/remoting_host_messages.mc',
400               ],
401               'action': [
402                 'python', '<(remoting_localize_path)',
403                 '--locale_dir', '<(webapp_locale_dir)',
404                 '--template', '<(RULE_INPUT_PATH)',
405                 '--output', '<@(_outputs)',
406                 '--encoding', 'utf-16',
407                 '<@(remoting_locales)',
408               ],
409               'message': 'Localizing the event log messages'
410             },
411           ],
412         },  # end of target 'remoting_host_messages'
414         # Generates localized resources for the Windows binaries.
415         # The substitution strings are taken from:
416         #   - build/util/LASTCHANGE - the last source code revision. There is
417         #       no explicit dependency on this file to avoid rebuilding the host
418         #       after unrelated changes.
419         #   - chrome/VERSION - the major, build & patch versions.
420         #   - remoting/VERSION - the chromoting patch version (and overrides
421         #       for chrome/VERSION).
422         #   - translated webapp strings
423         {
424           'target_name': 'remoting_windows_resources',
425           'type': 'none',
426           'dependencies': [
427             'remoting_resources',
428           ],
429           'hard_dependency': 1,
430           'direct_dependent_settings': {
431             'include_dirs': [
432               '<(SHARED_INTERMEDIATE_DIR)',
433             ],
434           },
435           'sources': [
436             'host/win/core.rc.jinja2',
437             'host/win/version.rc.jinja2',
438           ],
439           'rules': [
440             {
441               'rule_name': 'version',
442               'extension': 'jinja2',
443               'variables': {
444                 'lastchange_path': '<(DEPTH)/build/util/LASTCHANGE',
445               },
446               'inputs': [
447                 '<(chrome_version_path)',
448                 '<(remoting_version_path)',
449               ],
450               'outputs': [
451                 '<(SHARED_INTERMEDIATE_DIR)/remoting/<(RULE_INPUT_ROOT)',
452               ],
453               'action': [
454                 'python', '<(remoting_localize_path)',
455                 '--variables', '<(chrome_version_path)',
456                 # |remoting_version_path| must be after |chrome_version_path|
457                 # because it can contain overrides for the version numbers.
458                 '--variables', '<(remoting_version_path)',
459                 '--variables', '<(lastchange_path)',
460                 '--locale_dir', '<(webapp_locale_dir)',
461                 '--template', '<(RULE_INPUT_PATH)',
462                 '--output', '<@(_outputs)',
463                 '--encoding', 'utf-16',
464                 '<@(remoting_locales)',
465               ],
466               'message': 'Localizing the version information'
467             },
468           ],
469         },  # end of target 'remoting_windows_resources'
470       ],  # end of 'targets'
471     }],  # 'OS=="win"'
473     # The host installation is generated only if WiX is available. If
474     # component build is used the produced installation will not work due to
475     # missing DLLs. We build it anyway to make sure the GYP scripts are executed
476     # by the bots.
477     ['OS == "win" and wix_exists == "True" and sas_dll_exists == "True"', {
478       'targets': [
479         {
480           'target_name': 'remoting_host_installation',
481           'type': 'none',
482           'dependencies': [
483             'remoting_me2me_host_archive',
484           ],
485           'sources': [
486             '<(PRODUCT_DIR)/remoting-me2me-host-<(OS).zip',
487           ],
488           'outputs': [
489             '<(PRODUCT_DIR)/chromoting.msi',
490           ],
491           'rules': [
492             {
493               'rule_name': 'zip2msi',
494               'extension': 'zip',
495               'inputs': [
496                 'tools/zip2msi.py',
497               ],
498               'outputs': [
499                 '<(PRODUCT_DIR)/chromoting.msi',
500               ],
501               'action': [
502                 'python', 'tools/zip2msi.py',
503                 '--wix_path', '<(wix_path)',
504                 '--intermediate_dir', '<(INTERMEDIATE_DIR)/installation',
505                 '--target_arch', '<(target_arch)',
506                 '<(RULE_INPUT_PATH)',
507                 '<@(_outputs)',
508               ],
509               'message': 'Generating <@(_outputs)',
510             },
511           ],
512         },  # end of target 'remoting_host_installation'
514         {
515           'target_name': 'remoting_me2me_host_archive',
516           'type': 'none',
517           'dependencies': [
518             '<(icu_gyp_path):icudata',
519             'remoting_core',
520             'remoting_desktop',
521             'remoting_it2me_native_messaging_host',
522             'remoting_me2me_host',
523             'remoting_me2me_native_messaging_host',
524             'remoting_native_messaging_manifests',
525           ],
526           'compiled_inputs': [
527             '<(PRODUCT_DIR)/remote_assistance_host.exe',
528             '<(PRODUCT_DIR)/remoting_core.dll',
529             '<(PRODUCT_DIR)/remoting_desktop.exe',
530             '<(PRODUCT_DIR)/remoting_host.exe',
531             '<(PRODUCT_DIR)/remoting_native_messaging_host.exe',
532           ],
533           'compiled_inputs_dst': [
534             'files/remote_assistance_host.exe',
535             'files/remoting_core.dll',
536             'files/remoting_desktop.exe',
537             'files/remoting_host.exe',
538             'files/remoting_native_messaging_host.exe',
539           ],
540           'conditions': [
541             ['buildtype == "Official"', {
542               'defs': [
543                 'OFFICIAL_BUILD=1',
544               ],
545             }, {  # else buildtype != "Official"
546               'defs': [
547                 'OFFICIAL_BUILD=0',
548               ],
549             }],
550           ],
551           'defs': [
552             'BRANDING=<(branding)',
553             'DAEMON_CONTROLLER_CLSID={<(daemon_controller_clsid)}',
554             'RDP_DESKTOP_SESSION_CLSID={<(rdp_desktop_session_clsid)}',
555             'VERSION=<(version_full)',
556           ],
557           'generated_files': [
558             '<@(_compiled_inputs)',
559             '<(sas_dll_path)/sas.dll',
560             '<(PRODUCT_DIR)/remoting/com.google.chrome.remote_assistance.json',
561             '<(PRODUCT_DIR)/remoting/com.google.chrome.remote_desktop.json',
562             'resources/chromoting.ico',
563             '<(PRODUCT_DIR)/icudtl.dat',
564           ],
565           'generated_files_dst': [
566             '<@(_compiled_inputs_dst)',
567             'files/sas.dll',
568             'files/com.google.chrome.remote_assistance.json',
569             'files/com.google.chrome.remote_desktop.json',
570             'files/chromoting.ico',
571             'files/icudtl.dat',
572           ],
573           'zip_path': '<(PRODUCT_DIR)/remoting-me2me-host-<(OS).zip',
574           'outputs': [
575             '<(_zip_path)',
576           ],
577           'actions': [
578             {
579               'action_name': 'Zip installer files for signing',
580               'temp_dir': '<(INTERMEDIATE_DIR)/installation',
581               'source_files': [
582                 '<@(remoting_host_installer_win_files)',
583               ],
584               'inputs': [
585                 '<@(_compiled_inputs)',
586                 '<(sas_dll_path)/sas.dll',
587                 '<@(_source_files)',
588                 'host/installer/build-installer-archive.py',
589                 'resources/chromoting.ico',
590               ],
591               'outputs': [
592                 '<(_zip_path)',
593               ],
594               'action': [
595                 'python', 'host/installer/build-installer-archive.py',
596                 '<(_temp_dir)',
597                 '<(_zip_path)',
598                 '--source-file-roots', '<@(remoting_host_installer_win_roots)',
599                 '--source-files', '<@(_source_files)',
600                 '--generated-files', '<@(_generated_files)',
601                 '--generated-files-dst', '<@(_generated_files_dst)',
602                 '--defs', '<@(_defs)',
603               ],
604             },
605           ],  # actions
606         }, # end of target 'remoting_me2me_host_archive'
607       ],  # end of 'targets'
608     }],  # '<(wix_path) != ""'
610   ],  # end of 'conditions'