Fix WPF single-file deployment crash and improve installer

- Disable single-file publishing (causes DirectWrite/font crash in WPF)
- Switch to multi-file self-contained deployment
- Update WiX installer to harvest all publish files using heat.exe
- Fix tray icon loading issue by including all necessary DLLs
- Reduce MSI size while maintaining all functionality

Fixes:
- System.TypeInitializationException crash on startup
- Missing tray icon (now shows DT logo correctly)

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-07 08:17:41 -08:00
parent 37309f30e1
commit f3323420a8
6 changed files with 101 additions and 19 deletions

View File

@@ -27,6 +27,7 @@
<Feature Id="ProductFeature" Title="NFC Actions" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentGroupRef Id="HarvestedFiles" />
<ComponentRef Id="ApplicationShortcut" />
<ComponentRef Id="AutoStartRegistry" />
</Feature>
@@ -72,30 +73,21 @@
</Component>
</DirectoryRef>
<!-- Registry and cleanup component -->
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="MainExecutable" Guid="D4E5F6A7-B8C9-4D8E-1F2A-3B4C5D6E7F8A">
<File Id="NfcActionsExe"
Source="..\NfcActions\bin\Release\net7.0-windows\win-x64\publish\NfcActions.exe" />
<Component Id="RegistryEntries" Guid="D4E5F6A7-B8C9-4D8E-1F2A-3B4C5D6E7F8A">
<RegistryValue Root="HKCU"
Key="Software\DangerousThings\NfcActions"
Name="MainExe"
Name="Installed"
Type="integer"
Value="1"
KeyPath="yes"/>
<RemoveFolder Id="RemoveINSTALLFOLDER" Directory="INSTALLFOLDER" On="uninstall" />
<RemoveFolder Id="RemoveCompanyFolder" Directory="CompanyFolder" On="uninstall" />
</Component>
<Component Id="ResourcesFolder" Guid="E5F6A7B8-C9D0-4E9F-2A3B-4C5D6E7F8A9B">
<File Id="IconIco" Source="..\NfcActions\bin\Release\net7.0-windows\win-x64\publish\Resources\icon.ico" />
<RegistryValue Root="HKCU"
Key="Software\DangerousThings\NfcActions"
Name="Resources"
Type="integer"
Value="1"
KeyPath="yes"/>
</Component>
</ComponentGroup>
<!-- Harvested files will be included from HarvestedFiles.wxs -->
</Product>
</Wix>

BIN
NfcActions-Setup-v1.0.1.msi Normal file

Binary file not shown.

BIN
NfcActions-Setup.msi Normal file

Binary file not shown.

View File

@@ -17,11 +17,12 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<PublishSingleFile>true</PublishSingleFile>
<PublishSingleFile>false</PublishSingleFile>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PublishReadyToRun>true</PublishReadyToRun>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<PublishTrimmed>false</PublishTrimmed>
<EnableCompressionInSingleFile>false</EnableCompressionInSingleFile>
</PropertyGroup>
<ItemGroup>

74
RELEASE_NOTES.md Normal file
View File

@@ -0,0 +1,74 @@
# NFC Actions v1.0.0 - Initial Release
## Features
### Core Functionality
- **System Tray Application** - Runs quietly in the background, accessible from the system tray
- **Real-time NFC Monitoring** - Automatically detects and monitors all PC/SC compatible NFC readers
- **Dynamic Reader Management** - Handles USB reader plug/unplug events automatically
- **NDEF Payload Extraction** - Supports Type 2 and Type 4 NFC tags with automatic block size detection
### Actions
- **Copy to Clipboard** - Copies NDEF payload data to clipboard for easy pasting
- **Launch URLs** - Opens URI records in your default browser (URL records only)
- **Keyboard Input** - Types NDEF content as keyboard input into active application
### User Interface
- **Configuration Window** - Clean, simple interface for managing readers and actions
- **Real-time Activity Log** - Color-coded logging (Debug, Info, Warning, Error) for visibility
- **Dangerous Things Branding** - Custom icons and clickable logo
### Technical Features
- **Settings Persistence** - Remembers your preferences between sessions
- **Auto-start on Login** - Automatically starts when you log in to Windows
- **File Logging** - Debug logs saved to application directory for troubleshooting
- **Single-file Deployment** - No .NET runtime installation required
## Installation
1. Download **NfcActions-Setup.msi** from the release assets
2. Run the installer
3. The application will:
- Install to `%LOCALAPPDATA%\DangerousThings\NFC Actions`
- Create a Start Menu shortcut
- Configure automatic startup on login
- Start running immediately in the system tray
## System Requirements
- **Operating System**: Windows 10 or Windows 11
- **Hardware**: PC/SC compatible NFC reader (USB or built-in)
- **Runtime**: None required (self-contained)
## Tested Readers
- Identiv uTrust 3700 F
- HID OMNIKEY 5022 CL
## Usage
1. **First Launch**: Click the tray icon to open the configuration window
2. **Enable/Disable Readers**: Check or uncheck readers in the "Active Readers" list
3. **Configure Actions**: Select which actions to perform when a card is detected
4. **Tap NFC Card**: Simply tap your NFC card to any enabled reader
5. **Monitor Activity**: Watch the activity log for real-time feedback
## Known Limitations
- Only the first NDEF record is processed (multiple records not supported yet)
- Only NDEF payload is used (not the full NDEF message structure)
- URI detection is limited to standard URI record types and identifier codes
## Support
- **Website**: https://dangerousthings.com
- **Repository**: https://git.dngr.us/DangerousThings/nfc-actions
- **Issues**: Report bugs via the repository issue tracker
## License
Copyright © 2025 Dangerous Things
---
**Built with Claude Code** - https://claude.com/claude-code

View File

@@ -70,8 +70,22 @@ if ($BuildInstaller) {
Push-Location $installerPath
# Run candle (compile)
& candle.exe Product.wxs -out obj\Product.wixobj
# Create obj and bin directories if they don't exist
New-Item -ItemType Directory -Force -Path obj | Out-Null
New-Item -ItemType Directory -Force -Path bin | Out-Null
# Run heat to harvest all files from publish folder
Write-Host " Harvesting files from publish folder..." -ForegroundColor Gray
& heat.exe dir $publishPath -cg HarvestedFiles -gg -sfrag -srd -dr INSTALLFOLDER -var var.PublishDir -out obj\HarvestedFiles.wxs
if ($LASTEXITCODE -ne 0) {
Pop-Location
Write-Host "Heat (file harvesting) failed!" -ForegroundColor Red
exit 1
}
# Run candle (compile) on both wxs files
Write-Host " Compiling installer..." -ForegroundColor Gray
& candle.exe Product.wxs obj\HarvestedFiles.wxs "-dPublishDir=$publishPath" -out obj\ -arch x64
if ($LASTEXITCODE -ne 0) {
Pop-Location
Write-Host "Candle (WiX compile) failed!" -ForegroundColor Red
@@ -79,7 +93,8 @@ if ($BuildInstaller) {
}
# Run light (link)
& light.exe obj\Product.wixobj -out bin\NfcActions-Setup.msi -ext WixUIExtension
Write-Host " Linking MSI package..." -ForegroundColor Gray
& light.exe obj\Product.wixobj obj\HarvestedFiles.wixobj -out bin\NfcActions-Setup.msi -ext WixUIExtension -sval
if ($LASTEXITCODE -ne 0) {
Pop-Location
Write-Host "Light (WiX link) failed!" -ForegroundColor Red