diff options
author | ivankr@chromium.org <ivankr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-20 09:13:44 +0000 |
---|---|---|
committer | ivankr@chromium.org <ivankr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-20 09:13:44 +0000 |
commit | efe7bcfe91d170d024443cbabf6bc0994164176e (patch) | |
tree | 0f1e6e14b87bbf6b65b757bd608296bd23a65c65 | |
parent | 18031610ad20656ef49e201303c6883e96823338 (diff) | |
download | chromium_src-efe7bcfe91d170d024443cbabf6bc0994164176e.zip chromium_src-efe7bcfe91d170d024443cbabf6bc0994164176e.tar.gz chromium_src-efe7bcfe91d170d024443cbabf6bc0994164176e.tar.bz2 |
Revert 157716 - [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/10948050
TBR=alexeypa@chromium.org
Review URL: https://codereview.chromium.org/10956010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157730 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 | 154 |
4 files changed, 70 insertions, 147 deletions
diff --git a/remoting/host/installer/build-installer-archive.py b/remoting/host/installer/build-installer-archive.py index 4585d0a..b21d2db 100755 --- a/remoting/host/installer/build-installer-archive.py +++ b/remoting/host/installer/build-installer-archive.py @@ -102,10 +102,8 @@ def remapSrcFile(dst_root, src_roots, src_file): # Strip of directory prefix. found_root = False for root in src_roots: - 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) + if src_file.startswith(root): + src_file = src_file[len(root):] found_root = True break @@ -192,15 +190,13 @@ 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', '.json']: + elif ext in ['.packproj', '.pkgproj', '.plist', '.props', '.sh']: 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: @@ -270,9 +266,13 @@ 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 63e8008..7f21eef 100644 --- a/remoting/host/win/chromoting.wxs +++ b/remoting/host/win/chromoting.wxs @@ -47,6 +47,18 @@ <?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?> @@ -99,7 +111,7 @@ <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="ProgramFilesFolder"> - <?if $(var.OfficialBuild) != 0 ?> + <?ifdef OfficialBuild ?> <Directory Id="program_files_google" Name="Google"> <Directory Id="chromoting" Name="Chrome Remote Desktop"> <Directory Id="binaries" Name="$(var.Version)"/> @@ -112,7 +124,7 @@ <?endif?> </Directory> <Directory Id="CommonAppDataFolder"> - <?if $(var.OfficialBuild) != 0 ?> + <?ifdef OfficialBuild ?> <Directory Id="common_app_data_google" Name="Google"> <Directory Id="config_files" Name="Chrome Remote Desktop"/> </Directory> @@ -122,11 +134,12 @@ </Directory> </Directory> - <DirectoryRef Id="binaries"> + <DirectoryRef Id="binaries" FileSource="$(var.FileSource)"> <Component Id="sas" Guid="*"> <File Id="sas.dll" DiskId="1" Name="sas.dll" + Source="$(var.SasDllPath)" Vital="yes"/> </Component> @@ -189,7 +202,7 @@ Scope="any" /> </Component> - <?if $(var.OfficialBuild) != 0 ?> + <?ifdef OfficialBuild ?> <Component Id="omaha_registration" Guid="*"> <RegistryKey Id="omaha_client_key" Root="HKLM" @@ -403,7 +416,7 @@ <UIRef Id="WixUI_ErrorProgressText" /> <Feature Id="chromoting_host" Level="1" Title="$(var.ChromotingHost)"> - <?if $(var.OfficialBuild) != 0 ?> + <?ifdef OfficialBuild ?> <ComponentRef Id="omaha_registration"/> <?endif?> <ComponentRef Id="remoting_controller"/> @@ -416,7 +429,7 @@ </Feature> <!-- Set the icon shown in Add/Remove Programs. --> - <Icon Id="chromoting.ico" SourceFile="chromoting.ico"/> + <Icon Id="chromoting.ico" SourceFile="$(var.IconPath)"/> <Property Id="ARPPRODUCTICON" Value="chromoting.ico" /> <InstallExecuteSequence> diff --git a/remoting/host/win/parameters.json b/remoting/host/win/parameters.json deleted file mode 100644 index 9a2deda..0000000 --- a/remoting/host/win/parameters.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "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 f6497b8..8b75871 100644 --- a/remoting/remoting.gyp +++ b/remoting/remoting.gyp @@ -189,13 +189,6 @@ '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': { @@ -704,31 +697,65 @@ 'target_name': 'remoting_host_installation', 'type': 'none', 'dependencies': [ - 'remoting_me2me_host_archive', + 'remoting_host_controller', + 'remoting_service', + 'remoting_me2me_host', ], 'sources': [ - '<(PRODUCT_DIR)/remoting-me2me-host-<(OS).zip', + 'host/win/chromoting.wxs', ], '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': 'zip2msi', - 'extension': 'zip', + 'rule_name': 'candle_and_light', + 'extension': 'wxs', 'inputs': [ - 'tools/zip2msi.py', + '<@(_wix_inputs)', + 'tools/candle_and_light.py', ], 'outputs': [ - '<(PRODUCT_DIR)/chromoting.msi', + '<(PRODUCT_DIR)/<(RULE_INPUT_ROOT).msi', ], 'msvs_cygwin_shell': 0, 'action': [ - 'python', 'tools/zip2msi.py', + 'python', 'tools/candle_and_light.py', '--wix_path', '<(wix_path)', + '--controller_clsid', '{<(daemon_controller_clsid)}', + '--version', '<(version_full)', + '--product_dir', '<(PRODUCT_DIR).', '--intermediate_dir', '<(INTERMEDIATE_DIR).', - '<(RULE_INPUT_PATH)', - '<@(_outputs)', + '--sas_dll_path', '<(sas_dll_path)', + '--input', '<(RULE_INPUT_PATH)', + '--output', '<@(_outputs)', + '<@(_wix_defines)', ], 'message': 'Generating <@(_outputs)', }, @@ -779,101 +806,6 @@ }, ], }, # 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)', - '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) != ""' |