diff --git a/authoring-ui/App.xaml b/authoring-ui/App.xaml new file mode 100644 index 0000000..cf2f3f4 --- /dev/null +++ b/authoring-ui/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/authoring-ui/Covenant.Setup.Authoring.csproj b/authoring-ui/Covenant.Setup.Authoring.csproj index 71d81cb..9742a97 100644 --- a/authoring-ui/Covenant.Setup.Authoring.csproj +++ b/authoring-ui/Covenant.Setup.Authoring.csproj @@ -7,13 +7,15 @@ true false false - false + true + false win-x64 enable enable Covenant.Setup.Authoring Covenant.Setup.Authoring app.manifest + $(DefineConstants);DISABLE_XAML_GENERATED_MAIN @@ -21,4 +23,7 @@ + + + diff --git a/authoring-ui/Covenant.Setup.Authoring.iss b/authoring-ui/Covenant.Setup.Authoring.iss new file mode 100644 index 0000000..e9dac91 --- /dev/null +++ b/authoring-ui/Covenant.Setup.Authoring.iss @@ -0,0 +1,54 @@ +; Inno Setup script for the Covenant Setup Authoring UI. +; +; Build prerequisites from the repository root: +; dotnet publish .\authoring-ui\Covenant.Setup.Authoring.csproj -c Release -r win-x64 --self-contained true -o .\dist\authoring-ui +; +; Compile this installer from the repository root: +; iscc .\authoring-ui\Covenant.Setup.Authoring.iss + +#define MyAppName "Covenant Setup Authoring" +#define MyAppVersion "0.1.0" +#define MyAppPublisher "covenant-setup" +#define MyAppExeName "Covenant.Setup.Authoring.exe" +#define MyPublishDir "..\dist\authoring-ui" + +[Setup] +AppId={{0E0A77B1-2045-49D9-A722-2C9B328BE900} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +AppPublisher={#MyAppPublisher} +DefaultDirName={localappdata}\Programs\Covenant Setup Authoring +DefaultGroupName={#MyAppName} +DisableProgramGroupPage=yes +PrivilegesRequired=lowest +MinVersion=10.0.19041 +ArchitecturesAllowed=x64compatible +ArchitecturesInstallIn64BitMode=x64compatible +OutputDir=..\dist\inno +OutputBaseFilename=covenant-setup-authoring-installer +Compression=lzma2 +SolidCompression=yes +WizardStyle=modern +SetupLogging=yes +UninstallDisplayIcon={app}\{#MyAppExeName} +VersionInfoVersion={#MyAppVersion}.0 +VersionInfoDescription=Covenant Setup Authoring installer + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "Additional shortcuts:"; Flags: unchecked + +[Files] +Source: "{#MyPublishDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "README.md"; DestDir: "{app}\docs"; DestName: "authoring-ui-readme.md"; Flags: ignoreversion + +[Icons] +Name: "{group}\Covenant Setup Authoring"; Filename: "{app}\{#MyAppExeName}"; WorkingDir: "{app}" +Name: "{group}\Authoring UI README"; Filename: "{app}\docs\authoring-ui-readme.md" +Name: "{group}\Uninstall Covenant Setup Authoring"; Filename: "{uninstallexe}" +Name: "{autodesktop}\Covenant Setup Authoring"; Filename: "{app}\{#MyAppExeName}"; WorkingDir: "{app}"; Tasks: desktopicon + +[Run] +Filename: "{app}\{#MyAppExeName}"; Description: "Launch Covenant Setup Authoring"; Flags: nowait postinstall skipifsilent unchecked diff --git a/authoring-ui/Program.cs b/authoring-ui/Program.cs index 37c60da..17ba881 100644 --- a/authoring-ui/Program.cs +++ b/authoring-ui/Program.cs @@ -8,6 +8,7 @@ internal static class Program [STAThread] private static void Main() { + WinRT.ComWrappersSupport.InitializeComWrappers(); Application.Start(_params => { var dispatcherQueue = DispatcherQueue.GetForCurrentThread(); @@ -22,10 +23,15 @@ internal static class Program } } -internal sealed class AuthoringApp : Application +partial class AuthoringApp : Application { private Window? _window; + public AuthoringApp() + { + InitializeComponent(); + } + protected override void OnLaunched(LaunchActivatedEventArgs args) { var window = new MainWindow(); diff --git a/authoring-ui/README.md b/authoring-ui/README.md index 8da2157..730aff0 100644 --- a/authoring-ui/README.md +++ b/authoring-ui/README.md @@ -14,6 +14,32 @@ Run unit tests from the repository root: dotnet test .\authoring-ui.Tests\Covenant.Setup.Authoring.Tests.csproj ``` +Build a release publish from the repository root: + +```powershell +dotnet publish .\authoring-ui\Covenant.Setup.Authoring.csproj -c Release -r win-x64 --self-contained true -o .\dist\authoring-ui +``` + +The published app entry point is: + +```powershell +.\dist\authoring-ui\Covenant.Setup.Authoring.exe +``` + +Keep the full `dist\authoring-ui` folder together when copying it to another Windows machine. The release output includes the WinUI, Windows App SDK, and .NET runtime files required by the app. + +Build the Inno Setup installer from the repository root: + +```powershell +iscc .\authoring-ui\Covenant.Setup.Authoring.iss +``` + +The installer output is: + +```powershell +.\dist\inno\covenant-setup-authoring-installer.exe +``` + The app edits the current manifest schema: - `app_name` diff --git a/authoring-ui/README.md~ b/authoring-ui/README.md~ new file mode 100644 index 0000000..0770993 --- /dev/null +++ b/authoring-ui/README.md~ @@ -0,0 +1,58 @@ +# Covenant Setup Authoring UI + +WinUI 3 desktop app for creating `install.toml` manifests for `covenant-setup`. + +Run from the repository root: + +```powershell +dotnet run --project .\authoring-ui\Covenant.Setup.Authoring.csproj +``` + +Run unit tests from the repository root: + +```powershell +dotnet test .\authoring-ui.Tests\Covenant.Setup.Authoring.Tests.csproj +``` + +Build a release publish from the repository root: + +```powershell +dotnet publish .\authoring-ui\Covenant.Setup.Authoring.csproj -c Release -r win-x64 --self-contained true -o .\dist\authoring-ui +``` + +The published app entry point is: + +```powershell +.\dist\authoring-ui\Covenant.Setup.Authoring.exe +``` + +Keep the full `dist\authoring-ui` folder together when copying it to another Windows machine. The release output includes the WinUI, Windows App SDK, and .NET runtime files required by the app. + +The app edits the current manifest schema: + +- `app_name` +- `directories` +- `files` +- `registry` +- `shortcuts` +- `scripts` +- `purge` + +It keeps a live TOML preview, validates required fields locally, warns when a manifest appears to require elevation, and saves a TOML file through the Windows file picker. + +## Installer EXE Generation + +The Installer EXE section is enabled only when the app finds `covenant-setup.exe`. It checks: + +- next to the authoring app +- the current working directory +- `target\release` and `target\debug` under nearby repo roots +- directories on `PATH` + +When enabled, **Generate Installer EXE** writes the current TOML to the selected `install.toml` location and runs: + +```powershell +covenant-setup.exe --json package install.toml --output +``` + +The manifest should be saved in the payload source root so relative file sources package correctly.