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