diff options
author | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-20 21:27:04 +0000 |
---|---|---|
committer | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-20 21:27:04 +0000 |
commit | c5e2b910340512c2697676c46056a217a7d4bac7 (patch) | |
tree | 9f73e5d8d8c9e4f9ef93ef2ce2066dbf9cfb6bd2 | |
parent | 3e0ec02ebecd1a5a643f13012b51f92d51f508ef (diff) | |
download | chromium_src-c5e2b910340512c2697676c46056a217a7d4bac7.zip chromium_src-c5e2b910340512c2697676c46056a217a7d4bac7.tar.gz chromium_src-c5e2b910340512c2697676c46056a217a7d4bac7.tar.bz2 |
[Chromoting] Build Chromoting Host installation in two steps: (binaries & .wxs) -> .zip -> .msi.
The two step process is needed so that we could take the produced .zip and use it to sign the binaries and installation on a separate machine. Decompiling .msi using dark proved to be a bad idea due to bugs in dark.exe.
BUG=146863
Review URL: https://chromiumcodereview.appspot.com/10965013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157843 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-x | remoting/host/installer/build-installer-archive.py | 16 | ||||
-rw-r--r-- | remoting/host/win/chromoting.wxs | 25 | ||||
-rw-r--r-- | remoting/host/win/parameters.json | 22 | ||||
-rw-r--r-- | remoting/remoting.gyp | 158 |
4 files changed, 149 insertions, 72 deletions
diff --git a/remoting/host/installer/build-installer-archive.py b/remoting/host/installer/build-installer-archive.py index b21d2db..4585d0a 100755 --- a/remoting/host/installer/build-installer-archive.py +++ b/remoting/host/installer/build-installer-archive.py @@ -102,8 +102,10 @@ def remapSrcFile(dst_root, src_roots, src_file): # Strip of directory prefix. found_root = False for root in src_roots: - if src_file.startswith(root): - src_file = src_file[len(root):] + root = os.path.normpath(root) + src_file = os.path.normpath(src_file) + if os.path.commonprefix([root, src_file]) == root: + src_file = os.path.relpath(src_file, root) found_root = True break @@ -190,13 +192,15 @@ def buildHostArchive(temp_dir, zip_path, source_file_roots, source_files, (base, ext) = os.path.splitext(f) if ext == '.zip': copyZipIntoArchive(temp_dir, source_file_roots, f) - elif ext in ['.packproj', '.pkgproj', '.plist', '.props', '.sh']: + elif ext in ['.packproj', '.pkgproj', '.plist', '.props', '.sh', '.json']: copyFileWithDefs(f, dst_file, defs) else: shutil.copy2(f, dst_file) for bs, bd in zip(gen_files, gen_files_dst): dst_file = os.path.join(temp_dir, bd) + if not os.path.exists(os.path.dirname(dst_file)): + os.makedirs(os.path.dirname(dst_file)) if os.path.isdir(bs): shutil.copytree(bs, dst_file) else: @@ -266,13 +270,9 @@ def main(): if len(source_files) == 0 and len(generated_files) == 0: error('At least one input file must be specified.') - # Ensure that each path in source_file_roots ends with a directory separator. - for root in source_file_roots: - if root[-1:] != os.sep: - error('Each source-file-root should end with a "\": %s' % root) - # Sort roots to ensure the longest one is first. See comment in remapSrcFile # for why this is necessary. + source_file_roots = map(os.path.normpath, source_file_roots) source_file_roots.sort(key=len, reverse=True) # Verify that the 2 generated_files arrays have the same number of elements. diff --git a/remoting/host/win/chromoting.wxs b/remoting/host/win/chromoting.wxs index 7f21eef..63e8008 100644 --- a/remoting/host/win/chromoting.wxs +++ b/remoting/host/win/chromoting.wxs @@ -47,18 +47,6 @@ <?error ControllerClsid must be defined ?> <?endif?> - <?ifndef FileSource ?> - <?error FileSource must be defined ?> - <?endif?> - - <?ifndef IconPath ?> - <?error IconPath must be defined ?> - <?endif?> - - <?ifndef SasDllPath ?> - <?error SasDllPath must be defined ?> - <?endif?> - <?ifndef Version ?> <?error Version must be defined ?> <?endif?> @@ -111,7 +99,7 @@ <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="ProgramFilesFolder"> - <?ifdef OfficialBuild ?> + <?if $(var.OfficialBuild) != 0 ?> <Directory Id="program_files_google" Name="Google"> <Directory Id="chromoting" Name="Chrome Remote Desktop"> <Directory Id="binaries" Name="$(var.Version)"/> @@ -124,7 +112,7 @@ <?endif?> </Directory> <Directory Id="CommonAppDataFolder"> - <?ifdef OfficialBuild ?> + <?if $(var.OfficialBuild) != 0 ?> <Directory Id="common_app_data_google" Name="Google"> <Directory Id="config_files" Name="Chrome Remote Desktop"/> </Directory> @@ -134,12 +122,11 @@ </Directory> </Directory> - <DirectoryRef Id="binaries" FileSource="$(var.FileSource)"> + <DirectoryRef Id="binaries"> <Component Id="sas" Guid="*"> <File Id="sas.dll" DiskId="1" Name="sas.dll" - Source="$(var.SasDllPath)" Vital="yes"/> </Component> @@ -202,7 +189,7 @@ Scope="any" /> </Component> - <?ifdef OfficialBuild ?> + <?if $(var.OfficialBuild) != 0 ?> <Component Id="omaha_registration" Guid="*"> <RegistryKey Id="omaha_client_key" Root="HKLM" @@ -416,7 +403,7 @@ <UIRef Id="WixUI_ErrorProgressText" /> <Feature Id="chromoting_host" Level="1" Title="$(var.ChromotingHost)"> - <?ifdef OfficialBuild ?> + <?if $(var.OfficialBuild) != 0 ?> <ComponentRef Id="omaha_registration"/> <?endif?> <ComponentRef Id="remoting_controller"/> @@ -429,7 +416,7 @@ </Feature> <!-- Set the icon shown in Add/Remove Programs. --> - <Icon Id="chromoting.ico" SourceFile="$(var.IconPath)"/> + <Icon Id="chromoting.ico" SourceFile="chromoting.ico"/> <Property Id="ARPPRODUCTICON" Value="chromoting.ico" /> <InstallExecuteSequence> diff --git a/remoting/host/win/parameters.json b/remoting/host/win/parameters.json new file mode 100644 index 0000000..9a2deda --- /dev/null +++ b/remoting/host/win/parameters.json @@ -0,0 +1,22 @@ +{ + "defines": { + "Branding": "@@BRANDING@@", + "OfficialBuild": "@@OFFICIAL_BUILD@@", + "RemotingMultiProcess" : "@@REMOTING_MULTI_PROCESS@@", + "ControllerClsid": "@@CONTROLLER_CLSID@@", + "Version": "@@VERSION@@" + }, + "extensions": [ + "WixFirewallExtension.dll", + "WixUIExtension.dll", + "WixUtilExtension.dll" + ], + "source": "chromoting.wxs", + "bind_path": "files", + "light": { + "switches": [ + "-cultures:en-us", + "-sw1076" + ] + } +}
\ No newline at end of file diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp index 8b75871..9f01d58 100644 --- a/remoting/remoting.gyp +++ b/remoting/remoting.gyp @@ -189,6 +189,13 @@ 'host/installer/mac/Keystone/GoogleSoftwareUpdate.pkg', '<(DEPTH)/chrome/installer/mac/pkg-dmg', ], + 'remoting_host_installer_win_roots': [ + 'host/win/', + ], + 'remoting_host_installer_win_files': [ + 'host/win/chromoting.wxs', + 'host/win/parameters.json', + ], }, 'target_defaults': { @@ -697,65 +704,31 @@ 'target_name': 'remoting_host_installation', 'type': 'none', 'dependencies': [ - 'remoting_host_controller', - 'remoting_service', - 'remoting_me2me_host', + 'remoting_me2me_host_archive', ], 'sources': [ - 'host/win/chromoting.wxs', + '<(PRODUCT_DIR)/remoting-me2me-host-<(OS).zip', ], 'outputs': [ '<(PRODUCT_DIR)/chromoting.msi', ], - 'wix_defines' : [ - '-dBranding=<(branding)', - '-dRemotingMultiProcess=<(remoting_multi_process)', - ], - 'wix_inputs' : [ - '<(PRODUCT_DIR)/remoting_host_controller.exe', - '<(PRODUCT_DIR)/remoting_me2me_host.exe', - '<(PRODUCT_DIR)/remoting_service.exe', - '<(sas_dll_path)/sas.dll', - 'resources/chromoting.ico', - ], - 'conditions': [ - ['remoting_multi_process != 0', { - 'dependencies': [ - 'remoting_desktop', - ], - 'wix_inputs' : [ - '<(PRODUCT_DIR)/remoting_desktop.exe', - ], - }], - ['buildtype == "Official"', { - 'wix_defines': [ - '-dOfficialBuild=1', - ], - }], - ], 'rules': [ { - 'rule_name': 'candle_and_light', - 'extension': 'wxs', + 'rule_name': 'zip2msi', + 'extension': 'zip', 'inputs': [ - '<@(_wix_inputs)', - 'tools/candle_and_light.py', + 'tools/zip2msi.py', ], 'outputs': [ - '<(PRODUCT_DIR)/<(RULE_INPUT_ROOT).msi', + '<(PRODUCT_DIR)/chromoting.msi', ], 'msvs_cygwin_shell': 0, 'action': [ - 'python', 'tools/candle_and_light.py', + 'python', 'tools/zip2msi.py', '--wix_path', '<(wix_path)', - '--controller_clsid', '{<(daemon_controller_clsid)}', - '--version', '<(version_full)', - '--product_dir', '<(PRODUCT_DIR).', - '--intermediate_dir', '<(INTERMEDIATE_DIR).', - '--sas_dll_path', '<(sas_dll_path)', - '--input', '<(RULE_INPUT_PATH)', - '--output', '<@(_outputs)', - '<@(_wix_defines)', + '--intermediate_dir', '<(INTERMEDIATE_DIR)/installation', + '<(RULE_INPUT_PATH)', + '<@(_outputs)', ], 'message': 'Generating <@(_outputs)', }, @@ -799,13 +772,108 @@ 'tools/dark_and_candle_and_light.py', '--wix_path', '<(wix_path)', '--input', '<(RULE_INPUT_PATH)', - '--intermediate_dir', '<(INTERMEDIATE_DIR).', + '--intermediate_dir', '<(INTERMEDIATE_DIR)/installation', '--output', '<@(_outputs)', ], 'message': 'Unpacking and repacking to <@(_outputs)', }, ], }, # end of target 'remoting_host_installation_unittest' + { + 'target_name': 'remoting_me2me_host_archive', + 'type': 'none', + 'dependencies': [ + 'remoting_host_controller', + 'remoting_service', + 'remoting_me2me_host', + ], + 'sources': [ + '<(sas_dll_path)/sas.dll', + '<@(remoting_host_installer_win_files)', + 'host/installer/build-installer-archive.py', + 'resources/chromoting.ico', + ], + 'defs': [ + 'BRANDING=<(branding)', + 'CONTROLLER_CLSID={<(daemon_controller_clsid)}', + 'REMOTING_MULTI_PROCESS=<(remoting_multi_process)', + 'VERSION=<(version_full)', + ], + 'generated_files': [ + '<(PRODUCT_DIR)/remoting_host_controller.exe', + '<(PRODUCT_DIR)/remoting_me2me_host.exe', + '<(PRODUCT_DIR)/remoting_service.exe', + '<(sas_dll_path)/sas.dll', + 'resources/chromoting.ico', + ], + 'generated_files_dst': [ + 'files/remoting_host_controller.exe', + 'files/remoting_me2me_host.exe', + 'files/remoting_service.exe', + 'files/sas.dll', + 'files/chromoting.ico', + ], + 'conditions': [ + ['buildtype == "Official"', { + 'defs': [ + 'OFFICIAL_BUILD=1', + ], + }, { # else buildtype != "Official" + 'defs': [ + 'OFFICIAL_BUILD=0', + ], + }], + ['remoting_multi_process != 0', { + 'dependencies': [ + 'remoting_desktop', + ], + 'generated_files': [ + '<(PRODUCT_DIR)/remoting_desktop.exe', + ], + 'generated_files_dst': [ + 'files/remoting_desktop.exe', + ], + }], + ], + 'zip_path': '<(PRODUCT_DIR)/remoting-me2me-host-<(OS).zip', + 'outputs': [ + '<(_zip_path)', + ], + 'actions': [ + { + 'action_name': 'Zip installer files for signing', + 'temp_dir': '<(INTERMEDIATE_DIR)/installation', + 'source_files': [ + '<@(remoting_host_installer_win_files)', + ], + 'inputs': [ + '<(sas_dll_path)/sas.dll', + '<@(_source_files)', + 'host/installer/build-installer-archive.py', + 'resources/chromoting.ico', + ], + 'outputs': [ + '<(_zip_path)', + ], + 'action': [ + 'python', + 'host/installer/build-installer-archive.py', + '<(_temp_dir)', + '<(_zip_path)', + '--source-file-roots', + '<@(remoting_host_installer_win_roots)', + '--source-files', + '<@(_source_files)', + '--generated-files', + '<@(_generated_files)', + '--generated-files-dst', + '<@(_generated_files_dst)', + '--defs', + '<@(_defs)', + ], + }, + ], # actions + }, # end of target 'remoting_me2me_host_archive' ], # end of 'targets' }], # '<(wix_path) != ""' |