fixed launch bugs on authoring app

This commit is contained in:
2026-05-03 23:40:56 -05:00
parent 3b765d2fa1
commit 5368590fb4
6 changed files with 160 additions and 2 deletions
+9
View File
@@ -0,0 +1,9 @@
<Application
x:Class="Covenant.Setup.Authoring.AuthoringApp"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.UI.Xaml.Controls">
<Application.Resources>
<controls:XamlControlsResources />
</Application.Resources>
</Application>
+6 -1
View File
@@ -7,13 +7,15 @@
<WindowsAppSDKSelfContained Condition="'$(RuntimeIdentifier)' != ''">true</WindowsAppSDKSelfContained>
<WindowsAppSdkBootstrapInitialize>false</WindowsAppSdkBootstrapInitialize>
<WindowsAppSdkDeploymentManagerInitialize>false</WindowsAppSdkDeploymentManagerInitialize>
<WindowsAppSdkUndockedRegFreeWinRTInitialize>false</WindowsAppSdkUndockedRegFreeWinRTInitialize>
<WindowsAppSdkUndockedRegFreeWinRTInitialize Condition="'$(RuntimeIdentifier)' != ''">true</WindowsAppSdkUndockedRegFreeWinRTInitialize>
<WindowsAppSdkUndockedRegFreeWinRTInitialize Condition="'$(RuntimeIdentifier)' == ''">false</WindowsAppSdkUndockedRegFreeWinRTInitialize>
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>Covenant.Setup.Authoring</AssemblyName>
<RootNamespace>Covenant.Setup.Authoring</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<DefineConstants>$(DefineConstants);DISABLE_XAML_GENERATED_MAIN</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="2.0.1" />
@@ -21,4 +23,7 @@
<ItemGroup>
<InternalsVisibleTo Include="Covenant.Setup.Authoring.Tests" />
</ItemGroup>
<Target Name="CopyWinUIPriToPublishDirectory" AfterTargets="Publish" Condition="'$(PublishDir)' != '' and Exists('$(OutDir)$(AssemblyName).pri')">
<Copy SourceFiles="$(OutDir)$(AssemblyName).pri" DestinationFolder="$(PublishDir)" SkipUnchangedFiles="true" />
</Target>
</Project>
+54
View File
@@ -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
+7 -1
View File
@@ -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();
+26
View File
@@ -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`
+58
View File
@@ -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 <output-directory>
```
The manifest should be saved in the payload source root so relative file sources package correctly.