1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Use of this source code is governed by a BSD-style license that can be 3 # found in the LICENSE file. 4 { 5 'dependencies': [ 6 '<@(chrome_dll_project)', 7 '../chrome.gyp:chrome', 8 '../chrome.gyp:chrome_nacl_win64', 9 '../chrome.gyp:default_extensions', 10 '../chrome.gyp:setup', 11 ], 12 'include_dirs': [ 13 '../..', 14 '<(INTERMEDIATE_DIR)', 15 '<(SHARED_INTERMEDIATE_DIR)/chrome', 16 ], 17 'sources': [ 18 'mini_installer/appid.h', 19 'mini_installer/chrome.release', 20 'mini_installer/chrome_appid.cc', 21 'mini_installer/configuration.cc', 22 'mini_installer/configuration.h', 23 'mini_installer/decompress.cc', 24 'mini_installer/decompress.h', 25 'mini_installer/exit_code.h', 26 'mini_installer/mini_installer.cc', 27 'mini_installer/mini_installer.ico', 28 'mini_installer/mini_installer.rc', 29 'mini_installer/mini_installer_constants.cc', 30 'mini_installer/mini_installer_constants.h', 31 'mini_installer/mini_installer_exe_version.rc.version', 32 'mini_installer/mini_installer_resource.h', 33 'mini_installer/mini_string.cc', 34 'mini_installer/mini_string.h', 35 'mini_installer/pe_resource.cc', 36 'mini_installer/pe_resource.h', 37 '<(INTERMEDIATE_DIR)/packed_files.rc', 38 ], 39 # Disable precompiled headers for this project, to avoid 40 # linker errors when building with VS 2008. 41 'msvs_precompiled_header': '', 42 'msvs_precompiled_source': '', 43 'msvs_settings': { 44 'VCCLCompilerTool': { 45 'EnableIntrinsicFunctions': 'true', 46 'BufferSecurityCheck': 'false', 47 'BasicRuntimeChecks': '0', 48 'ExceptionHandling': '0', 49 }, 50 'VCLinkerTool': { 51 'OutputFile': '<(output_dir)/mini_installer.exe', 52 'RandomizedBaseAddress': '1', 53 'DataExecutionPrevention': '0', 54 'AdditionalLibraryDirectories': [ 55 '<(PRODUCT_DIR)/lib' 56 ], 57 'DelayLoadDLLs': [], 58 'EntryPointSymbol': 'MainEntryPoint', 59 'IgnoreAllDefaultLibraries': 'true', 60 'OptimizeForWindows98': '1', 61 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS 62 'AdditionalDependencies': [ 63 'shlwapi.lib', 64 'setupapi.lib', 65 ], 66 }, 67 'VCManifestTool': { 68 'AdditionalManifestFiles': [ 69 '$(ProjectDir)\\mini_installer\\mini_installer.exe.manifest', 70 ], 71 }, 72 }, 73 'configurations': { 74 'Debug_Base': { 75 'msvs_settings': { 76 'VCCLCompilerTool': { 77 'BasicRuntimeChecks': '0', 78 'BufferSecurityCheck': 'false', 79 'ExceptionHandling': '0', 80 }, 81 'VCLinkerTool': { 82 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS 83 'AdditionalOptions': [ 84 '/safeseh:no', 85 '/dynamicbase:no', 86 '/ignore:4199', 87 '/ignore:4221', 88 '/nxcompat', 89 ], 90 }, 91 }, 92 }, 93 'Release_Base': { 94 'includes': ['../../build/internal/release_defaults.gypi'], 95 'msvs_settings': { 96 'VCCLCompilerTool': { 97 'EnableIntrinsicFunctions': 'true', 98 'BasicRuntimeChecks': '0', 99 'BufferSecurityCheck': 'false', 100 'ExceptionHandling': '0', 101 }, 102 'VCLinkerTool': { 103 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS 104 'Profile': 'false', # Conflicts with /FIXED 105 'AdditionalOptions': [ 106 '/SAFESEH:NO', 107 '/NXCOMPAT', 108 '/DYNAMICBASE:NO', 109 '/FIXED', 110 ], 111 }, 112 }, 113 }, 114 }, 115 'rules': [ 116 { 117 'rule_name': 'mini_installer_version', 118 'extension': 'version', 119 'variables': { 120 'template_input_path': 121 'mini_installer/mini_installer_exe_version.rc.version', 122 }, 123 'inputs': [ 124 '<(template_input_path)', 125 '<(version_path)', 126 '<(lastchange_path)', 127 '<(branding_dir)/BRANDING', 128 ], 129 'outputs': [ 130 '<(INTERMEDIATE_DIR)/mini_installer_exe_version.rc', 131 ], 132 'action': [ 133 'python', '<(version_py)', 134 '-f', '<(version_path)', 135 '-f', '<(lastchange_path)', 136 '-f', '<(branding_dir)/BRANDING', 137 '<(template_input_path)', 138 '<@(_outputs)', 139 ], 140 'process_outputs_as_sources': 1, 141 'message': 'Generating version information' 142 }, 143 { 144 'rule_name': 'installer_archive', 145 'extension': 'release', 146 'variables': { 147 'create_installer_archive_py_path': 148 '../tools/build/win/create_installer_archive.py', 149 }, 150 'conditions': [ 151 ['enable_hidpi == 1', { 152 'variables': { 153 'enable_hidpi_flag': '--enable_hidpi=1', 154 }, 155 }, { 156 'variables': { 157 'enable_hidpi_flag': '', 158 }, 159 }], 160 ['target_arch=="x64"', { 161 'inputs!': [ 162 '<(PRODUCT_DIR)/nacl64.exe', 163 '<(PRODUCT_DIR)/nacl_irt_x86_32.nexe', 164 ], 165 'variables': { 166 'target_arch_flag': '--target_arch=x64', 167 }, 168 }, { 169 'variables': { 170 'target_arch_flag': '--target_arch=x86', 171 }, 172 }], 173 ['icu_use_data_file_flag == 0', { 174 'inputs': [ 175 '<(PRODUCT_DIR)/icudt.dll', 176 ], 177 }, { # else icu_use_data_file_flag != 0 178 'inputs': [ 179 '<(PRODUCT_DIR)/icudtl.dat', 180 ], 181 }], 182 ], 183 'inputs': [ 184 '<(create_installer_archive_py_path)', 185 '<(PRODUCT_DIR)/chrome.exe', 186 '<@(chrome_dll_path)', 187 '<(PRODUCT_DIR)/nacl64.exe', 188 '<(PRODUCT_DIR)/nacl_irt_x86_32.nexe', 189 '<(PRODUCT_DIR)/nacl_irt_x86_64.nexe', 190 '<(PRODUCT_DIR)/locales/en-US.pak', 191 ], 192 'outputs': [ 193 'xxx.out', 194 '<(output_dir)/<(RULE_INPUT_NAME).7z', 195 '<(output_dir)/<(RULE_INPUT_NAME).packed.7z', 196 '<(output_dir)/setup.ex_', 197 '<(INTERMEDIATE_DIR)/packed_files.rc', 198 ], 199 'action': [ 200 'python', 201 '<(create_installer_archive_py_path)', 202 '--build_dir=<(PRODUCT_DIR)', 203 '--output_dir=<(output_dir)', 204 '--staging_dir=<(INTERMEDIATE_DIR)', 205 '--input_file=<(RULE_INPUT_PATH)', 206 '--resource_file_path=<(INTERMEDIATE_DIR)/packed_files.rc', 207 '<(enable_hidpi_flag)', 208 '<(target_arch_flag)', 209 # TODO(sgk): may just use environment variables 210 #'--distribution=$(CHROMIUM_BUILD)', 211 '--distribution=_google_chrome', 212 # Optional arguments to generate diff installer 213 #'--last_chrome_installer=C:/Temp/base', 214 #'--setup_exe_format=DIFF', 215 #'--diff_algorithm=COURGETTE', 216 ], 217 'message': 'Create installer archive', 218 }, 219 ], 220 # TODO(mark): <(branding_dir) should be defined by the 221 # global condition block at the bottom of the file, but 222 # this doesn't work due to the following issue: 223 # 224 # http://code.google.com/p/gyp/issues/detail?id=22 225 # 226 # Remove this block once the above issue is fixed. 227 'conditions': [ 228 [ 'branding == "Chrome"', { 229 'variables': { 230 'branding_dir': '../app/theme/google_chrome', 231 }, 232 }, { # else branding!="Chrome" 233 'variables': { 234 'branding_dir': '../app/theme/chromium', 235 }, 236 }], 237 ], 238 } 239