示例#1
0
 /// <summary>
 /// Creates a <see cref="PackagedApplication"/> for the application specified in the
 /// current instance's constructor. The method waits to return until the packaging process exited.
 /// </summary>
 /// <exception cref="PackageException">A <see cref="PackageException"/> is thrown when packaging failed.</exception>
 /// <returns></returns>
 public PackagedApplication CreatePackage()
 {
     _process         = PackagingProcess.Start(_startInfo);
     _process.Exited += Process_Exited;
     WaitHandle.WaitAll(new[] { _waitHandle });
     if (!_succeeded)
     {
         throw new PackageException("Packaging of " + _startInfo.Files.Executable.FileName + " did not succeed.");
     }
     return(_result);
 }
 /// <summary>
 /// Starts a new <see cref="PackagingProcess"/> from the <see cref="VirtualProcessStartInfo"/> specified.
 /// </summary>
 /// <param name="startInfo">
 /// The <see cref="VirtualProcessStartInfo"/> containing the information used to start the process with.
 /// </param>
 /// <returns>
 /// A new <see cref="PackagingProcess"/> component that is associated with the process resource.
 /// </returns>
 public new static PackagingProcess Start(VirtualProcessStartInfo startInfo)
 {
   if (startInfo.Files.RegistryDatabase.Type != FileType.Database)
     throw new ArgumentException("The destination file specified for the registry database is not valid.",
                                 "startInfo");
   var synchronizer = new ProcessSynchronizer(startInfo.WorkingDirectory, startInfo.FileSystemRuleCollection,
                                              startInfo.Files.RegistryDatabase, startInfo.RegistryRuleCollection);
   var process = new PackagingProcess(startInfo, synchronizer);
   process.Start();
   return process;
 }
示例#3
0
        /// <summary>
        /// Starts a new <see cref="PackagingProcess"/> from the <see cref="VirtualProcessStartInfo"/> specified.
        /// </summary>
        /// <param name="startInfo">
        /// The <see cref="VirtualProcessStartInfo"/> containing the information used to start the process with.
        /// </param>
        /// <returns>
        /// A new <see cref="PackagingProcess"/> component that is associated with the process resource.
        /// </returns>
        public new static PackagingProcess Start(VirtualProcessStartInfo startInfo)
        {
            if (startInfo.Files.RegistryDatabase.Type != FileType.Database)
            {
                throw new ArgumentException("The destination file specified for the registry database is not valid.",
                                            "startInfo");
            }
            var synchronizer = new ProcessSynchronizer(startInfo.WorkingDirectory, startInfo.FileSystemRuleCollection,
                                                       startInfo.Files.RegistryDatabase, startInfo.RegistryRuleCollection);
            var process = new PackagingProcess(startInfo, synchronizer);

            process.Start();
            return(process);
        }