Upgrade to .NET 8 LTS and enhance installer functionality

- Upgraded from .NET 7 to .NET 8 LTS for better Windows 11 compatibility
- Added App.config with runtime switches to prevent DirectWrite crashes
- Moved software rendering initialization to App() constructor
- Disabled ReadyToRun compilation to avoid font rendering issues
- Enhanced installer with auto-launch after installation
- Removed license agreement screen from installer
- Added WiX heat.exe file harvesting for proper multi-file deployment
- Cleaned up old MSI files from repository

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-07 09:30:21 -08:00
parent cff9bc4876
commit 308966da36
7 changed files with 59 additions and 13 deletions

7
NfcActions/App.config Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<!-- Force software rendering to prevent DirectWrite crashes -->
<AppContextSwitchOverrides value="Switch.System.Windows.DoNotUsePresentationDpiCapabilityTier2OrGreater=true;Switch.System.Windows.DoNotScaleForDpiChanges=false" />
</runtime>
</configuration>

View File

@@ -25,6 +25,24 @@ public partial class App : Application
private LogService? _logService;
private MainViewModel? _viewModel;
public App()
{
// CRITICAL: Set software rendering mode BEFORE any WPF initialization
// This must be done in the constructor before InitializeComponent()
try
{
// Set environment variable as additional safeguard
Environment.SetEnvironmentVariable("DOTNET_SYSTEM_WINDOWS_DONOTUSEPRESENTATIONDPICAPABILITYTIER2ORGREATER", "1");
// Force software rendering
RenderOptions.ProcessRenderMode = System.Windows.Interop.RenderMode.SoftwareOnly;
}
catch
{
// If this fails, try to continue anyway
}
}
private void Application_Startup(object sender, StartupEventArgs e)
{
// Ensure only one instance runs at a time
@@ -41,15 +59,6 @@ public partial class App : Application
return;
}
// Workaround for DirectWrite crash - force software rendering
try
{
RenderOptions.ProcessRenderMode = System.Windows.Interop.RenderMode.SoftwareOnly;
}
catch
{
// Ignore if this fails
}
// Initialize services
_logService = new LogService();
_cardReaderService = new CardReaderService(_logService);

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
@@ -20,7 +20,7 @@
<PublishSingleFile>false</PublishSingleFile>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PublishReadyToRun>true</PublishReadyToRun>
<PublishReadyToRun>false</PublishReadyToRun>
<PublishTrimmed>false</PublishTrimmed>
<EnableCompressionInSingleFile>false</EnableCompressionInSingleFile>
</PropertyGroup>