Beispiel #1
0
        /// <summary>
        /// Build a patch
        /// </summary>
        /// <param name="workingDirectory">WiX working directory</param>
        /// <param name="targetSources">Target source files</param>
        /// <param name="upgradeSources">Upgrade source files</param>
        /// <param name="patchSources">Patch source file</param>
        /// <param name="patchFileName">Name of output file</param>
        /// <param name="baseline">The name of the baseline</param>
        /// <param name="patchCompilerExtension">A Wix extension to pass when compiling the patch</param>
        public static void BuildPatch(string workingDirectory, string[] targetSources, string[] upgradeSources, string[] patchSources, string patchFileName, string baseline, string patchCompilerExtension)
        {
            string outputDirectory = Environment.CurrentDirectory;

            // Create directories for intermediate output
            string wixobjDirectory = Path.Combine(outputDirectory, Settings.WixobjFolder);

            FileUtilities.CreateOutputDirectory(wixobjDirectory);
            string wixoutDirectory = Path.Combine(outputDirectory, Settings.WixoutFolder);

            FileUtilities.CreateOutputDirectory(wixoutDirectory);
            string msiDirectory = Path.Combine(outputDirectory, Settings.MsiFolder);

            FileUtilities.CreateOutputDirectory(msiDirectory);
            string mstDirectory = Path.Combine(outputDirectory, Settings.MstFolder);

            FileUtilities.CreateOutputDirectory(mstDirectory);
            string mspDirectory = Path.Combine(outputDirectory, Settings.MspFolder);

            FileUtilities.CreateOutputDirectory(mspDirectory);

            // Build Target .wixout
            string targetWixout = Path.Combine(wixoutDirectory, "target.wixout");
            string targetMSI    = Path.Combine(msiDirectory, @"target\target.msi");

            Builder.BuildPackage(workingDirectory, targetSources, targetWixout, null, "-xo");
            Builder.BuildPackage(workingDirectory, targetSources, targetMSI, null, null);

            // Build Upgrade .wixout
            string upgradeWixout = Path.Combine(wixoutDirectory, "upgrade.wixout");
            string upgradeMSI    = Path.Combine(msiDirectory, @"upgrade\upgrade.msi");

            Builder.BuildPackage(workingDirectory, upgradeSources, upgradeWixout, null, "-xo");
            Builder.BuildPackage(workingDirectory, upgradeSources, upgradeMSI, null, null);

            // Build Transform
            string transformWixMST = Path.Combine(wixoutDirectory, "transform.wixmst");

            Builder.BuildTransform(workingDirectory, targetWixout, upgradeWixout, true, transformWixMST, true);

            // Build a transform database from diffing the msis
            string transformMST = Path.Combine(mstDirectory, "transform.mst");

            Builder.BuildTransform(workingDirectory, targetMSI, upgradeMSI, false, transformMST, false);

            string patchWixMSP = Path.Combine(wixoutDirectory, "patch.wixmsp");

            if (!String.IsNullOrEmpty(patchCompilerExtension))
            {
                string extensionArgument = String.Format(@"-ext ""{0}""", patchCompilerExtension);
                Builder.BuildPackage(workingDirectory, patchSources, patchWixMSP, extensionArgument, "-xo");
            }
            else
            {
                Builder.BuildPackage(workingDirectory, patchSources, patchWixMSP, null, "-xo");
            }

            Pyro pyro = new Pyro();

            pyro.WorkingDirectory = workingDirectory;
            pyro.InputFile        = patchWixMSP;
            pyro.OutputFile       = patchFileName;
            pyro.Baselines.Add(transformWixMST, baseline);
            pyro.ExpectedWixMessages.Add(new WixMessage(1079, WixMessage.MessageTypeEnum.Warning));
            pyro.Run();
        }
Beispiel #2
0
 /// <summary>
 /// Build a setup package from the specified sources
 /// </summary>
 /// <param name="workingDirectory">The working directory from where Candle and Light are run</param>
 /// <param name="sourceFile">The .wxs file to compile</param>
 /// <param name="outputFile">The name of the output file</param>
 /// <param name="otherCandleArgs">Additional arguments to pass to Candle.exe</param>
 /// <param name="otherLightArgs">Additional arguments to pass to Light.exe</param>
 /// <returns>The path to the output file</returns>
 public static string BuildPackage(string workingDirectory, string sourceFile, string outputFile, string otherCandleArgs, string otherLightArgs)
 {
     return(Builder.BuildPackage(workingDirectory, new string[] { sourceFile }, outputFile, otherCandleArgs, otherLightArgs));
 }
Beispiel #3
0
        /// <summary>
        /// Build a setup package (MSI) from the specified source file
        /// </summary>
        /// <param name="sourceFile">The .wxs file to compile</param>
        /// <param name="outputFile">The name of the output file</param>
        /// <returns>The path to the output file</returns>
        public static string BuildPackage(string sourceFile, string outputFile)
        {
            string workingDirectory = Environment.CurrentDirectory;

            return(Builder.BuildPackage(workingDirectory, new string[] { sourceFile }, outputFile, true, null, null));
        }
Beispiel #4
0
 /// <summary>
 /// Build a setup package from the specified sources
 /// </summary>
 /// <param name="workingDirectory">The working directory from where Candle and Light are run</param>
 /// <param name="sourceFiles">The .wxs files to compile</param>
 /// <param name="outputFile">The name of the output file</param>
 /// <param name="otherCandleArgs">Additional arguments to pass to Candle.exe</param>
 /// <param name="otherLightArgs">Additional arguments to pass to Light.exe</param>
 /// <returns>The path to the output file</returns>
 public static string BuildPackage(string workingDirectory, string[] sourceFiles, string outputFile, string otherCandleArgs, string otherLightArgs)
 {
     return Builder.BuildPackage(workingDirectory, sourceFiles, outputFile, true, otherCandleArgs, otherLightArgs);
 }