mini_installer.gyp revision 3551c9c881056c480085172ff9840cab31610854
1{
2  'variables': {
3    'version_py': '../../chrome/tools/build/version.py',
4    'version_path': '../../chrome/VERSION',
5    'lastchange_path': '<(DEPTH)/build/util/LASTCHANGE',
6    # 'branding_dir' is set in the 'conditions' section at the bottom.
7    'msvs_use_common_release': 0,
8    'msvs_use_common_linker_extras': 0,
9    'mini_installer_internal_deps%': 0,
10    'mini_installer_official_deps%': 0,
11  },
12  'includes': [
13    '../../build/win_precompile.gypi',
14  ],
15  'conditions': [
16    ['OS=="win"', {
17      'target_defaults': {
18        'dependencies': [
19          '../chrome.gyp:app_host',
20          '../chrome.gyp:chrome',
21          '../chrome.gyp:chrome_nacl_win64',
22          '../chrome.gyp:chrome_dll',
23          '../chrome.gyp:default_extensions',
24          '../chrome.gyp:setup',
25        ],
26        'include_dirs': [
27          '../..',
28          '<(INTERMEDIATE_DIR)',
29          '<(SHARED_INTERMEDIATE_DIR)/chrome',
30        ],
31        'sources': [
32          'mini_installer/appid.h',
33          'mini_installer/configuration.cc',
34          'mini_installer/configuration.h',
35          'mini_installer/decompress.cc',
36          'mini_installer/decompress.h',
37          'mini_installer/mini_installer.cc',
38          'mini_installer/mini_installer.h',
39          'mini_installer/mini_installer.ico',
40          'mini_installer/mini_installer.rc',
41          'mini_installer/mini_installer_exe_version.rc.version',
42          'mini_installer/mini_installer_resource.h',
43          'mini_installer/mini_string.cc',
44          'mini_installer/mini_string.h',
45          'mini_installer/pe_resource.cc',
46          'mini_installer/pe_resource.h',
47          '<(INTERMEDIATE_DIR)/packed_files.rc',
48        ],
49        'msvs_settings': {
50          'VCCLCompilerTool': {
51            'EnableIntrinsicFunctions': 'true',
52            'BufferSecurityCheck': 'false',
53            'BasicRuntimeChecks': '0',
54            'ExceptionHandling': '0',
55          },
56          'VCLinkerTool': {
57            'RandomizedBaseAddress': '1',
58            'DataExecutionPrevention': '0',
59            'AdditionalLibraryDirectories': [
60              '<(PRODUCT_DIR)/lib'
61            ],
62            'DelayLoadDLLs': [],
63            'EntryPointSymbol': 'MainEntryPoint',
64            'IgnoreAllDefaultLibraries': 'true',
65            'OptimizeForWindows98': '1',
66            'SubSystem': '2',     # Set /SUBSYSTEM:WINDOWS
67            'AdditionalDependencies': [
68              'shlwapi.lib',
69              'setupapi.lib',
70            ],
71          },
72          'VCManifestTool': {
73            'AdditionalManifestFiles': [
74              '$(ProjectDir)\\mini_installer\\mini_installer.exe.manifest',
75            ],
76          },
77        },
78        'configurations': {
79          'Debug_Base': {
80            'msvs_settings': {
81              'VCCLCompilerTool': {
82                'BasicRuntimeChecks': '0',
83                'BufferSecurityCheck': 'false',
84                'ExceptionHandling': '0',
85              },
86              'VCLinkerTool': {
87                'SubSystem': '2',     # Set /SUBSYSTEM:WINDOWS
88                'AdditionalOptions': [
89                  '/safeseh:no',
90                  '/dynamicbase:no',
91                  '/ignore:4199',
92                  '/ignore:4221',
93                  '/nxcompat',
94                ],
95              },
96            },
97          },
98          'Release_Base': {
99            'includes': ['../../build/internal/release_defaults.gypi'],
100            'msvs_settings': {
101              'VCCLCompilerTool': {
102                'EnableIntrinsicFunctions': 'true',
103                'BasicRuntimeChecks': '0',
104                'BufferSecurityCheck': 'false',
105                'ExceptionHandling': '0',
106              },
107              'VCLinkerTool': {
108                'SubSystem': '2',     # Set /SUBSYSTEM:WINDOWS
109                'Profile': 'false',   # Conflicts with /FIXED
110                'AdditionalOptions': [
111                  '/SAFESEH:NO',
112                  '/NXCOMPAT',
113                  '/DYNAMICBASE:NO',
114                  '/FIXED',
115                ],
116              },
117            },
118          },
119        },
120        'rules': [
121          {
122            'rule_name': 'mini_installer_version',
123            'extension': 'version',
124            'variables': {
125              'template_input_path': 'mini_installer/mini_installer_exe_version.rc.version',
126            },
127            'inputs': [
128              '<(template_input_path)',
129              '<(version_path)',
130              '<(lastchange_path)',
131              '<(branding_dir)/BRANDING',
132            ],
133            'outputs': [
134              '<(PRODUCT_DIR)/mini_installer_exe_version.rc',
135            ],
136            'action': [
137              'python', '<(version_py)',
138              '-f', '<(version_path)',
139              '-f', '<(lastchange_path)',
140              '-f', '<(branding_dir)/BRANDING',
141              '<(template_input_path)',
142              '<@(_outputs)',
143            ],
144            'process_outputs_as_sources': 1,
145            'message': 'Generating version information'
146          },
147        ],
148        # TODO(mark):  <(branding_dir) should be defined by the
149        # global condition block at the bottom of the file, but
150        # this doesn't work due to the following issue:
151        #
152        #   http://code.google.com/p/gyp/issues/detail?id=22
153        #
154        # Remove this block once the above issue is fixed.
155        'conditions': [
156          [ 'branding == "Chrome"', {
157            'variables': {
158               'branding_dir': '../app/theme/google_chrome',
159            },
160          }, { # else branding!="Chrome"
161            'variables': {
162               'branding_dir': '../app/theme/chromium',
163            },
164          }],
165        ],
166      },
167      'targets': [
168        {
169          'target_name': 'mini_installer',
170          'type': 'executable',
171
172          # Disable precompiled headers for this project, to avoid
173          # linker errors when building with VS 2008.
174          'msvs_precompiled_header': '',
175          'msvs_precompiled_source': '',
176
177          # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
178          'msvs_disabled_warnings': [ 4267, ],
179
180          'variables': {
181            # Opt out the common compatibility manifest to work around
182            # crbug.com/272660.
183            # TODO(yukawa): Enable the common compatibility manifest again.
184            'win_exe_compatibility_manifest': '',
185          },
186          'sources': [
187            'mini_installer/chrome.release',
188            'mini_installer/chrome_appid.cc',
189          ],
190          'rules': [
191            {
192              'rule_name': 'installer_archive',
193              'extension': 'release',
194              'variables': {
195                'create_installer_archive_py_path':
196                  '../tools/build/win/create_installer_archive.py',
197              },
198              'conditions': [
199                ['enable_hidpi == 1', {
200                  'variables': {
201                    'enable_hidpi_flag': '--enable_hidpi=1',
202                  },
203                }, {
204                  'variables': {
205                    'enable_hidpi_flag': '',
206                  },
207                }],
208                ['enable_touch_ui == 1', {
209                  'variables': {
210                    'enable_touch_ui_flag': '--enable_touch_ui=1',
211                  },
212                }, {
213                  'variables': {
214                    'enable_touch_ui_flag': '',
215                  },
216                }],
217                ['component == "shared_library"', {
218                  'variables': {
219                    'component_build_flag': '--component_build=1',
220                  },
221                }, {
222                  'variables': {
223                    'component_build_flag': '',
224                  },
225                  'outputs': [
226                    '<(PRODUCT_DIR)/<(RULE_INPUT_NAME).packed.7z',
227                  ],
228                }],
229                ['disable_nacl==1', {
230                  'inputs!': [
231                    '<(PRODUCT_DIR)/nacl64.exe',
232                    '<(PRODUCT_DIR)/ppGoogleNaClPluginChrome.dll',
233                    '<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
234                    '<(PRODUCT_DIR)/nacl_irt_x86_64.nexe',
235                  ],
236                }],
237                ['target_arch=="x64"', {
238                  'inputs!': [
239                    '<(PRODUCT_DIR)/nacl64.exe',
240                    '<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
241                  ],
242                  'variables': {
243                    'target_arch_flag': '--target_arch=x64',
244                  },
245                }, {
246                  'variables': {
247                    'target_arch_flag': '--target_arch=x86',
248                  },
249                }],
250              ],
251              'inputs': [
252                '<(create_installer_archive_py_path)',
253                '<(PRODUCT_DIR)/app_host.exe',
254                '<(PRODUCT_DIR)/chrome.exe',
255                '<(PRODUCT_DIR)/chrome.dll',
256                '<(PRODUCT_DIR)/nacl64.exe',
257                '<(PRODUCT_DIR)/ppGoogleNaClPluginChrome.dll',
258                '<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
259                '<(PRODUCT_DIR)/nacl_irt_x86_64.nexe',
260                '<(PRODUCT_DIR)/locales/en-US.pak',
261                '<(PRODUCT_DIR)/icudt.dll',
262              ],
263              'outputs': [
264                # Also note that chrome.packed.7z is defined as an output in a
265                # conditional above.
266                'xxx2.out',
267                '<(PRODUCT_DIR)/<(RULE_INPUT_NAME).7z',
268                '<(PRODUCT_DIR)/setup.ex_',
269                '<(INTERMEDIATE_DIR)/packed_files.rc',
270              ],
271              'action': [
272                'python',
273                '<(create_installer_archive_py_path)',
274                '--build_dir', '<(PRODUCT_DIR)',
275                '--staging_dir', '<(INTERMEDIATE_DIR)',
276                '--input_file', '<(RULE_INPUT_PATH)',
277                '--resource_file_path', '<(INTERMEDIATE_DIR)/packed_files.rc',
278                '<(enable_hidpi_flag)',
279                '<(enable_touch_ui_flag)',
280                '<(component_build_flag)',
281                '<(target_arch_flag)',
282                # TODO(sgk):  may just use environment variables
283                #'--distribution=$(CHROMIUM_BUILD)',
284                '--distribution=_google_chrome',
285                # Optional arguments to generate diff installer
286                #'--last_chrome_installer=C:/Temp/base',
287                #'--setup_exe_format=DIFF',
288                #'--diff_algorithm=COURGETTE',
289              ],
290              'message': 'Create installer archive',
291              'msvs_cygwin_shell': 1,
292            },
293          ],
294        },
295      ],
296    }],
297    [ 'branding == "Chrome"', {
298      'variables': {
299         'branding_dir': '../app/theme/google_chrome',
300      },
301    }, { # else branding!="Chrome"
302      'variables': {
303         'branding_dir': '../app/theme/chromium',
304      },
305    }],
306  ],
307}
308