summaryrefslogtreecommitdiffstats
path: root/chrome/installer/mini_installer.gyp
blob: 3352274694a7994632f0c65201faf9a6b4df6a21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
{
  'variables': {
    'version_py': '../../chrome/tools/build/version.py',
    'version_path': '../../chrome/VERSION',
    'lastchange_path': '<(DEPTH)/build/util/LASTCHANGE',
    # 'branding_dir' is set in the 'conditions' section at the bottom.
    'msvs_use_common_release': 0,
    'msvs_use_common_linker_extras': 0,
    'mini_installer_internal_deps%': 0,
    'mini_installer_official_deps%': 0,
  },
  'includes': [
    '../../build/win_precompile.gypi',
  ],
  'conditions': [
    ['OS=="win"', {
      'targets': [
        {
          'target_name': 'mini_installer',
          'type': 'executable',

          'dependencies': [
            '../chrome.gyp:chrome',
            '../chrome.gyp:chrome_nacl_win64',
            '../chrome.gyp:chrome_dll',
            '../chrome.gyp:default_extensions',
            '../chrome.gyp:setup',
          ],
          'include_dirs': [
            '../..',
            '<(INTERMEDIATE_DIR)',
            '<(SHARED_INTERMEDIATE_DIR)/chrome',
          ],
          'sources': [
            'mini_installer/appid.h',
            'mini_installer/chrome.release',
            'mini_installer/chrome_appid.cc',
            'mini_installer/configuration.cc',
            'mini_installer/configuration.h',
            'mini_installer/decompress.cc',
            'mini_installer/decompress.h',
            'mini_installer/mini_installer.cc',
            'mini_installer/mini_installer.h',
            'mini_installer/mini_installer.ico',
            'mini_installer/mini_installer.rc',
            'mini_installer/mini_installer_exe_version.rc.version',
            'mini_installer/mini_installer_resource.h',
            'mini_installer/mini_string.cc',
            'mini_installer/mini_string.h',
            'mini_installer/pe_resource.cc',
            'mini_installer/pe_resource.h',
            '<(INTERMEDIATE_DIR)/packed_files.rc',
          ],
          'msvs_settings': {
            'VCCLCompilerTool': {
              'EnableIntrinsicFunctions': 'true',
              'BufferSecurityCheck': 'false',
              'BasicRuntimeChecks': '0',
              'ExceptionHandling': '0',
            },
            'VCLinkerTool': {
              'RandomizedBaseAddress': '1',
              'DataExecutionPrevention': '0',
              'AdditionalLibraryDirectories': [
                '<(PRODUCT_DIR)/lib'
              ],
              'DelayLoadDLLs': [],
              'EntryPointSymbol': 'MainEntryPoint',
              'IgnoreAllDefaultLibraries': 'true',
              'OptimizeForWindows98': '1',
              'SubSystem': '2',     # Set /SUBSYSTEM:WINDOWS
              'AdditionalDependencies': [
                'shlwapi.lib',
                'setupapi.lib',
              ],
            },
            'VCManifestTool': {
              'AdditionalManifestFiles': [
                '$(ProjectDir)\\mini_installer\\mini_installer.exe.manifest',
              ],
            },
          },
          'configurations': {
            'Debug_Base': {
              'msvs_settings': {
                'VCCLCompilerTool': {
                  'BasicRuntimeChecks': '0',
                  'BufferSecurityCheck': 'false',
                  'ExceptionHandling': '0',
                },
                'VCLinkerTool': {
                  'SubSystem': '2',     # Set /SUBSYSTEM:WINDOWS
                  'AdditionalOptions': [
                    '/safeseh:no',
                    '/dynamicbase:no',
                    '/ignore:4199',
                    '/ignore:4221',
                    '/nxcompat',
                  ],
                },
              },
            },
            'Release_Base': {
              'includes': ['../../build/internal/release_defaults.gypi'],
              'msvs_settings': {
                'VCCLCompilerTool': {
                  'EnableIntrinsicFunctions': 'true',
                  'BasicRuntimeChecks': '0',
                  'BufferSecurityCheck': 'false',
                  'ExceptionHandling': '0',
                },
                'VCLinkerTool': {
                  'SubSystem': '2',     # Set /SUBSYSTEM:WINDOWS
                  'Profile': 'false',   # Conflicts with /FIXED
                  'AdditionalOptions': [
                    '/SAFESEH:NO',
                    '/NXCOMPAT',
                    '/DYNAMICBASE:NO',
                    '/FIXED',
                  ],
                },
              },
            },
          },

          # Disable precompiled headers for this project, to avoid
          # linker errors when building with VS 2008.
          'msvs_precompiled_header': '',
          'msvs_precompiled_source': '',

          # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
          'msvs_disabled_warnings': [ 4267, ],

          'variables': {
            # Opt out the common compatibility manifest to work around
            # crbug.com/272660.
            # TODO(yukawa): Enable the common compatibility manifest again.
            'win_exe_compatibility_manifest': '',
          },
          'rules': [
            {
              'rule_name': 'mini_installer_version',
              'extension': 'version',
              'variables': {
                'template_input_path': 'mini_installer/mini_installer_exe_version.rc.version',
              },
              'inputs': [
                '<(template_input_path)',
                '<(version_path)',
                '<(lastchange_path)',
                '<(branding_dir)/BRANDING',
              ],
              'outputs': [
                '<(PRODUCT_DIR)/mini_installer_exe_version.rc',
              ],
              'action': [
                'python', '<(version_py)',
                '-f', '<(version_path)',
                '-f', '<(lastchange_path)',
                '-f', '<(branding_dir)/BRANDING',
                '<(template_input_path)',
                '<@(_outputs)',
              ],
              'process_outputs_as_sources': 1,
              'message': 'Generating version information'
            },
            {
              'rule_name': 'installer_archive',
              'extension': 'release',
              'variables': {
                'create_installer_archive_py_path':
                  '../tools/build/win/create_installer_archive.py',
              },
              'conditions': [
                ['enable_hidpi == 1', {
                  'variables': {
                    'enable_hidpi_flag': '--enable_hidpi=1',
                  },
                }, {
                  'variables': {
                    'enable_hidpi_flag': '',
                  },
                }],
                ['component == "shared_library"', {
                  'variables': {
                    'component_build_flag': '--component_build=1',
                  },
                }, {
                  'variables': {
                    'component_build_flag': '',
                  },
                  'outputs': [
                    '<(PRODUCT_DIR)/<(RULE_INPUT_NAME).packed.7z',
                  ],
                }],
                ['disable_nacl==1', {
                  'inputs!': [
                    '<(PRODUCT_DIR)/nacl64.exe',
                    '<(PRODUCT_DIR)/ppGoogleNaClPluginChrome.dll',
                    '<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
                    '<(PRODUCT_DIR)/nacl_irt_x86_64.nexe',
                  ],
                }],
                ['target_arch=="x64"', {
                  'inputs!': [
                    '<(PRODUCT_DIR)/nacl64.exe',
                    '<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
                  ],
                  'variables': {
                    'target_arch_flag': '--target_arch=x64',
                  },
                }, {
                  'variables': {
                    'target_arch_flag': '--target_arch=x86',
                  },
                }],
                ['icu_use_data_file_flag == 0', {
                  'inputs': [
                    '<(PRODUCT_DIR)/icudt.dll',
                  ],
                }, { # else icu_use_data_file_flag != 0
                  'inputs': [
                    '<(PRODUCT_DIR)/icudtl.dat',
                  ],
                }],
              ],
              'inputs': [
                '<(create_installer_archive_py_path)',
                '<(PRODUCT_DIR)/chrome.exe',
                '<(PRODUCT_DIR)/chrome.dll',
                '<(PRODUCT_DIR)/nacl64.exe',
                '<(PRODUCT_DIR)/ppGoogleNaClPluginChrome.dll',
                '<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
                '<(PRODUCT_DIR)/nacl_irt_x86_64.nexe',
                '<(PRODUCT_DIR)/locales/en-US.pak',
              ],
              'outputs': [
                # Also note that chrome.packed.7z is defined as an output in a
                # conditional above.
                'xxx2.out',
                '<(PRODUCT_DIR)/<(RULE_INPUT_NAME).7z',
                '<(PRODUCT_DIR)/setup.ex_',
                '<(INTERMEDIATE_DIR)/packed_files.rc',
              ],
              'action': [
                'python',
                '<(create_installer_archive_py_path)',
                '--build_dir', '<(PRODUCT_DIR)',
                '--staging_dir', '<(INTERMEDIATE_DIR)',
                '--input_file', '<(RULE_INPUT_PATH)',
                '--resource_file_path', '<(INTERMEDIATE_DIR)/packed_files.rc',
                '<(enable_hidpi_flag)',
                '<(component_build_flag)',
                '<(target_arch_flag)',
                # TODO(sgk):  may just use environment variables
                #'--distribution=$(CHROMIUM_BUILD)',
                '--distribution=_google_chrome',
                # Optional arguments to generate diff installer
                #'--last_chrome_installer=C:/Temp/base',
                #'--setup_exe_format=DIFF',
                #'--diff_algorithm=COURGETTE',
              ],
              'message': 'Create installer archive',
            },
          ],
          # TODO(mark):  <(branding_dir) should be defined by the
          # global condition block at the bottom of the file, but
          # this doesn't work due to the following issue:
          #
          #   http://code.google.com/p/gyp/issues/detail?id=22
          #
          # Remove this block once the above issue is fixed.
          'conditions': [
            [ 'branding == "Chrome"', {
              'variables': {
                 'branding_dir': '../app/theme/google_chrome',
              },
            }, { # else branding!="Chrome"
              'variables': {
                 'branding_dir': '../app/theme/chromium',
              },
            }],
          ],
        },
      ],
      'conditions': [
        ['test_isolation_mode != "noop"', {
          'targets': [
            {
              'target_name': 'mini_installer_tests_run',
              'type': 'none',
              'dependencies': [
                'mini_installer',
              ],
              'includes': [
                '../../build/isolate.gypi',
                'mini_installer_tests.isolate',
              ],
              'sources': [
                'mini_installer_tests.isolate',
              ],
            },
          ],
        }],
      ],
    }],
    [ 'branding == "Chrome"', {
      'variables': {
         'branding_dir': '../app/theme/google_chrome',
      },
    }, { # else branding!="Chrome"
      'variables': {
         'branding_dir': '../app/theme/chromium',
      },
    }],
  ],
}