From 2fdc76daaa08605307bd0accfe0d545b5e321a51 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Sat, 11 Feb 2023 09:30:18 -0800 Subject: [PATCH] windows: use python version on py.exe launcher --- docker/install-scrypted-dependencies-win.ps1 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docker/install-scrypted-dependencies-win.ps1 b/docker/install-scrypted-dependencies-win.ps1 index b5c155a53..7e830f98e 100644 --- a/docker/install-scrypted-dependencies-win.ps1 +++ b/docker/install-scrypted-dependencies-win.ps1 @@ -12,12 +12,15 @@ choco upgrade -y nodejs-lts --version=18.14.0 # Install Python choco upgrade -y python39 +# Run py.exe with a specific version +$SCRYPTED_WINDOWS_PYTHON_VERSION="-3.9" # Refresh environment variables for py and npx to work $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") -py -m pip install --upgrade pip -py -m pip install aiofiles debugpy typing_extensions typing opencv-python + +py $SCRYPTED_WINDOWS_PYTHON_VERSION -m pip install --upgrade pip +py $SCRYPTED_WINDOWS_PYTHON_VERSION -m pip install aiofiles debugpy typing_extensions typing opencv-python npx -y scrypted@latest install-server @@ -57,6 +60,10 @@ const svc = new Service({ name: "USERPROFILE", value: '$($USER_HOME_ESCAPED)' }, + { + name: "SCRYPTED_WINDOWS_PYTHON_VERSION", + value: '$($SCRYPTED_WINDOWS_PYTHON_VERSION)' + } ] }); svc.logOnAs.domain = '$($env:COMPUTERNAME)';