-
Notifications
You must be signed in to change notification settings - Fork 55
/
install_with_launcher.ps1
57 lines (49 loc) · 1.17 KB
/
install_with_launcher.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Change Working Directory
Set-Location $PSScriptRoot
# Check whether Pylauncher is installed
$list = (py --list 2> $null)
if(!$?){
Write-Error "Pytheon launcher failed."
Pause
exit
}
# Check minor version of Python
$requiredMinorVersion = "3\.10"
if(!($list -match $requiredMinorVersion)){
Write-Error -Message "Python 3.10 is not found. Please install Python 3.10.x later than 3.10.8"
Pause
exit
}
# Check micro version of Python
$requiredMicroVersion = "3\.10\.(8|9|([1-7]\d))"
$pyVersion = py -3.10 --version
if(!($pyVersion -match $requiredMicroVersion)){
Write-Error "Installed Python 3.10 is too old to install layerdivider. Please upgrade your Python 3.10"
Pause
exit
}
# Create venv folder
if (!(Test-Path -Path "venv")) {
Write-Output "Creating venv for python..."
py -3.10 -m venv venv
if(!$?){
Pause
exit
}
}
.\venv\Scripts\activate
if(!$?){
Pause
exit
}
# Install dependent packages
Write-Output "Installing deps..."
pip install --upgrade -r requirements.txt
if(!$?){
Write-Error "`"pip install --upgrade -r requirements.txt
`" failed."
Pause
exit
}
Write-Output "Install completed."
Pause