- Enhanced detectAutoBuildSourcePath() to work across all platforms - Separated dev vs production mode path resolution - Added comprehensive path checking for Windows/Linux packaged apps - Added debug logging (enable with AUTO_CLAUDE_DEBUG=1) - Updated both settings-handlers.ts and project-handlers.ts - Fixes 'Source path not configured' error on Windows/Linux 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
4.9 KiB
Windows/Linux Source Path Detection Fix
Problem
On Windows and Linux, when initializing a project, users were getting a "Source path not configured" error even though the auto-claude source directory exists. This error did not occur on macOS.
Root Cause
The detectAutoBuildSourcePath() function in two files was using path resolution logic that worked on macOS in development mode but failed on Windows/Linux, especially in production/packaged builds. The function was trying to auto-detect where the Auto Claude framework source code (auto-claude/ directory) is located, but the paths resolved differently across platforms.
Changes Made
1. Enhanced Path Detection Logic
Updated detectAutoBuildSourcePath() in two files:
auto-claude-ui/src/main/ipc-handlers/settings-handlers.tsauto-claude-ui/src/main/ipc-handlers/project-handlers.ts
Key improvements:
-
Platform-aware path detection: Separates development vs production mode using
is.devfrom@electron-toolkit/utils -
More comprehensive path checking:
- Development mode: Checks multiple relative paths from
__dirname,process.cwd(), and parent directories - Production mode: Checks paths relative to
app.getAppPath(),process.resourcesPath, and multiple levels up
- Development mode: Checks multiple relative paths from
-
Debug logging: Added detailed logging that can be enabled with
AUTO_CLAUDE_DEBUG=1environment variable -
Better error messages: Console warnings now guide users to enable debug mode if auto-detection fails
Testing on Windows/Linux
1. Run with Debug Logging
Set the environment variable to see detailed path checking:
Windows (PowerShell):
$env:AUTO_CLAUDE_DEBUG="1"
.\Auto-Claude.exe
Windows (Command Prompt):
set AUTO_CLAUDE_DEBUG=1
Auto-Claude.exe
Linux:
AUTO_CLAUDE_DEBUG=1 ./Auto-Claude
2. Check Console Output
The debug output will show:
- Current platform (win32/linux/darwin)
- Whether running in dev or production mode
- All paths being checked
- Which paths exist and which don't
- Whether auto-detection succeeded
Example debug output:
[detectAutoBuildSourcePath] Platform: win32
[detectAutoBuildSourcePath] Is dev: false
[detectAutoBuildSourcePath] __dirname: C:\Program Files\Auto-Claude\resources\app.asar\out\main
[detectAutoBuildSourcePath] app.getAppPath(): C:\Program Files\Auto-Claude\resources\app.asar
[detectAutoBuildSourcePath] process.cwd(): C:\Program Files\Auto-Claude
[detectAutoBuildSourcePath] Checking paths: [...]
[detectAutoBuildSourcePath] Checking C:\Program Files\auto-claude: ✗ not found
[detectAutoBuildSourcePath] Checking C:\auto-claude: ✓ FOUND
[detectAutoBuildSourcePath] Auto-detected source path: C:\auto-claude
3. Manual Configuration (Fallback)
If auto-detection still fails, users can manually configure the path:
- Open App Settings in Auto Claude UI
- Go to the General tab
- Set Auto Claude Source Path to the location of your
auto-claudedirectory - Click Save
Example paths:
- Windows:
C:\Users\YourName\Projects\autonomous-coding\auto-claude - Linux:
/home/yourname/projects/autonomous-coding/auto-claude
What Gets Checked
The function now checks these paths in order:
Development Mode (is.dev = true):
__dirname/../../../auto-claude- From out/main up 3 levels__dirname/../../auto-claude- From out/main up 2 levelsprocess.cwd()/auto-claude- From current working directoryprocess.cwd()/../auto-claude- From parent of cwd
Production Mode (is.dev = false):
app.getAppPath()/../auto-claude- Sibling to appapp.getAppPath()/../../auto-claude- Up 2 from appapp.getAppPath()/../../../auto-claude- Up 3 from appprocess.resourcesPath/../auto-claude- Relative to resourcesprocess.resourcesPath/../../auto-claude- Up 2 from resources
All Modes:
process.cwd()/auto-claude- Last resort fallback
Verification
For each path, the function checks:
- Does the directory exist?
- Does
VERSIONfile exist inside it?
Both must be true for a path to be considered valid.
Build Verification
The changes have been compiled and tested:
✓ Built successfully with no errors
✓ All TypeScript files compiled
✓ Electron app bundle created
Next Steps
- Test on Windows: Have Windows users test the updated build with
AUTO_CLAUDE_DEBUG=1 - Test on Linux: Have Linux users test the updated build with
AUTO_CLAUDE_DEBUG=1 - Collect feedback: If issues persist, the debug output will help identify the correct path patterns
- Update documentation: Add troubleshooting section to main README if needed
Related Files
auto-claude-ui/src/main/ipc-handlers/settings-handlers.tsauto-claude-ui/src/main/ipc-handlers/project-handlers.tsauto-claude-ui/src/main/project-initializer.tsauto-claude-ui/src/renderer/App.tsx(shows the error dialog)auto-claude-ui/src/renderer/components/Sidebar.tsx(shows the error dialog)