diff --git a/scripts/install_unilab.bat b/scripts/install_unilab.bat index 3c4026af..711c6585 100644 --- a/scripts/install_unilab.bat +++ b/scripts/install_unilab.bat @@ -161,6 +161,28 @@ if errorlevel 1 ( exit /b 1 ) +echo. +echo Checking UniLabOS entry point... +REM Check if unilab-script.py exists +set "UNILAB_SCRIPT=%ENV_PATH%\Scripts\unilab-script.py" +if not exist "%UNILAB_SCRIPT%" ( + echo WARNING: unilab-script.py not found, creating it... + ( + echo # -*- coding: utf-8 -*- + echo import re + echo import sys + echo. + echo from unilabos.app.main import main + echo. + echo if __name__ == '__main__': + echo sys.argv[0] = re.sub^(r'(-script\.pyw?^|\.exe^)?$', '', sys.argv[0]^) + echo sys.exit^(main^(^)^) + ) > "%UNILAB_SCRIPT%" + echo Created: %UNILAB_SCRIPT% +) else ( + echo Found: %UNILAB_SCRIPT% +) + echo. echo ================================================ echo Installation completed successfully! diff --git a/scripts/install_unilab.sh b/scripts/install_unilab.sh index b12d972e..85582eff 100755 --- a/scripts/install_unilab.sh +++ b/scripts/install_unilab.sh @@ -96,6 +96,30 @@ else exit 1 fi +echo "" +echo "Checking UniLabOS entry point..." +# Check if unilab script exists in bin directory +UNILAB_SCRIPT="$ENV_PATH/bin/unilab" +if [ ! -f "$UNILAB_SCRIPT" ]; then + echo "WARNING: unilab script not found, creating it..." + cat > "$UNILAB_SCRIPT" << 'EOF' +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import re +import sys + +from unilabos.app.main import main + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) +EOF + chmod +x "$UNILAB_SCRIPT" + echo "Created: $UNILAB_SCRIPT" +else + echo "Found: $UNILAB_SCRIPT" +fi + echo "" echo "================================================" echo "Installation completed successfully!"