v1.09 — Fix ODT download, selective removal, Display Level Full

- Direct CDN download (officecdn.microsoft.com/pr/wsus/setup.exe) instead of broken fwlink redirect
- HttpClient with proper redirect handling, content-type check, file size validation
- Selective C2R removal: each product listed separately, only checked items removed
- OfficeDetector splits ProductReleaseIds into individual entries
- Display Level="Full" for removal (shows Microsoft progress UI)
- Confirmation dialog before removal on all pages

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hariel1985
2026-03-31 07:33:19 +02:00
szülő f41b821d24
commit eac8813cc0
7 fájl változott, egészen pontosan 221 új sor hozzáadva és 122 régi sor törölve

Fájl megtekintése

@@ -61,65 +61,96 @@ namespace InstaSoftOfficeTool.Pages
BtnRemove.IsEnabled = false;
LogPanel.Visibility = Visibility.Visible;
bool hasC2R = false;
foreach (UIElement child in OfficeListPanel.Children)
try
{
if (child is CheckBox cb && cb.IsChecked == true)
var c2rProducts = new System.Collections.Generic.List<string>();
foreach (UIElement child in OfficeListPanel.Children)
{
var office = (InstalledOffice)cb.Tag;
if (office.IsClickToRun)
if (child is CheckBox cb && cb.IsChecked == true)
{
hasC2R = true;
}
else if (!string.IsNullOrEmpty(office.ProductCode))
{
AppendLog("MSI elt\u00e1vol\u00edt\u00e1s: " + office.DisplayName);
var runner = new ProcessRunner();
runner.OutputReceived += msg => Dispatcher.Invoke(() => AppendLog(msg));
await runner.RunAsync("msiexec", "/x " + office.ProductCode + " /qb");
var office = (InstalledOffice)cb.Tag;
if (office.IsClickToRun)
{
c2rProducts.Add(office.ProductCode);
}
else if (!string.IsNullOrEmpty(office.ProductCode))
{
AppendLog("MSI elt\u00e1vol\u00edt\u00e1s: " + office.DisplayName);
var runner = new ProcessRunner();
runner.OutputReceived += msg => Dispatcher.Invoke(() => AppendLog(msg));
int code = await runner.RunAsync("msiexec", "/x " + office.ProductCode + " /qb");
AppendLog("MSI exit code: " + code);
}
}
}
}
if (hasC2R)
{
AppendLog("Click-to-Run Office elt\u00e1vol\u00edt\u00e1sa ODT-vel...");
var downloader = new OdtDownloader();
downloader.StatusChanged += msg => Dispatcher.Invoke(() => AppendLog(msg));
bool ok = await downloader.DownloadAndExtractAsync();
if (ok)
if (c2rProducts.Count > 0)
{
string removeXml = OdtXmlGenerator.GenerateRemoveAll();
AppendLog("Click-to-Run term\u00e9kek elt\u00e1vol\u00edt\u00e1sa: " + string.Join(", ", c2rProducts));
var downloader = new OdtDownloader();
downloader.StatusChanged += msg => Dispatcher.Invoke(() => AppendLog(msg));
bool ok = await downloader.DownloadAndExtractAsync();
if (!ok)
{
AppendLog("HIBA: Az ODT let\u00f6lt\u00e9se sikertelen.");
BtnRemove.IsEnabled = true;
return;
}
string removeXml = OdtXmlGenerator.GenerateRemoveProducts(c2rProducts.ToArray());
string xmlPath = Path.Combine(downloader.OdtFolder, "remove.xml");
File.WriteAllText(xmlPath, removeXml);
AppendLog("Remove XML:");
AppendLog(removeXml);
AppendLog("");
AppendLog("Futtat\u00e1s: setup.exe /configure remove.xml");
AppendLog("Ez eltarthat n\u00e9h\u00e1ny percig...");
int exitCode = await downloader.RunRemoveAsync(xmlPath,
msg => Dispatcher.Invoke(() => AppendLog(msg)));
AppendLog(exitCode == 0
? "Office sikeresen elt\u00e1vol\u00edtva."
: "Elt\u00e1vol\u00edt\u00e1s befejez\u0151d\u00f6tt (k\u00f3d: " + exitCode + ")");
}
}
AppendLog("setup.exe exit code: " + exitCode);
if (CbCleanLicense.IsChecked == true)
if (exitCode == 0)
{
AppendLog("Office sikeresen elt\u00e1vol\u00edtva.");
}
else
{
AppendLog("FIGYELEM: Az elt\u00e1vol\u00edt\u00e1s nem siker\u00fclt (k\u00f3d: " + exitCode + ")");
AppendLog("Pr\u00f3b\u00e1lja meg manu\u00e1lisan: Vez\u00e9rl\u0151pult > Programok elt\u00e1vol\u00edt\u00e1sa");
}
}
if (CbCleanLicense.IsChecked == true)
{
AppendLog("");
AppendLog("Licenc-adatb\u00e1zis tiszt\u00edt\u00e1sa...");
var lm = new LicenseManager();
if (lm.FindOspp())
{
var cleanResult = await lm.RemoveAllKeysAsync();
AppendLog(cleanResult);
}
else
{
AppendLog("Az ospp.vbs nem tal\u00e1lhat\u00f3 \u2014 licenc-tiszt\u00edt\u00e1s kihagyva.");
}
}
AppendLog("");
AppendLog("K\u00e9sz.");
}
catch (Exception ex)
{
AppendLog("Licenc-adatb\u00e1zis tiszt\u00edt\u00e1sa...");
var lm = new LicenseManager();
if (lm.FindOspp())
{
var cleanResult = await lm.RemoveAllKeysAsync();
AppendLog(cleanResult);
}
else
{
AppendLog("Az ospp.vbs nem tal\u00e1lhat\u00f3 \u2014 licenc-tiszt\u00edt\u00e1s kihagyva.");
}
AppendLog("V\u00e1ratlan hiba: " + ex.Message);
AppendLog(ex.StackTrace);
}
AppendLog("K\u00e9sz.");
_main.ShowCloseButton();
}