Files
OfficeTool/Pages/SummaryPage.xaml.cs
hariel1985 12b86e0707 v1.22 — Office 2016 MSI ISO telepítés támogatás
Office 2016 Standard és Professional Plus telepítése ISO letöltéssel
(soft.direct), ISO csatolással és a Microsoft MSI telepítő indításával.
A 2019/2021/2024 verziók továbbra is ODT-vel működnek.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 23:27:14 +02:00

81 sor
2.8 KiB
C#

using System.Linq;
using System.Windows;
using System.Windows.Controls;
using InstaSoftOfficeTool.Models;
using InstaSoftOfficeTool.Services;
using Microsoft.Win32;
namespace InstaSoftOfficeTool.Pages
{
public partial class SummaryPage : Page, IWizardPage
{
private readonly MainWindow _main;
private readonly InstallConfig _config;
private string _generatedXml;
public SummaryPage(MainWindow main, InstallConfig config)
{
InitializeComponent();
_main = main;
_config = config;
Loaded += (s, e) => RefreshSummary();
}
private void RefreshSummary()
{
SumVersion.Text = _config.GetVersionDisplayName();
SumEdition.Text = _config.Edition?.DisplayName ?? "-";
SumArch.Text = _config.Architecture + "-bit";
SumLanguage.Text = _config.GetLanguageDisplayName() + " (" + _config.Language + ")";
SumKey.Text = string.IsNullOrEmpty(_config.ProductKey) ? "Nincs megadva" : _config.ProductKey;
if (_config.IsMsiInstall)
{
// MSI mode: no app exclusion, show ISO info instead of XML
SumExcluded.Text = "(a Microsoft telepítőben választható)";
string isoUrl = _config.GetIsoUrl();
XmlPreview.Text = "Telepítési mód: ISO letöltés + MSI telepítő\n" +
"ISO URL: " + (isoUrl ?? "Nem elérhető") + "\n\n" +
"A telepítő ISO fájl letöltése után a Microsoft Office\n" +
"saját telepítője indul el automatikusan.";
BtnSaveXml.Visibility = System.Windows.Visibility.Collapsed;
}
else
{
if (_config.ExcludedApps.Count > 0)
SumExcluded.Text = string.Join(", ", _config.ExcludedApps);
else
SumExcluded.Text = "Nincs (minden alkalmazás települ)";
_generatedXml = OdtXmlGenerator.Generate(_config);
XmlPreview.Text = _generatedXml;
BtnSaveXml.Visibility = System.Windows.Visibility.Visible;
}
}
private void BtnSaveXml_Click(object sender, RoutedEventArgs e)
{
var dlg = new SaveFileDialog
{
Filter = "XML f\u00e1jl (*.xml)|*.xml",
FileName = "configuration.xml"
};
if (dlg.ShowDialog() == true)
{
System.IO.File.WriteAllText(dlg.FileName, _generatedXml);
MessageBox.Show("XML sikeresen mentve:\n" + dlg.FileName,
"Ment\u00e9s", MessageBoxButton.OK, MessageBoxImage.Information);
}
}
public bool Validate()
{
return true;
}
}
}