f311429bc2
Adds Services/SelfUpdateService.cs implementing the Chrome-style pattern:
1. Download new exe to "<current>.new"
2. Rename running exe to "<current>.old" (NTFS allows MoveFile on a
running exe -- it resolves processes by handle, not by path)
3. Rename ".new" to canonical path
4. Spawn the new exe with our argv
5. Environment.Exit(0)
6. Next start of the new exe runs CleanupAfterUpdate() in App.OFIC()
which deletes the leftover ".old"
UI: the existing "Download" banner button is now "Install update". Click
runs the self-update flow with a percent/MB progress label; any failure
(network, AV write-block, dir not writable) falls back to opening the
URL in the browser so users always have a path forward.
Bumps to 0.4.7. Also fixes a stale fallback URL that pointed at
sijbers.uk/pack/... -- now correctly points at bns.sijbers.uk/launcher/.
66 lines
3.1 KiB
XML
66 lines
3.1 KiB
XML
<Project Sdk="Microsoft.NET.Sdk">
|
|
<PropertyGroup>
|
|
<OutputType>WinExe</OutputType>
|
|
<!-- net8.0-windows is required for the XboxAuthNet WebView2 OAuth flow:
|
|
the netstandard2.0 build of XboxAuthNet has no WebUI implementation. -->
|
|
<TargetFramework>net8.0-windows</TargetFramework>
|
|
<UseWindowsForms>true</UseWindowsForms>
|
|
<Nullable>enable</Nullable>
|
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
|
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
|
<RootNamespace>ModpackLauncher</RootNamespace>
|
|
<AssemblyName>ModpackLauncher</AssemblyName>
|
|
<Version>0.4.7</Version>
|
|
<ApplicationIcon Condition="Exists('Assets\icon.ico')">Assets\icon.ico</ApplicationIcon>
|
|
|
|
<!-- Single-file self-contained publish defaults (Windows-only now due to WebView2) -->
|
|
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''">win-x64</RuntimeIdentifier>
|
|
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
|
|
<PublishSingleFile>true</PublishSingleFile>
|
|
<SelfContained>true</SelfContained>
|
|
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
|
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
|
|
<DebugType>embedded</DebugType>
|
|
<CopyDebugSymbolFilesFromPackages>false</CopyDebugSymbolFilesFromPackages>
|
|
<CopyDocumentationFilesFromPackages>false</CopyDocumentationFilesFromPackages>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<PackageReference Include="Avalonia" Version="12.0.2" />
|
|
<PackageReference Include="Avalonia.Desktop" Version="12.0.2" />
|
|
<PackageReference Include="Avalonia.Themes.Fluent" Version="12.0.2" />
|
|
<PackageReference Include="Avalonia.Fonts.Inter" Version="12.0.2" />
|
|
<PackageReference Include="AvaloniaUI.DiagnosticsSupport" Version="2.2.1">
|
|
<IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>
|
|
<PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
|
|
</PackageReference>
|
|
<PackageReference Include="CmlLib.Core" Version="4.0.6" />
|
|
<PackageReference Include="CmlLib.Core.Auth.Microsoft" Version="3.3.1" />
|
|
<PackageReference Include="CmlLib.Core.Installer.Forge" Version="1.1.1" />
|
|
<PackageReference Include="CmlLib.Core.Installer.NeoForge" Version="4.0.0" />
|
|
<PackageReference Include="XboxAuthNet.Game.Msal" Version="0.1.3" />
|
|
<PackageReference Include="fNbt" Version="0.7.1" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<EmbeddedResource Include="launcher-config.json" Condition="Exists('launcher-config.json')">
|
|
<LogicalName>launcher-config.json</LogicalName>
|
|
</EmbeddedResource>
|
|
<EmbeddedResource Include="launcher-config.template.json">
|
|
<LogicalName>launcher-config.template.json</LogicalName>
|
|
</EmbeddedResource>
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<AvaloniaResource Include="Assets\icon.png" />
|
|
<AvaloniaResource Include="Assets\noise.png" />
|
|
</ItemGroup>
|
|
|
|
<Target Name="StripNativePdbs" AfterTargets="Publish">
|
|
<ItemGroup>
|
|
<_StripPdb Include="$(PublishDir)*.pdb" Exclude="$(PublishDir)$(AssemblyName).pdb" />
|
|
</ItemGroup>
|
|
<Delete Files="@(_StripPdb)" />
|
|
</Target>
|
|
</Project>
|