/// <summary> /// Handles the <see cref="_process"/>.Exited event. /// If packaging succeeded (<see cref="_succeeded"/>), <see cref="_result"/> is set from the retreived data. /// </summary> /// <param name="sender">The exited <see cref="VirtualizedProcess"/>.</param> /// <param name="exitCode">The associated <see cref="NativeResultCode"/>.</param> private void Process_Exited(VirtualizedProcess sender, int exitCode) { if (sender != _process) { throw new ApplicationException("An unexpected exception occured in the application workflow." + " Process_Exited event is called from an unknown Process."); } _succeeded = exitCode == (int)NativeResultCode.Success; _result = !_succeeded ? null : new PackagedApplication(_startInfo.WorkingDirectory.FileName, _process.GetExecutables(), _startInfo.Files.RegistryDatabase.FileName); _waitHandle.Set(); sender.Dispose(); }
/// <summary> /// Handles the <see cref="_process"/>.Exited event. /// If packaging succeeded (<see cref="_succeeded"/>), <see cref="_result"/> is set from the retreived data. /// </summary> /// <param name="sender">The exited <see cref="VirtualizedProcess"/>.</param> /// <param name="exitCode">The associated <see cref="NativeResultCode"/>.</param> private void Process_Exited(VirtualizedProcess sender, int exitCode) { if (sender != _process) throw new ApplicationException("An unexpected exception occured in the application workflow." + " Process_Exited event is called from an unknown Process."); _succeeded = exitCode == (int)NativeResultCode.Success; _result = !_succeeded ? null : new PackagedApplication(_startInfo.WorkingDirectory.FileName, _process.GetExecutables(), _startInfo.Files.RegistryDatabase.FileName); _waitHandle.Set(); sender.Dispose(); }
private static bool RunPostWizard(PackagedApplication packagedApplication, string applicationDataFile) { // Packaging succeeded, now gather the required configuration data from the user. var postWizard = new PostPackagingWizard(packagedApplication); if (postWizard.ShowDialog() != DialogResult.OK) return false; // ToDo: Clean up first? // Save the resulting data. return ApplicationData.Save(postWizard.Result, applicationDataFile); }
private static bool RunPackagingSequence(PreConfigurationState preConfigurationState, ApplicationData applicationData, out PackagedApplication packagedApplication) { try { var packager = new Packager(applicationData, preConfigurationState.InstallerOutputDestination); packagedApplication = packager.CreatePackage(); return true; } catch (Exception ex) { HostCore.Log.Error("Packaging failed", ex); MessageReporter.Show(FormatMessageFor(ex) + "\r\nCheck the log files or the extended information for troubleshooting.", "Packaging failed!", ex, MessageBoxButtons.OK, MessageBoxIcon.Error); // ToDo: Clean up first! packagedApplication = null; return false; } }