Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Simple Environment Check in Windows Installer #462

Open
Fran5ois opened this issue Dec 11, 2024 · 1 comment
Open

Suggestion: Simple Environment Check in Windows Installer #462

Fran5ois opened this issue Dec 11, 2024 · 1 comment

Comments

@Fran5ois
Copy link

Fran5ois commented Dec 11, 2024

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):

@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.

@Fran5ois
Copy link
Author

Quick note about the script: I've shared the test version rather than a permanent installation script because it's safer for testing. This script:

  • Backs up your original PATH
  • Tests the installation in an isolated directory
  • Restores your PATH after testing
  • Lets you verify everything works before making permanent changes

Once you confirm the installation works with this test script, you can run the installer normally for a permanent setup. This way, you can safely verify the installation without committing to system changes right away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant