- Add build troubleshooting and Windows-specific guides - Document branding guidelines and asset management - Add desktop build configuration documentation - Include symlink and OneDrive fix guides - Add code signing and permissions documentation - Document quick start guides for various scenarios
3.3 KiB
Fix Symbolic Link Permission Error
Problem
electron-builder is still downloading winCodeSign tools even with forceCodeSigning: false, causing symbolic link errors on Windows.
Error:
ERROR: Cannot create symbolic link : Een van de vereiste bevoegdheden is niet aan de client toegekend.
Root Cause
Even though code signing is disabled, electron-builder may still attempt to download code signing tools. The winCodeSign archive contains macOS files that use symbolic links, which Windows cannot create without special permissions.
Solutions
Solution 1: Enable Developer Mode (Recommended - One Time)
- Press
Win + Ito open Windows Settings - Go to Privacy & Security → For developers
- Turn on Developer Mode
- Restart your terminal/PowerShell
- Try building again
This is a one-time setting that allows creating symbolic links without administrator privileges.
Solution 2: Clear Cache Before Building
Run this script to clear all electron-builder cache:
./scripts/clear-all-electron-cache.sh
Or manually:
# In Git Bash or WSL
rm -rf "$LOCALAPPDATA/electron-builder/Cache/winCodeSign"
# Or
rm -rf "$HOME/AppData/Local/electron-builder/Cache/winCodeSign"
Then build again.
Solution 3: Run as Administrator
- Right-click PowerShell or Command Prompt
- Choose "Run as Administrator"
- Navigate to project and build:
cd C:\Users\dries\OneDrive\Dokumente\GitHub\TimeTracker scripts\build-desktop-simple.bat
Solution 4: Use Environment Variable
Set an environment variable to skip code signing completely:
Before building, run:
set CSC_IDENTITY_AUTO_DISCOVERY=false
scripts\build-desktop-simple.bat
Or in PowerShell:
$env:CSC_IDENTITY_AUTO_DISCOVERY="false"
.\scripts\build-desktop-windows.ps1
Or in Git Bash:
export CSC_IDENTITY_AUTO_DISCOVERY=false
./scripts/build-desktop.sh
Solution 5: Configure electron-builder to Skip Code Signing
The configuration in desktop/package.json has been updated to:
"win": {
"sign": null,
"signingHashAlgorithms": null,
"signDlls": false
}
But electron-builder may still download tools. Use Solution 4 (environment variable) to ensure it's completely disabled.
Quick Fix
Best approach (combine multiple solutions):
- Enable Developer Mode (one-time setup)
- Clear cache:
./scripts/clear-all-electron-cache.sh - Set environment variable:
export CSC_IDENTITY_AUTO_DISCOVERY=false - Build:
./scripts/build-desktop.sh
Why This Happens
- electron-builder downloads winCodeSign tools even when code signing is disabled
- These tools contain macOS files (darwin/) with symbolic links
- Windows needs special permissions (Developer Mode or Administrator) to create symlinks
- Even if code signing is disabled, the download still happens
Permanent Fix
- Enable Developer Mode in Windows (recommended - one-time)
- Set environment variable in your shell profile:
# Add to ~/.bashrc or ~/.zshrc export CSC_IDENTITY_AUTO_DISCOVERY=false
Or for PowerShell:
# Add to $PROFILE
$env:CSC_IDENTITY_AUTO_DISCOVERY="false"
Remember: The easiest fix is to enable Developer Mode in Windows Settings!