Home | History | Annotate | Download | only in installer
      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
      3 # found in the LICENSE file.
      4 {
      5   'dependencies': [
      6     '<@(chrome_dll_project)',
      7     '../chrome.gyp:app_host',
      8     '../chrome.gyp:chrome',
      9     '../chrome.gyp:chrome_nacl_win64',
     10     '../chrome.gyp:default_extensions',
     11     '../chrome.gyp:setup',
     12   ],
     13   'include_dirs': [
     14     '../..',
     15     '<(INTERMEDIATE_DIR)',
     16     '<(SHARED_INTERMEDIATE_DIR)/chrome',
     17   ],
     18   'sources': [
     19     'mini_installer/appid.h',
     20     'mini_installer/chrome.release',
     21     'mini_installer/chrome_appid.cc',
     22     'mini_installer/configuration.cc',
     23     'mini_installer/configuration.h',
     24     'mini_installer/decompress.cc',
     25     'mini_installer/decompress.h',
     26     'mini_installer/mini_installer.cc',
     27     'mini_installer/mini_installer.h',
     28     'mini_installer/mini_installer.ico',
     29     'mini_installer/mini_installer.rc',
     30     'mini_installer/mini_installer_exe_version.rc.version',
     31     'mini_installer/mini_installer_resource.h',
     32     'mini_installer/mini_string.cc',
     33     'mini_installer/mini_string.h',
     34     'mini_installer/pe_resource.cc',
     35     'mini_installer/pe_resource.h',
     36     '<(INTERMEDIATE_DIR)/packed_files.rc',
     37   ],
     38   # Disable precompiled headers for this project, to avoid
     39   # linker errors when building with VS 2008.
     40   'msvs_precompiled_header': '',
     41   'msvs_precompiled_source': '',
     42   'msvs_settings': {
     43     'VCCLCompilerTool': {
     44       'EnableIntrinsicFunctions': 'true',
     45       'BufferSecurityCheck': 'false',
     46       'BasicRuntimeChecks': '0',
     47       'ExceptionHandling': '0',
     48     },
     49     'VCLinkerTool': {
     50       'OutputFile': '<(output_dir)/mini_installer.exe',
     51       'MapFileName': '<(output_dir)/mini_installer.map',
     52       'RandomizedBaseAddress': '1',
     53       'DataExecutionPrevention': '0',
     54       'AdditionalLibraryDirectories': [
     55         '<(PRODUCT_DIR)/lib'
     56       ],
     57       'DelayLoadDLLs': [],
     58       'EntryPointSymbol': 'MainEntryPoint',
     59       'GenerateMapFile': 'true',
     60       'IgnoreAllDefaultLibraries': 'true',
     61       'OptimizeForWindows98': '1',
     62       'SubSystem': '2',  # Set /SUBSYSTEM:WINDOWS
     63       'AdditionalDependencies': [
     64         'shlwapi.lib',
     65         'setupapi.lib',
     66       ],
     67       'conditions': [
     68         ['MSVS_VERSION=="2005e"', {
     69           'AdditionalDependencies': [  # Must explicitly link in VC2005E
     70             'advapi32.lib',
     71             'shell32.lib',
     72           ],
     73         }],
     74       ],
     75     },
     76     'VCManifestTool': {
     77       'AdditionalManifestFiles': [
     78         '$(ProjectDir)\\mini_installer\\mini_installer.exe.manifest',
     79       ],
     80     },
     81   },
     82   'configurations': {
     83     'Debug_Base': {
     84       'msvs_settings': {
     85         'VCCLCompilerTool': {
     86           'BasicRuntimeChecks': '0',
     87           'BufferSecurityCheck': 'false',
     88           'ExceptionHandling': '0',
     89         },
     90         'VCLinkerTool': {
     91           'SubSystem': '2',  # Set /SUBSYSTEM:WINDOWS
     92           'AdditionalOptions': [
     93             '/safeseh:no',
     94             '/dynamicbase:no',
     95             '/ignore:4199',
     96             '/ignore:4221',
     97             '/nxcompat',
     98           ],
     99         },
    100       },
    101     },
    102     'Release_Base': {
    103       'includes': ['../../build/internal/release_defaults.gypi'],
    104       'msvs_settings': {
    105         'VCCLCompilerTool': {
    106           'EnableIntrinsicFunctions': 'true',
    107           'BasicRuntimeChecks': '0',
    108           'BufferSecurityCheck': 'false',
    109           'ExceptionHandling': '0',
    110         },
    111         'VCLinkerTool': {
    112           'SubSystem': '2',  # Set /SUBSYSTEM:WINDOWS
    113           'Profile': 'false',  # Conflicts with /FIXED
    114           'AdditionalOptions': [
    115             '/SAFESEH:NO',
    116             '/NXCOMPAT',
    117             '/DYNAMICBASE:NO',
    118             '/FIXED',
    119           ],
    120         },
    121       },
    122     },
    123   },
    124   'rules': [
    125     {
    126       'rule_name': 'mini_installer_version',
    127       'extension': 'version',
    128       'variables': {
    129         'template_input_path':
    130             'mini_installer/mini_installer_exe_version.rc.version',
    131       },
    132       'inputs': [
    133         '<(template_input_path)',
    134         '<(version_path)',
    135         '<(lastchange_path)',
    136         '<(branding_dir)/BRANDING',
    137       ],
    138       'outputs': [
    139         '<(INTERMEDIATE_DIR)/mini_installer_exe_version.rc',
    140       ],
    141       'action': [
    142         'python', '<(version_py)',
    143         '-f', '<(version_path)',
    144         '-f', '<(lastchange_path)',
    145         '-f', '<(branding_dir)/BRANDING',
    146         '<(template_input_path)',
    147         '<@(_outputs)',
    148       ],
    149       'process_outputs_as_sources': 1,
    150       'message': 'Generating version information'
    151     },
    152     {
    153       'rule_name': 'installer_archive',
    154       'extension': 'release',
    155       'variables': {
    156         'create_installer_archive_py_path':
    157           '../tools/build/win/create_installer_archive.py',
    158       },
    159       'conditions': [
    160         ['enable_hidpi == 1', {
    161           'variables': {
    162             'enable_hidpi_flag': '--enable_hidpi=1',
    163           },
    164         }, {
    165           'variables': {
    166             'enable_hidpi_flag': '',
    167           },
    168         }],
    169         ['enable_touch_ui == 1', {
    170           'variables': {
    171             'enable_touch_ui_flag': '--enable_touch_ui=1',
    172           },
    173         }, {
    174           'variables': {
    175             'enable_touch_ui_flag': '',
    176           },
    177         }],
    178         ['target_arch=="x64"', {
    179           'inputs!': [
    180             '<(PRODUCT_DIR)/nacl64.exe',
    181             '<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
    182           ],
    183           'variables': {
    184             'target_arch_flag': '--target_arch=x64',
    185           },
    186         }, {
    187           'variables': {
    188             'target_arch_flag': '--target_arch=x86',
    189           },
    190         }],
    191       ],
    192       'inputs': [
    193         '<(create_installer_archive_py_path)',
    194         '<(PRODUCT_DIR)/app_host.exe',
    195         '<(PRODUCT_DIR)/chrome.exe',
    196         '<@(chrome_dll_path)',
    197         '<(PRODUCT_DIR)/nacl64.exe',
    198         '<(PRODUCT_DIR)/ppGoogleNaClPluginChrome.dll',
    199         '<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
    200         '<(PRODUCT_DIR)/nacl_irt_x86_64.nexe',
    201         '<(PRODUCT_DIR)/locales/en-US.pak',
    202         '<(PRODUCT_DIR)/icudt.dll',
    203       ],
    204       'outputs': [
    205         'xxx.out',
    206         '<(output_dir)/<(RULE_INPUT_NAME).7z',
    207         '<(output_dir)/<(RULE_INPUT_NAME).packed.7z',
    208         '<(output_dir)/setup.ex_',
    209         '<(INTERMEDIATE_DIR)/packed_files.rc',
    210       ],
    211       'action': [
    212         'python',
    213         '<(create_installer_archive_py_path)',
    214         '--build_dir=<(PRODUCT_DIR)',
    215         '--output_dir=<(output_dir)',
    216         '--staging_dir=<(INTERMEDIATE_DIR)',
    217         '--input_file=<(RULE_INPUT_PATH)',
    218         '--resource_file_path=<(INTERMEDIATE_DIR)/packed_files.rc',
    219         '<(enable_hidpi_flag)',
    220         '<(enable_touch_ui_flag)',
    221         '<(target_arch_flag)',
    222         # TODO(sgk):  may just use environment variables
    223         #'--distribution=$(CHROMIUM_BUILD)',
    224         '--distribution=_google_chrome',
    225         # Optional arguments to generate diff installer
    226         #'--last_chrome_installer=C:/Temp/base',
    227         #'--setup_exe_format=DIFF',
    228         #'--diff_algorithm=COURGETTE',
    229       ],
    230       'message': 'Create installer archive'
    231     },
    232   ],
    233   # TODO(mark):  <(branding_dir) should be defined by the
    234   # global condition block at the bottom of the file, but
    235   # this doesn't work due to the following issue:
    236   #
    237   #   http://code.google.com/p/gyp/issues/detail?id=22
    238   #
    239   # Remove this block once the above issue is fixed.
    240   'conditions': [
    241     [ 'branding == "Chrome"', {
    242       'variables': {
    243          'branding_dir': '../app/theme/google_chrome',
    244       },
    245     }, { # else branding!="Chrome"
    246       'variables': {
    247          'branding_dir': '../app/theme/chromium',
    248       },
    249     }],
    250   ],
    251 }
    252