Suggestion: Simple Environment Check in Windows Installer
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 210
- PR merge metrics
- No merged PRs in 30d
Description
Hi CQ-editor team,
I'm a noob (as in "eager mechanical engineer and OpenSCAD user with no background in software development") assisted by Cascade (an AI assistant) and I encountered a situation with the Windows installer that I thought might be worth sharing.
**Issue:**
When I first ran the installer, it somehow picked up an old CadQuery 0.2.1 version instead of 2.4.0. Apparently existing Python/CadQuery installations were affecting the installation process. Maybe because I ran an old installer in the first place?
**What Helped:**
After succeeding with a Conda install (after many trials and errors and help from Cascade) I came back to the windows installer to see what was wrong and running it in a clean environment (thanks to a script Cascade created for me) solved the issue. The installer then worked perfectly, installing the correct versions.
**Suggestion:**
Would it be helpful to add an environment check to the installer? Maybe just a simple warning if it detects existing installations that might interfere?
Here is the script created by Cascade to run the installer in a clean environment, but I'm not sure if it will be useful to you as I'm quite new to this (to be saved as a .bat file):
```batch
@echo off
setlocal EnableDelayedExpansion
REM Save current PATH
set "ORIGINAL_PATH=%PATH%"
REM Create test directory
set "TEST_DIR=C:\CQ_Editor_Test"
if not exist "%TEST_DIR%" mkdir "%TEST_DIR%"
REM Copy installer to test directory
copy "contributing on CQ-editor Github\CQ-editor-master-Windows-x86_64.exe" "%TEST_DIR%"
REM Save current datetime for log
for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /value') do set datetime=%%I
set "LOGFILE=%TEST_DIR%\install_log_%datetime:~0,8%_%datetime:~8,6%.txt"
echo Testing CQ-editor installer > "%LOGFILE%"
echo Test started at: %date% %time% >> "%LOGFILE%"
echo Original PATH: %ORIGINAL_PATH% >> "%LOGFILE%"
REM Run installer
echo Running installer...
start /wait "" "%TEST_DIR%\CQ-editor-master-Windows-x86_64.exe"
REM Log post-installation PATH
echo. >> "%LOGFILE%"
echo Post-installation PATH: >> "%LOGFILE%"
echo %PATH% >> "%LOGFILE%"
REM Restore original PATH
set "PATH=%ORIGINAL_PATH%"
echo Test completed. Check %LOGFILE% for details.
echo Your original PATH has been restored.
pause
```
Note: You'll need to modify the installer path in the script to match where your CQ-editor installer is located on your system.
Thank you for creating such a great tool for the CAD community! I am so glad to finally be able to work with CadQuery after months of just reading the docs ^^U and quite a long journey to find my way to a working CQ-editor.
Please let me know if this contribution is worth at all, or if I could do better. I'll be more than happy to help.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.