mini_installer.gyp revision 5821806d5e7f356e8fa4b058a389a808ea183019
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              '<(DEPTH)/third_party/platformsdk_win7/files/Lib',
61              '<(PRODUCT_DIR)/lib'
62            ],
63            'DelayLoadDLLs': [],
64            'EntryPointSymbol': 'MainEntryPoint',
65            'GenerateMapFile': 'true',
66            'IgnoreAllDefaultLibraries': 'true',
67            'OptimizeForWindows98': '1',
68            'SubSystem': '2',     # Set /SUBSYSTEM:WINDOWS
69            'AdditionalDependencies': [
70              'shlwapi.lib',
71              'setupapi.lib',
72            ],
73          },
74          'VCManifestTool': {
75            'AdditionalManifestFiles': [
76              '$(ProjectDir)\\mini_installer\\mini_installer.exe.manifest',
77            ],
78          },
79        },
80        'configurations': {
81          'Debug_Base': {
82            'msvs_settings': {
83              'VCCLCompilerTool': {
84                'BasicRuntimeChecks': '0',
85                'BufferSecurityCheck': 'false',
86                'ExceptionHandling': '0',
87              },
88              'VCLinkerTool': {
89                'SubSystem': '2',     # Set /SUBSYSTEM:WINDOWS
90                'AdditionalOptions': [
91                  '/safeseh:no',
92                  '/dynamicbase:no',
93                  '/ignore:4199',
94                  '/ignore:4221',
95                  '/nxcompat',
96                ],
97              },
98            },
99          },
100          'Release_Base': {
101            'includes': ['../../build/internal/release_defaults.gypi'],
102            'msvs_settings': {
103              'VCCLCompilerTool': {
104                'EnableIntrinsicFunctions': 'true',
105                'BasicRuntimeChecks': '0',
106                'BufferSecurityCheck': 'false',
107                'ExceptionHandling': '0',
108              },
109              'VCLinkerTool': {
110                'SubSystem': '2',     # Set /SUBSYSTEM:WINDOWS
111                'Profile': 'false',   # Conflicts with /FIXED
112                'AdditionalOptions': [
113                  '/SAFESEH:NO',
114                  '/NXCOMPAT',
115                  '/DYNAMICBASE:NO',
116                  '/FIXED',
117                ],
118              },
119            },
120          },
121        },
122        'rules': [
123          {
124            'rule_name': 'mini_installer_version',
125            'extension': 'version',
126            'variables': {
127              'template_input_path': 'mini_installer/mini_installer_exe_version.rc.version',
128            },
129            'inputs': [
130              '<(template_input_path)',
131              '<(version_path)',
132              '<(lastchange_path)',
133              '<(branding_dir)/BRANDING',
134            ],
135            'outputs': [
136              '<(INTERMEDIATE_DIR)/mini_installer_exe_version.rc',
137            ],
138            'action': [
139              'python', '<(version_py)',
140              '-f', '<(version_path)',
141              '-f', '<(lastchange_path)',
142              '-f', '<(branding_dir)/BRANDING',
143              '<(template_input_path)',
144              '<@(_outputs)',
145            ],
146            'process_outputs_as_sources': 1,
147            'message': 'Generating version information'
148          },
149        ],
150        # TODO(mark):  <(branding_dir) should be defined by the
151        # global condition block at the bottom of the file, but
152        # this doesn't work due to the following issue:
153        #
154        #   http://code.google.com/p/gyp/issues/detail?id=22
155        #
156        # Remove this block once the above issue is fixed.
157        'conditions': [
158          [ 'branding == "Chrome"', {
159            'variables': {
160               'branding_dir': '../app/theme/google_chrome',
161            },
162          }, { # else branding!="Chrome"
163            'variables': {
164               'branding_dir': '../app/theme/chromium',
165            },
166          }],
167        ],
168      },
169      'targets': [
170        {
171          'target_name': 'mini_installer',
172          'type': 'executable',
173
174          # Disable precompiled headers for this project, to avoid
175          # linker errors when building with VS 2008.
176          'msvs_precompiled_header': '',
177          'msvs_precompiled_source': '',
178
179          'sources': [
180            'mini_installer/chrome.release',
181            'mini_installer/chrome_appid.cc',
182          ],
183          'rules': [
184            {
185              'rule_name': 'installer_archive',
186              'extension': 'release',
187              'variables': {
188                'create_installer_archive_py_path':
189                  '../tools/build/win/create_installer_archive.py',
190              },
191              'conditions': [
192                ['enable_hidpi == 1', {
193                  'variables': {
194                    'enable_hidpi_flag': '--enable_hidpi=1',
195                  },
196                }, {
197                  'variables': {
198                    'enable_hidpi_flag': '',
199                  },
200                }],
201                ['enable_touch_ui == 1', {
202                  'variables': {
203                    'enable_touch_ui_flag': '--enable_touch_ui=1',
204                  },
205                }, {
206                  'variables': {
207                    'enable_touch_ui_flag': '',
208                  },
209                }],
210                ['component == "shared_library"', {
211                  'variables': {
212                    'component_build_flag': '--component_build=1',
213                  },
214                }, {
215                  'variables': {
216                    'component_build_flag': '',
217                  },
218                  'outputs': [
219                    '<(PRODUCT_DIR)/<(RULE_INPUT_NAME).packed.7z',
220                  ],
221                }],
222                ['disable_nacl==1', {
223                  'inputs!': [
224                    '<(PRODUCT_DIR)/nacl64.exe',
225                    '<(PRODUCT_DIR)/ppGoogleNaClPluginChrome.dll',
226                    '<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
227                    '<(PRODUCT_DIR)/nacl_irt_x86_64.nexe',
228                    '<(PRODUCT_DIR)/nacl_ipc_irt_x86_32.nexe',
229                    '<(PRODUCT_DIR)/nacl_ipc_irt_x86_64.nexe',
230                  ],
231                }],
232              ],
233              'inputs': [
234                '<(create_installer_archive_py_path)',
235                '<(PRODUCT_DIR)/app_host.exe',
236                '<(PRODUCT_DIR)/chrome.exe',
237                '<(PRODUCT_DIR)/chrome.dll',
238                '<(PRODUCT_DIR)/nacl64.exe',
239                '<(PRODUCT_DIR)/ppGoogleNaClPluginChrome.dll',
240                '<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
241                '<(PRODUCT_DIR)/nacl_irt_x86_64.nexe',
242                '<(PRODUCT_DIR)/nacl_ipc_irt_x86_32.nexe',
243                '<(PRODUCT_DIR)/nacl_ipc_irt_x86_64.nexe',
244                '<(PRODUCT_DIR)/locales/en-US.pak',
245                '<(PRODUCT_DIR)/icudt.dll',
246              ],
247              'outputs': [
248                # Also note that chrome.packed.7z is defined as an output in a
249                # conditional above.
250                'xxx2.out',
251                '<(PRODUCT_DIR)/<(RULE_INPUT_NAME).7z',
252                '<(PRODUCT_DIR)/setup.ex_',
253                '<(INTERMEDIATE_DIR)/packed_files.rc',
254              ],
255              'action': [
256                'python',
257                '<(create_installer_archive_py_path)',
258                '--build_dir', '<(PRODUCT_DIR)',
259                '--staging_dir', '<(INTERMEDIATE_DIR)',
260                '--input_file', '<(RULE_INPUT_PATH)',
261                '--resource_file_path', '<(INTERMEDIATE_DIR)/packed_files.rc',
262                '<(enable_hidpi_flag)',
263                '<(enable_touch_ui_flag)',
264                '<(component_build_flag)',
265                # TODO(sgk):  may just use environment variables
266                #'--distribution=$(CHROMIUM_BUILD)',
267                '--distribution=_google_chrome',
268                # Optional arguments to generate diff installer
269                #'--last_chrome_installer=C:/Temp/base',
270                #'--setup_exe_format=DIFF',
271                #'--diff_algorithm=COURGETTE',
272              ],
273              'message': 'Create installer archive'
274            },
275          ],
276        },
277      ],
278    }],
279    [ 'branding == "Chrome"', {
280      'variables': {
281         'branding_dir': '../app/theme/google_chrome',
282      },
283    }, { # else branding!="Chrome"
284      'variables': {
285         'branding_dir': '../app/theme/chromium',
286      },
287    }],
288  ],
289}
290