v1.15 — PowerShell edition + repo restructure
- New powershell/InstaSoftOfficeTool.ps1: single-file WPF GUI version - Same Fluent Design UI, no compilation needed - Runs on any Windows 7+ with PowerShell 5.1 (built-in) - Chrome won't flag .ps1 files as "rarely downloaded" - Auto-elevates to admin - Moved C# source to src/ subfolder - Updated .gitignore for nested bin/obj folders Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,79 +0,0 @@
|
||||
using System.Xml.Linq;
|
||||
using InstaSoftOfficeTool.Models;
|
||||
|
||||
namespace InstaSoftOfficeTool.Services
|
||||
{
|
||||
public static class OdtXmlGenerator
|
||||
{
|
||||
public static string Generate(InstallConfig config)
|
||||
{
|
||||
var product = new XElement("Product",
|
||||
new XAttribute("ID", config.Edition.ProductId));
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(config.ProductKey))
|
||||
{
|
||||
product.Add(new XAttribute("PIDKEY", config.ProductKey.Replace("-", "").Trim()));
|
||||
}
|
||||
|
||||
product.Add(new XElement("Language", new XAttribute("ID", config.Language)));
|
||||
|
||||
foreach (var app in config.ExcludedApps)
|
||||
{
|
||||
product.Add(new XElement("ExcludeApp", new XAttribute("ID", app)));
|
||||
}
|
||||
|
||||
var add = new XElement("Add",
|
||||
new XAttribute("OfficeClientEdition", config.Architecture),
|
||||
new XAttribute("Channel", config.Edition.Channel),
|
||||
product);
|
||||
|
||||
var configuration = new XElement("Configuration",
|
||||
add,
|
||||
new XElement("Display",
|
||||
new XAttribute("Level", "Full"),
|
||||
new XAttribute("AcceptEULA", "TRUE")),
|
||||
new XElement("Property",
|
||||
new XAttribute("Name", "FORCEAPPSHUTDOWN"),
|
||||
new XAttribute("Value", "TRUE")));
|
||||
|
||||
var doc = new XDocument(new XDeclaration("1.0", "utf-8", null), configuration);
|
||||
return doc.Declaration + "\n" + doc.Root;
|
||||
}
|
||||
|
||||
public static string GenerateRemoveAll()
|
||||
{
|
||||
var configuration = new XElement("Configuration",
|
||||
new XElement("Remove", new XAttribute("All", "TRUE")),
|
||||
new XElement("Display",
|
||||
new XAttribute("Level", "Full"),
|
||||
new XAttribute("AcceptEULA", "TRUE")),
|
||||
new XElement("Property",
|
||||
new XAttribute("Name", "FORCEAPPSHUTDOWN"),
|
||||
new XAttribute("Value", "TRUE")));
|
||||
|
||||
var doc = new XDocument(new XDeclaration("1.0", "utf-8", null), configuration);
|
||||
return doc.Declaration + "\n" + doc.Root;
|
||||
}
|
||||
|
||||
public static string GenerateRemoveProducts(string[] productIds)
|
||||
{
|
||||
var remove = new XElement("Remove");
|
||||
foreach (var id in productIds)
|
||||
{
|
||||
remove.Add(new XElement("Product", new XAttribute("ID", id)));
|
||||
}
|
||||
|
||||
var configuration = new XElement("Configuration",
|
||||
remove,
|
||||
new XElement("Display",
|
||||
new XAttribute("Level", "Full"),
|
||||
new XAttribute("AcceptEULA", "TRUE")),
|
||||
new XElement("Property",
|
||||
new XAttribute("Name", "FORCEAPPSHUTDOWN"),
|
||||
new XAttribute("Value", "TRUE")));
|
||||
|
||||
var doc = new XDocument(new XDeclaration("1.0", "utf-8", null), configuration);
|
||||
return doc.Declaration + "\n" + doc.Root;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user