private void btnInnovatorPackage_Click(object sender, EventArgs e) { try { using (var dialog = new OpenFileDialog()) { dialog.Filter = "Innovator Package (.innpkg)|*.innpkg|Manifest (.mf)|*.mf"; if (dialog.ShowDialog() == DialogResult.OK) { if (Path.GetExtension(dialog.FileName) == ".innpkg") { using (var pkg = InnovatorPackage.Load(dialog.FileName)) { _wizard.InstallScript = pkg.Read(); } } else { var pkg = new ManifestFolder(dialog.FileName); string title; var doc = pkg.Read(out title); _wizard.InstallScript = _wizard.InstallProcessor.ConvertManifestXml(doc, title); } SetMetadata(); } } } catch (Exception ex) { Utils.HandleError(ex); } }
private void btnInnovatorPackage_Click(object sender, EventArgs e) { try { using (var dialog = new OpenFileDialog()) { dialog.Filter = "Innovator Package (.innpkg)|*.innpkg|Manifest (.mf)|*.mf"; if (dialog.ShowDialog() == DialogResult.OK) { if (Path.GetExtension(dialog.FileName) == ".innpkg") { using (var pkg = InnovatorPackage.Load(dialog.FileName)) { _wizard.InstallScript = pkg.Read(); } } else { var pkg = new ManifestFolder(dialog.FileName); string title; var doc = pkg.Read(out title); _wizard.InstallScript = _wizard.InstallProcessor.ConvertManifestXml(doc, title); } SetMetadata(); } } } catch (Exception ex) { Utils.HandleError(ex); } }
private void btnPackageFile_Click(object sender, EventArgs e) { try { using (var dialog = new OpenFileDialog()) { dialog.Filter = "Innovator Package (.innpkg)|*.innpkg|Manifest (.mf)|*.mf"; if (dialog.ShowDialog() == DialogResult.OK) { if (Path.GetExtension(dialog.FileName) == ".innpkg") { using (var pkg = InnovatorPackage.Load(dialog.FileName)) { var installScript = pkg.Read(); _availableRefs.Clear(); foreach (var item in installScript.Lines.Where(l => l.Type == InstallType.Create).Select(l => l.Reference)) { if (!_selectedRefs.Contains(item)) { _selectedRefs.Add(item); } } _existingScript = installScript; _existingScript.Lines = null; } } else { var pkg = new ManifestFolder(dialog.FileName); string title; var doc = pkg.Read(out title); foreach (var item in ItemReference.FromFullItems(doc.DocumentElement, true)) { if (!_selectedRefs.Contains(item)) { _selectedRefs.Add(item); } } _existingScript = _existingScript ?? new InstallScript(); _existingScript.Title = title; } EnsureResultsTab(); tbcSearch.SelectedTab = pgResults; txtFind.Focus(); } } } catch (Exception ex) { Utils.HandleError(ex); } }
private void btnPackageFile_Click(object sender, EventArgs e) { try { using (var dialog = new OpenFileDialog()) { dialog.Filter = "Innovator Package (.innpkg)|*.innpkg|Manifest (.mf)|*.mf"; if (dialog.ShowDialog() == DialogResult.OK) { if (Path.GetExtension(dialog.FileName) == ".innpkg") { using (var pkg = InnovatorPackage.Load(dialog.FileName)) { var installScript = pkg.Read(); _availableRefs.Clear(); foreach (var item in installScript.Lines.Where(l => l.Type == InstallType.Create).Select(l => l.Reference)) { if (!_selectedRefs.Contains(item)) _selectedRefs.Add(item); } _existingScript = installScript; _existingScript.Lines = null; } } else { var pkg = new ManifestFolder(dialog.FileName); string title; var doc = pkg.Read(out title); foreach (var item in ItemReference.FromFullItems(doc.DocumentElement, true)) { if (!_selectedRefs.Contains(item)) _selectedRefs.Add(item); } _existingScript = _existingScript ?? new InstallScript(); _existingScript.Title = title; } EnsureResultsTab(); tbcSearch.SelectedTab = pgResults; txtFind.Focus(); } } } catch (Exception ex) { Utils.HandleError(ex); } }