• Source
    1. @echo off
    2. setlocal
    3.  
    4. REM Set the current directory
    5. set "INSTALL_DIR=%~dp0"
    6.  
    7. REM Install CMake in C:\Program Files\CMake
    8. echo Installing CMake...
    9. start /wait msiexec /i "%INSTALL_DIR%cmake-4.0.0-rc3-windows-x86_64.msi" /quiet /norestart INSTALLDIR="C:\Program Files\CMake"
    10.  
    11. REM Install .NET SDK
    12. echo Installing .NET SDK...
    13. start /wait "" "%INSTALL_DIR%dotnet-sdk-6.0.421-win-x64.exe" /quiet /norestart
    14.  
    15. REM Install Python
    16. echo Installing Python...
    17. start /wait "" "%INSTALL_DIR%python-3.10.5-amd64.exe" /quiet InstallAllUsers=1 PrependPath=1
    18.  
    19. REM Install VC Redistributable
    20. echo Installing VC Redistributable...
    21. start /wait "" "%INSTALL_DIR%vc_redist.x64.exe" /quiet /norestart
    22.  
    23. REM Pause for installation completion
    24. echo Waiting for installations to finish...
    25. timeout /t 10
    26.  
    27. REM Find Python path and add it to the system PATH
    28. echo Adding Python to PATH...
    29. for /f "delims=" %%A in ('where python') do set "PYTHON_PATH=%%A"
    30. for %%A in ("%PYTHON_PATH%") do set "PYTHON_DIR=%%~dpA"
    31. setx PATH "%PYTHON_DIR%;%PATH%" /M
    32.  
    33. REM Find CMake path dynamically and add it to PATH
    34. echo Adding CMake to PATH...
    35. for /f "delims=" %%A in ('where cmake') do set "CMAKE_PATH=%%A"
    36. for %%A in ("%CMAKE_PATH%") do set "CMAKE_DIR=%%~dpA"
    37. setx PATH "%CMAKE_DIR%;%PATH%" /M
    38.  
    39. REM Activate virtual environment
    40. echo Activating virtual environment...
    41. call venv\Scripts\activate.bat
    42.  
    43. REM Run PyInstaller
    44. echo Building project with PyInstaller...
    45. pyinstaller main.spec
    46.  
    47. echo Process complete!
    48. pause
    49.