v1.13 — Post-install activation, app launch, scrollable progress page

- Progress page now scrollable (activation + launch cards were clipped)
- Post-install activation card if no product key was provided during wizard
- App launch buttons (Word, Excel, PowerPoint, Outlook) after successful install
- Skipped apps not shown in launch buttons
- Install time hint: "akár 30-40 percet is igénybe vehet"
- Auto-refresh office list after removal
- MSI uninstall: only valid {GUID} product codes accepted

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hariel1985
2026-03-31 10:08:13 +02:00
szülő 9c835871ec
commit ea8fa98bd6
4 fájl változott, egészen pontosan 177 új sor hozzáadva és 23 régi sor törölve

Fájl megtekintése

@@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using System.Windows;
@@ -133,8 +134,130 @@ namespace InstaSoftOfficeTool.Pages
DoneText.Foreground = DoneIcon.Foreground;
DonePanel.Visibility = Visibility.Visible;
if (success)
{
// Show activate card if no product key was provided
if (string.IsNullOrEmpty(_config.ProductKey))
{
ActivateCard.Visibility = Visibility.Visible;
}
// Show launch buttons
BuildLaunchButtons();
LaunchCard.Visibility = Visibility.Visible;
}
_main.ShowCloseButton();
});
}
private void BuildLaunchButtons()
{
LaunchButtons.Children.Clear();
var apps = new[]
{
("Word", "WINWORD.EXE"),
("Excel", "EXCEL.EXE"),
("PowerPoint", "POWERPNT.EXE"),
("Outlook", "OUTLOOK.EXE"),
};
foreach (var (name, exe) in apps)
{
// Skip if excluded
if (_config.ExcludedApps.Contains(name == "Word" ? "Word" :
name == "Excel" ? "Excel" :
name == "PowerPoint" ? "PowerPoint" :
name == "Outlook" ? "Outlook" : ""))
continue;
var btn = new Button
{
Content = name,
Style = (Style)FindResource("SecondaryButton"),
Padding = new Thickness(18, 8, 18, 8),
FontSize = 13,
Margin = new Thickness(0, 0, 8, 0),
Tag = exe
};
btn.Click += LaunchApp_Click;
LaunchButtons.Children.Add(btn);
}
}
private void LaunchApp_Click(object sender, RoutedEventArgs e)
{
var btn = (Button)sender;
var exe = (string)btn.Tag;
try
{
// Try common Office paths
var paths = new[]
{
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles),
"Microsoft Office", "root", "Office16", exe),
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86),
"Microsoft Office", "root", "Office16", exe),
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles),
"Microsoft Office", "Office16", exe),
};
foreach (var path in paths)
{
if (File.Exists(path))
{
Process.Start(path);
return;
}
}
// Fallback: let Windows find it
Process.Start(exe);
}
catch
{
AppendLog("Nem siker\u00fclt elind\u00edtani: " + exe);
}
}
private async void BtnActivateNow_Click(object sender, RoutedEventArgs e)
{
string key = await _main.AskProductKeyAsync();
if (string.IsNullOrEmpty(key)) return;
BtnActivateNow.IsEnabled = false;
BtnActivateNow.Content = "Aktiv\u00e1l\u00e1s...";
var lm = new LicenseManager();
if (!lm.FindOspp())
{
AppendLog("Az ospp.vbs nem tal\u00e1lhat\u00f3.");
BtnActivateNow.IsEnabled = true;
BtnActivateNow.Content = "Aktiv\u00e1l\u00e1s";
return;
}
AppendLog("Term\u00e9kkulcs telep\u00edt\u00e9se: " + key);
string inpResult = await lm.InstallKeyAsync(key);
AppendLog(inpResult);
AppendLog("Aktiv\u00e1l\u00e1s...");
string actResult = await lm.ActivateAsync();
AppendLog(actResult);
if (actResult.Contains("successful") || actResult.Contains("sikeres"))
{
BtnActivateNow.Content = "Aktiv\u00e1lva \u2713";
AppendLog("Az Office sikeresen aktiv\u00e1lva!");
}
else
{
BtnActivateNow.IsEnabled = true;
BtnActivateNow.Content = "Aktiv\u00e1l\u00e1s";
AppendLog("Az aktiv\u00e1l\u00e1s eredm\u00e9ny\u00e9t ellen\u0151rizze a kimenetben.");
}
}
}
}