Office deployment wizard for InstaSoft customers: - Install Office 2019/2021/2024 (Standard, Professional Plus, Home & Business) - Auto-download ODT from Microsoft, generate config XML, run setup - Remove existing Office installations (C2R + MSI) - License troubleshooting via ospp.vbs (dstatus, unpkey) - Fluent Design UI (WPF .NET Framework 4.8, Win7+ compatible) - Hungarian interface, multi-language Office installation - Product key input with auto-activation support Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
81 sor
2.5 KiB
C#
81 sor
2.5 KiB
C#
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using InstaSoftOfficeTool.Models;
|
|
|
|
namespace InstaSoftOfficeTool.Pages
|
|
{
|
|
public partial class EditionPage : Page, IWizardPage
|
|
{
|
|
private readonly MainWindow _main;
|
|
private readonly InstallConfig _config;
|
|
private readonly OfficeEdition[] _editions;
|
|
|
|
public EditionPage(MainWindow main, InstallConfig config)
|
|
{
|
|
InitializeComponent();
|
|
_main = main;
|
|
_config = config;
|
|
_editions = OfficeEdition.GetEditions(_config.Version);
|
|
|
|
SubtitleText.Text = _config.GetVersionDisplayName() + " — melyik kiadast szeretne?";
|
|
|
|
BuildEditionCards();
|
|
}
|
|
|
|
private void BuildEditionCards()
|
|
{
|
|
EditionPanel.Children.Clear();
|
|
|
|
for (int i = 0; i < _editions.Length; i++)
|
|
{
|
|
var edition = _editions[i];
|
|
var rb = new RadioButton
|
|
{
|
|
GroupName = "Edition",
|
|
IsChecked = i == 0 || (_config.Edition != null && _config.Edition.ProductId == edition.ProductId),
|
|
Style = (Style)FindResource("CardRadioButton"),
|
|
Margin = new Thickness(0, 0, 0, 10),
|
|
Tag = i
|
|
};
|
|
|
|
var sp = new StackPanel { Margin = new Thickness(8, 2, 8, 2) };
|
|
|
|
var titleBlock = new TextBlock
|
|
{
|
|
Text = edition.DisplayName,
|
|
FontSize = 18,
|
|
FontWeight = FontWeights.SemiBold
|
|
};
|
|
sp.Children.Add(titleBlock);
|
|
|
|
var descBlock = new TextBlock
|
|
{
|
|
Text = edition.Description,
|
|
FontSize = 12,
|
|
Foreground = (System.Windows.Media.Brush)FindResource("TextSecondaryBrush"),
|
|
TextWrapping = TextWrapping.Wrap,
|
|
Margin = new Thickness(0, 2, 0, 0)
|
|
};
|
|
sp.Children.Add(descBlock);
|
|
|
|
rb.Content = sp;
|
|
EditionPanel.Children.Add(rb);
|
|
}
|
|
}
|
|
|
|
public bool Validate()
|
|
{
|
|
foreach (var child in EditionPanel.Children)
|
|
{
|
|
if (child is RadioButton rb && rb.IsChecked == true)
|
|
{
|
|
int idx = (int)rb.Tag;
|
|
_config.Edition = _editions[idx];
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
}
|