remoting/tools/zip2msi.py
def GenerateMsi(target, source, parameters):
  """Generates .msi from the installation files prepared by Chromium build."""
  parameters['basename'] = os.path.splitext(os.path.basename(source))[0]

  # The script can handle both forms of input a directory with unpacked files or
  # a ZIP archive with the same files. In the latter case the archive should be
  # unpacked to the intermediate directory.
  source_dir = None
  if os.path.isdir(source):
    # Just use unpacked files from the supplied directory.
    source_dir = source
  else:
    # Unpack .zip
    rc = UnpackZip(parameters['intermediate_dir'], source)
    if rc != 0:
      return rc
    source_dir = '%(intermediate_dir)s\\%(basename)s' % parameters

  # Read parameters from 'parameters.json'.
  f = open(os.path.join(source_dir, 'parameters.json'))
  parameters = Merge(json.load(f), parameters)
  f.close()

  if 'source' not in parameters:
    print('The source .wxs is not specified')
    return 1

  if 'bind_path' not in parameters:
    print('The binding path is not specified')
    return 1

  wxs = os.path.join(source_dir, parameters['source'])

  #  Add the binding path to the light-specific parameters.
  bind_path = os.path.join(source_dir, parameters['bind_path'])
  parameters = Merge(parameters, {'light': {'switches': ['-b', bind_path]}})

  target_arch = parameters['target_arch']
  if target_arch == 'ia32':
    arch_param = 'x86'
  elif target_arch == 'x64':
    arch_param = 'x64'
  else:
    print('Invalid target_arch parameter value')
    return 1

  # Add the architecture to candle-specific parameters.
  parameters = Merge(
      parameters, {'candle': {'switches': ['-arch', arch_param]}})

  # Run candle and light to generate the installation.
  wixobj = '%(intermediate_dir)s\\%(basename)s.wixobj' % parameters
  args = GenerateCommandLine('candle', wxs, wixobj, parameters)
  rc = Run(args)
  if rc:
    return rc

  args = GenerateCommandLine('light', wixobj, target, parameters)
  rc = Run(args)
  if rc:
    return rc

  return 0
Generates .msi from the installation files prepared by Chromium build.
Generates .msi from the installation files prepared by Chromium build.
Generates . msi from the installation files prepared by Chromium build .
def GenerateMsi(target, source, parameters):
  parameters['basename'] = os.path.splitext(os.path.basename(source))[0]
  source_dir = None
  if os.path.isdir(source):
    source_dir = source
  else:
    rc = UnpackZip(parameters['intermediate_dir'], source)
    if rc != 0:
      return rc
    source_dir = '%(intermediate_dir)s\\%(basename)s' % parameters
  f = open(os.path.join(source_dir, 'parameters.json'))
  parameters = Merge(json.load(f), parameters)
  f.close()
  if 'source' not in parameters:
    print('The source .wxs is not specified')
    return 1
  if 'bind_path' not in parameters:
    print('The binding path is not specified')
    return 1
  wxs = os.path.join(source_dir, parameters['source'])
  bind_path = os.path.join(source_dir, parameters['bind_path'])
  parameters = Merge(parameters, {'light': {'switches': ['-b', bind_path]}})
  target_arch = parameters['target_arch']
  if target_arch == 'ia32':
    arch_param = 'x86'
  elif target_arch == 'x64':
    arch_param = 'x64'
  else:
    print('Invalid target_arch parameter value')
    return 1
  parameters = Merge(
      parameters, {'candle': {'switches': ['-arch', arch_param]}})
  wixobj = '%(intermediate_dir)s\\%(basename)s.wixobj' % parameters
  args = GenerateCommandLine('candle', wxs, wixobj, parameters)
  rc = Run(args)
  if rc:
    return rc
  args = GenerateCommandLine('light', wixobj, target, parameters)
  rc = Run(args)
  if rc:
    return rc
  return 0
def GenerateMsi ( target , source , parameters ) : parameters [ 'basename' ] = os . path . splitext ( os . path . basename ( source ) ) [ 0 ] source_dir = None if os . path . isdir ( source ) : source_dir = source else : rc = UnpackZip ( parameters [ 'intermediate_dir' ] , source ) if rc != 0 : return rc source_dir = '%(intermediate_dir)s\\%(basename)s' % parameters f = open ( os . path . join ( source_dir , 'parameters.json' ) ) parameters = Merge ( json . load ( f ) , parameters ) f . close ( ) if 'source' not in parameters : print ( 'The source .wxs is not specified' ) return 1 if 'bind_path' not in parameters : print ( 'The binding path is not specified' ) return 1 wxs = os . path . join ( source_dir , parameters [ 'source' ] ) bind_path = os . path . join ( source_dir , parameters [ 'bind_path' ] ) parameters = Merge ( parameters , { 'light' : { 'switches' : [ '-b' , bind_path ] } } ) target_arch = parameters [ 'target_arch' ] if target_arch == 'ia32' : arch_param = 'x86' elif target_arch == 'x64' : arch_param = 'x64' else : print ( 'Invalid target_arch parameter value' ) return 1 parameters = Merge ( parameters , { 'candle' : { 'switches' : [ '-arch' , arch_param ] } } ) wixobj = '%(intermediate_dir)s\\%(basename)s.wixobj' % parameters args = GenerateCommandLine ( 'candle' , wxs , wixobj , parameters ) rc = Run ( args ) if rc : return rc args = GenerateCommandLine ( 'light' , wixobj , target , parameters ) rc = Run ( args ) if rc : return rc return 0
Generates .msi from the installation files prepared by Chromium build.
Generates . msi from the installation files prepared by Chromium build .
"""Generates .msi from the installation files prepared by Chromium build.""" # The script can handle both forms of input a directory with unpacked files or # a ZIP archive with the same files. In the latter case the archive should be # unpacked to the intermediate directory. # Just use unpacked files from the supplied directory. # Unpack .zip # Read parameters from 'parameters.json'. #  Add the binding path to the light-specific parameters. # Add the architecture to candle-specific parameters. # Run candle and light to generate the installation.
target
source
parameters