diff --git a/InstaSoftOfficeTool.csproj b/InstaSoftOfficeTool.csproj
index 9d07aaf..8d245c1 100644
--- a/InstaSoftOfficeTool.csproj
+++ b/InstaSoftOfficeTool.csproj
@@ -9,9 +9,9 @@
InstaSoft Zrt.
InstaSoft Office Tool
Copyright (c) InstaSoft Zrt. 2026
- 1.0.0
- 1.0.0.0
- 1.0.0.0
+ 1.0.2
+ 1.0.2.0
+ 1.0.2.0
app.manifest
latest
diff --git a/MainWindow.xaml b/MainWindow.xaml
index d7ac07c..f11e27a 100644
--- a/MainWindow.xaml
+++ b/MainWindow.xaml
@@ -41,7 +41,7 @@
Foreground="{StaticResource TextSecondaryBrush}" Margin="0,-2,0,0"/>
-
diff --git a/Pages/TroubleshootPage.xaml b/Pages/TroubleshootPage.xaml
index 5aae968..d3d30cb 100644
--- a/Pages/TroubleshootPage.xaml
+++ b/Pages/TroubleshootPage.xaml
@@ -5,41 +5,47 @@
-
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
+
+
+ Click="BtnRemoveAll_Click" IsEnabled="False" Visibility="Collapsed"/>
diff --git a/Pages/TroubleshootPage.xaml.cs b/Pages/TroubleshootPage.xaml.cs
index 353f0be..a9ce561 100644
--- a/Pages/TroubleshootPage.xaml.cs
+++ b/Pages/TroubleshootPage.xaml.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
@@ -10,6 +11,7 @@ namespace InstaSoftOfficeTool.Pages
{
private readonly MainWindow _main;
private readonly LicenseManager _licenseManager = new LicenseManager();
+ private List _entries = new List();
public TroubleshootPage(MainWindow main)
{
@@ -20,56 +22,200 @@ namespace InstaSoftOfficeTool.Pages
private async System.Threading.Tasks.Task RefreshStatus()
{
- OutputText.Text = "Keres\u00e9s folyamatban...\n";
+ OutputText.Text = "";
+ OsppPathText.Text = "";
+ KeyCardsPanel.Children.Clear();
BtnRemoveAll.IsEnabled = false;
+ BtnRemoveAll.Visibility = Visibility.Collapsed;
BtnRefresh.IsEnabled = false;
+ // Loading indicator
+ var loadingText = new TextBlock
+ {
+ Text = "Keres\u00e9s folyamatban...",
+ FontSize = 13,
+ Foreground = (Brush)FindResource("TextSecondaryBrush"),
+ Margin = new Thickness(0, 8, 0, 8)
+ };
+ KeyCardsPanel.Children.Add(loadingText);
+
bool found = _licenseManager.FindOspp();
if (!found)
{
- OsppStatusIcon.Text = "\uE711";
- OsppStatusIcon.Foreground = (Brush)FindResource("ErrorBrush");
- OsppStatusText.Text = "Az ospp.vbs nem tal\u00e1lhat\u00f3. Nincs telep\u00edtett Office?";
- OutputText.Text = "Az ospp.vbs f\u00e1jl nem tal\u00e1lhat\u00f3 a sz\u00e1m\u00edt\u00f3g\u00e9pen.\n\n" +
- "Lehets\u00e9ges okok:\n" +
- "- Nincs telep\u00edtett Microsoft Office\n" +
- "- Az Office nem a szok\u00e1sos helyre lett telep\u00edtve";
+ KeyCardsPanel.Children.Clear();
+ var errorCard = new Border
+ {
+ Background = (Brush)FindResource("CardBrush"),
+ BorderBrush = (Brush)FindResource("BorderBrush"),
+ BorderThickness = new Thickness(1),
+ CornerRadius = new CornerRadius(8),
+ Padding = new Thickness(16, 14, 16, 14),
+ Margin = new Thickness(0, 0, 0, 6)
+ };
+ var errorPanel = new StackPanel();
+ errorPanel.Children.Add(new TextBlock
+ {
+ Text = "Az ospp.vbs nem tal\u00e1lhat\u00f3",
+ FontSize = 14, FontWeight = FontWeights.SemiBold,
+ Foreground = (Brush)FindResource("ErrorBrush")
+ });
+ errorPanel.Children.Add(new TextBlock
+ {
+ Text = "Nincs telep\u00edtett Microsoft Office, vagy nem a szok\u00e1sos helyre lett telep\u00edtve.",
+ FontSize = 12, Foreground = (Brush)FindResource("TextSecondaryBrush"),
+ TextWrapping = TextWrapping.Wrap, Margin = new Thickness(0, 4, 0, 0)
+ });
+ errorCard.Child = errorPanel;
+ KeyCardsPanel.Children.Add(errorCard);
BtnRefresh.IsEnabled = true;
return;
}
- OsppStatusIcon.Text = "\uE73E";
- OsppStatusIcon.Foreground = (Brush)FindResource("SuccessBrush");
- OsppStatusText.Text = "ospp.vbs megtal\u00e1lva: " + _licenseManager.OsppPath;
-
- OutputText.Text = "Licenc-\u00e1llapot lek\u00e9rdez\u00e9se...\n";
+ OsppPathText.Text = "ospp.vbs helye: " + _licenseManager.OsppPath;
try
{
string status = await _licenseManager.GetStatusAsync();
OutputText.Text = status;
- var keys = _licenseManager.ParseLicenseKeys(status);
- BtnRemoveAll.IsEnabled = keys.Count > 0;
-
- if (keys.Count > 0)
- {
- OutputText.Text += "\n--- " + keys.Count + " term\u00e9kkulcs tal\u00e1lhat\u00f3 ---";
- }
- else
- {
- OutputText.Text += "\n--- Nincs telep\u00edtett term\u00e9kkulcs ---";
- }
+ _entries = _licenseManager.ParseLicenseEntries(status);
+ BuildKeyCards();
}
catch (Exception ex)
{
+ KeyCardsPanel.Children.Clear();
OutputText.Text = "Hiba a lek\u00e9rdez\u00e9s sor\u00e1n: " + ex.Message;
}
BtnRefresh.IsEnabled = true;
}
+ private void BuildKeyCards()
+ {
+ KeyCardsPanel.Children.Clear();
+
+ if (_entries.Count == 0)
+ {
+ var noKeyCard = new Border
+ {
+ Background = (Brush)FindResource("CardBrush"),
+ BorderBrush = (Brush)FindResource("BorderBrush"),
+ BorderThickness = new Thickness(1),
+ CornerRadius = new CornerRadius(8),
+ Padding = new Thickness(16, 14, 16, 14)
+ };
+ noKeyCard.Child = new TextBlock
+ {
+ Text = "Nincs telep\u00edtett term\u00e9kkulcs.",
+ FontSize = 13,
+ Foreground = (Brush)FindResource("TextSecondaryBrush")
+ };
+ KeyCardsPanel.Children.Add(noKeyCard);
+ return;
+ }
+
+ if (_entries.Count > 1)
+ {
+ BtnRemoveAll.Visibility = Visibility.Visible;
+ BtnRemoveAll.IsEnabled = true;
+ }
+
+ foreach (var entry in _entries)
+ {
+ KeyCardsPanel.Children.Add(CreateKeyCard(entry));
+ }
+ }
+
+ private Border CreateKeyCard(LicenseEntry entry)
+ {
+ var grid = new Grid();
+ grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
+ grid.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
+
+ var infoPanel = new StackPanel { VerticalAlignment = VerticalAlignment.Center };
+
+ infoPanel.Children.Add(new TextBlock
+ {
+ Text = string.IsNullOrEmpty(entry.LicenseName) ? "Ismeretlen licenc" : entry.LicenseName,
+ FontSize = 13, FontWeight = FontWeights.SemiBold,
+ TextTrimming = TextTrimming.CharacterEllipsis
+ });
+
+ var statusLine = !string.IsNullOrEmpty(entry.ErrorDescription)
+ ? entry.ErrorDescription
+ : (!string.IsNullOrEmpty(entry.Status) ? entry.Status : entry.Description);
+
+ infoPanel.Children.Add(new TextBlock
+ {
+ Text = statusLine,
+ FontSize = 11, Foreground = (Brush)FindResource("TextSecondaryBrush"),
+ TextTrimming = TextTrimming.CharacterEllipsis
+ });
+
+ infoPanel.Children.Add(new TextBlock
+ {
+ Text = "Kulcs: *****-" + entry.Last5,
+ FontSize = 11, FontFamily = new FontFamily("Consolas"),
+ Foreground = (Brush)FindResource("TextSecondaryBrush"),
+ Margin = new Thickness(0, 2, 0, 0)
+ });
+
+ Grid.SetColumn(infoPanel, 0);
+ grid.Children.Add(infoPanel);
+
+ var removeBtn = new Button
+ {
+ Content = "Elt\u00e1vol\u00edt\u00e1s",
+ Style = (Style)FindResource("SecondaryButton"),
+ Padding = new Thickness(14, 6, 14, 6),
+ FontSize = 12,
+ VerticalAlignment = VerticalAlignment.Center,
+ Tag = entry.Last5
+ };
+ removeBtn.Click += BtnRemoveSingle_Click;
+ Grid.SetColumn(removeBtn, 1);
+ grid.Children.Add(removeBtn);
+
+ return new Border
+ {
+ Background = (Brush)FindResource("CardBrush"),
+ BorderBrush = (Brush)FindResource("BorderBrush"),
+ BorderThickness = new Thickness(1),
+ CornerRadius = new CornerRadius(8),
+ Padding = new Thickness(16, 10, 16, 10),
+ Margin = new Thickness(0, 0, 0, 6),
+ Child = grid
+ };
+ }
+
+ private async void BtnRemoveSingle_Click(object sender, RoutedEventArgs e)
+ {
+ var btn = (Button)sender;
+ var last5 = (string)btn.Tag;
+
+ var result = MessageBox.Show(
+ "Biztosan el szeretn\u00e9 t\u00e1vol\u00edtani a *****-" + last5 + " kulcsot?",
+ "Meger\u0151s\u00edt\u00e9s", MessageBoxButton.YesNo, MessageBoxImage.Question);
+
+ if (result != MessageBoxResult.Yes) return;
+
+ btn.IsEnabled = false;
+ btn.Content = "...";
+
+ try
+ {
+ await _licenseManager.RemoveKeyAsync(last5);
+ await RefreshStatus();
+ }
+ catch (Exception ex)
+ {
+ OutputText.Text += "\nHiba: " + ex.Message;
+ btn.IsEnabled = true;
+ btn.Content = "Elt\u00e1vol\u00edt\u00e1s";
+ }
+ }
+
private async void BtnRefresh_Click(object sender, RoutedEventArgs e)
{
await RefreshStatus();
@@ -78,7 +224,7 @@ namespace InstaSoftOfficeTool.Pages
private async void BtnRemoveAll_Click(object sender, RoutedEventArgs e)
{
var result = MessageBox.Show(
- "Biztosan el szeretn\u00e9 t\u00e1vol\u00edtani az \u00f6sszes telep\u00edtett term\u00e9kkulcsot?\n\n" +
+ "Biztosan el szeretn\u00e9 t\u00e1vol\u00edtani az \u00f6sszes telep\u00edtett term\u00e9kkulcsot (" + _entries.Count + " db)?\n\n" +
"Ez nem t\u00f6r\u00f6l adatot, csak az aktiv\u00e1ci\u00f3s \u00e1llapotot \u00e1ll\u00edtja vissza.",
"Meger\u0151s\u00edt\u00e9s", MessageBoxButton.YesNo, MessageBoxImage.Warning);
@@ -87,20 +233,32 @@ namespace InstaSoftOfficeTool.Pages
BtnRemoveAll.IsEnabled = false;
BtnRefresh.IsEnabled = false;
- OutputText.Text += "\n\nTerm\u00e9kkulcsok elt\u00e1vol\u00edt\u00e1sa...\n";
-
try
{
- string cleanResult = await _licenseManager.RemoveAllKeysAsync();
- OutputText.Text += cleanResult + "\n";
- OutputText.Text += "\nK\u00e9sz. Kattintson az '\u00c1llapot friss\u00edt\u00e9se' gombra az eredm\u00e9ny ellen\u0151rz\u00e9s\u00e9hez.";
+ await _licenseManager.RemoveAllKeysAsync();
+ await RefreshStatus();
}
catch (Exception ex)
{
- OutputText.Text += "Hiba: " + ex.Message;
+ OutputText.Text += "\nHiba: " + ex.Message;
}
BtnRefresh.IsEnabled = true;
}
+
+ private void DetailsExpander_Expanded(object sender, RoutedEventArgs e)
+ {
+ // Grow window to fit details
+ var window = Window.GetWindow(this);
+ if (window != null && window.Height < 680)
+ window.Height = 680;
+ }
+
+ private void DetailsExpander_Collapsed(object sender, RoutedEventArgs e)
+ {
+ var window = Window.GetWindow(this);
+ if (window != null)
+ window.Height = 550;
+ }
}
}
diff --git a/Services/LicenseManager.cs b/Services/LicenseManager.cs
index e719cff..adfb797 100644
--- a/Services/LicenseManager.cs
+++ b/Services/LicenseManager.cs
@@ -6,6 +6,15 @@ using System.Threading.Tasks;
namespace InstaSoftOfficeTool.Services
{
+ public class LicenseEntry
+ {
+ public string LicenseName { get; set; } = "";
+ public string Description { get; set; } = "";
+ public string Status { get; set; } = "";
+ public string ErrorDescription { get; set; } = "";
+ public string Last5 { get; set; } = "";
+ }
+
public class LicenseManager
{
public string OsppPath { get; private set; }
@@ -88,6 +97,43 @@ namespace InstaSoftOfficeTool.Services
return keys;
}
+ public List ParseLicenseEntries(string dstatusOutput)
+ {
+ var entries = new List();
+
+ // Split by "-------" separator blocks
+ var blocks = Regex.Split(dstatusOutput, @"-{10,}");
+
+ foreach (var block in blocks)
+ {
+ var trimmed = block.Trim();
+ if (string.IsNullOrEmpty(trimmed)) continue;
+ if (trimmed.StartsWith("---Processing") || trimmed.StartsWith("---Exiting")) continue;
+
+ var entry = new LicenseEntry();
+
+ var nameMatch = Regex.Match(trimmed, @"LICENSE NAME:\s*(.+)", RegexOptions.IgnoreCase);
+ if (nameMatch.Success) entry.LicenseName = nameMatch.Groups[1].Value.Trim();
+
+ var descMatch = Regex.Match(trimmed, @"LICENSE DESCRIPTION:\s*(.+)", RegexOptions.IgnoreCase);
+ if (descMatch.Success) entry.Description = descMatch.Groups[1].Value.Trim();
+
+ var statusMatch = Regex.Match(trimmed, @"LICENSE STATUS:\s*(.+)", RegexOptions.IgnoreCase);
+ if (statusMatch.Success) entry.Status = statusMatch.Groups[1].Value.Trim();
+
+ var errorMatch = Regex.Match(trimmed, @"ERROR DESCRIPTION:\s*(.+)", RegexOptions.IgnoreCase);
+ if (errorMatch.Success) entry.ErrorDescription = errorMatch.Groups[1].Value.Trim();
+
+ var keyMatch = Regex.Match(trimmed, @"Last 5 characters of installed product key:\s*(\S+)", RegexOptions.IgnoreCase);
+ if (keyMatch.Success) entry.Last5 = keyMatch.Groups[1].Value.Trim();
+
+ if (!string.IsNullOrEmpty(entry.Last5))
+ entries.Add(entry);
+ }
+
+ return entries;
+ }
+
public async Task RemoveKeyAsync(string last5Chars)
{
if (string.IsNullOrEmpty(OsppPath))