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