Files
TimeTracker/docs/FIX_SYMLINK_PERMISSIONS.md
Dries Peeters 3c433e2593 Add comprehensive documentation for build process and branding
- 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
2026-01-11 20:51:32 +01:00

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

  1. Press Win + I to open Windows Settings
  2. Go to Privacy & SecurityFor developers
  3. Turn on Developer Mode
  4. Restart your terminal/PowerShell
  5. 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

  1. Right-click PowerShell or Command Prompt
  2. Choose "Run as Administrator"
  3. 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):

  1. Enable Developer Mode (one-time setup)
  2. Clear cache:
    ./scripts/clear-all-electron-cache.sh
    
  3. Set environment variable:
    export CSC_IDENTITY_AUTO_DISCOVERY=false
    
  4. 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

  1. Enable Developer Mode in Windows (recommended - one-time)
  2. 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!