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