diff --git a/Installer/Product.wxs b/Installer/Product.wxs index 4859d49..cb27fa1 100644 --- a/Installer/Product.wxs +++ b/Installer/Product.wxs @@ -20,6 +20,15 @@ + + + + + + @@ -32,6 +41,21 @@ + + + + + + + 1 + 1 + + WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed + + diff --git a/NfcActions-Setup-v1.0.1.msi b/NfcActions-Setup-v1.0.1.msi deleted file mode 100644 index 17b76f5..0000000 Binary files a/NfcActions-Setup-v1.0.1.msi and /dev/null differ diff --git a/NfcActions-Setup.msi b/NfcActions-Setup-v1.0.2-NET8.msi similarity index 81% rename from NfcActions-Setup.msi rename to NfcActions-Setup-v1.0.2-NET8.msi index 86808bb..ea2f4a6 100644 Binary files a/NfcActions-Setup.msi and b/NfcActions-Setup-v1.0.2-NET8.msi differ diff --git a/NfcActions/App.config b/NfcActions/App.config new file mode 100644 index 0000000..e88f2ce --- /dev/null +++ b/NfcActions/App.config @@ -0,0 +1,7 @@ + + + + + + + diff --git a/NfcActions/App.xaml.cs b/NfcActions/App.xaml.cs index cf971fd..9c929de 100644 --- a/NfcActions/App.xaml.cs +++ b/NfcActions/App.xaml.cs @@ -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); diff --git a/NfcActions/NfcActions.csproj b/NfcActions/NfcActions.csproj index 1eec0c7..d2f2489 100644 --- a/NfcActions/NfcActions.csproj +++ b/NfcActions/NfcActions.csproj @@ -2,7 +2,7 @@ WinExe - net7.0-windows + net8.0-windows enable true true @@ -20,7 +20,7 @@ false true win-x64 - true + false false false diff --git a/build-release.ps1 b/build-release.ps1 index 95bd945..c8f57ca 100644 --- a/build-release.ps1 +++ b/build-release.ps1 @@ -9,7 +9,7 @@ param( $ErrorActionPreference = "Stop" $scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Path $projectPath = Join-Path $scriptPath "NfcActions\NfcActions.csproj" -$publishPath = Join-Path $scriptPath "NfcActions\bin\Release\net7.0-windows\win-x64\publish" +$publishPath = Join-Path $scriptPath "NfcActions\bin\Release\net8.0-windows\win-x64\publish" $installerPath = Join-Path $scriptPath "Installer" Write-Host "=== NFC Actions Release Build ===" -ForegroundColor Cyan @@ -83,6 +83,12 @@ if ($BuildInstaller) { exit 1 } + # Update the harvested file to set ID to NfcActions.exe + Write-Host " Setting file ID for NfcActions.exe..." -ForegroundColor Gray + $harvestedContent = Get-Content obj\HarvestedFiles.wxs -Raw + $harvestedContent = $harvestedContent -replace '(