/// <summary> /// Builds the project according to the current profile. /// </summary> /// <param name="cabwiz">The cabwiz application reference</param> /// <param name="feedback">The build context.</param> /// <returns>A value indicating whether the build was successful.</returns> public bool Build(Cabwiz.CabwizApplication cabwiz, IBuildFeedback feedback) { var project = this.Profile.ProjectInfo; var profile = this.Profile; if (cabwiz == null) { throw new ArgumentNullException("cabwiz", "Missing reference to a CabwizApplication object."); } var output = project.GetOutput(profile); // Create the .INF file for Cabwiz to process. var inf = output.CreateCabwizInf(profile); // Set the output directory cabwiz.DestinationDirectory = project.GetOutputDirectory(profile); // add some feedback feedback.WriteLine(" > {0}", cabwiz.PreviewCommandLine(inf)); int exitCode = cabwiz.Run(inf); if (exitCode != 0) { feedback.WriteLine(" {0} returned {1}", System.IO.Path.GetFileName(cabwiz.FileName), exitCode); return(false); } else { return(true); } }
/// <summary> /// Quickly call cabwiz.exe. /// </summary> /// <param name="iniFile">The inf file object.</param> /// <param name="nouninstall">The <see cref="NoUninstall"/> property will be set to this value.</param> /// <param name="compress">The <see cref="Compress"/> property will be set to this value.</param> /// <returns>The cabwiz.exe exit code. 0 indicates success, a non-zero value indicates failure.</returns> public static int QuickRun(InformationFile iniFile, bool nouninstall, bool compress) { var app = new CabwizApplication(); app.NoUninstall = nouninstall; app.Compress = compress; return(app.Run(iniFile)); }
/// <inheritdoc /> public override void Dispose() { base.Dispose(); if (this.Cabwiz != null) { this.Cabwiz.Dispose(); this.Cabwiz = null; } }
/// <summary> /// Quickly call cabwiz.exe. /// </summary> /// <param name="iniFile">The inf file object.</param> /// <param name="nouninstall">The <see cref="NoUninstall"/> property will be set to this value.</param> /// <param name="compress">The <see cref="Compress"/> property will be set to this value.</param> /// <returns>The cabwiz.exe exit code. 0 indicates success, a non-zero value indicates failure.</returns> public static int QuickRun(InformationFile iniFile, bool nouninstall, bool compress) { var app = new CabwizApplication(); app.NoUninstall = nouninstall; app.Compress = compress; return app.Run(iniFile); }