forked from gavanderhoorn/rossum
-
Notifications
You must be signed in to change notification settings - Fork 3
/
install.ps1
72 lines (52 loc) · 1.85 KB
/
install.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
function ktransw_install {
Write-Output "Installing ktransw ..."
#install python dependencies
pip3 install -r .\deps\ktransw\requirements.txt
#add ktransw to path
$global:NEWPATH = $global:NEWPATH + ";$PSScriptRoot\deps\ktransw\bin;$PSScriptRoot\deps\ktransw\deps\gpp"
Write-Output "Added to Path: $PSScriptRoot\deps\ktransw\bin"
Write-Output "Added to Path: $PSScriptRoot\deps\ktransw\deps\gpp"
}
function yaml_install {
Write-Output "Installing yamljson2xml ..."
cd "$PSScriptRoot\deps\yamljson2xml"
python -m pip install .
cd "$PSScriptRoot"
#add ktransw to path
$global:NEWPATH = $global:NEWPATH + ";$PSScriptRoot\deps\yamljson2xml\src"
Write-Output "Added to Path: $PSScriptRoot\deps\yamljson2xml\src"
}
function rossum_install {
Write-Output "Installing rossum ..."
#install python dependencies
pip3 install -r requirements.txt
#add ktransw to path
$global:NEWPATH = $global:NEWPATH + ";$PSScriptRoot\bin"
Write-Output "Added to Path: $PSScriptRoot\bin"
#add environment variables
[Environment]::SetEnvironmentVariable("ROSSUM_CORE_VERSION", "V910-1", "User");
[Environment]::SetEnvironmentVariable("ROSSUM_PKG_PATH", "", "User");
[Environment]::SetEnvironmentVariable("ROSSUM_SERVER_IP", "127.0.0.1", "User");
}
#python environment
$penv=$args[0]
if ($penv) {
$pactivate = $penv + "\Scripts\Activate.ps1"
Write-Output $pactivate
Invoke-Expression -Command $pactivate
}
#get environment path
$OLDPATH = [System.Environment]::GetEnvironmentVariable('PATH','User')
$global:NEWPATH = $OLDPATH
#run ktransw install
ktransw_install
#run yamljson2xml install
yaml_install
#run rossum install
rossum_install
#set Path
[Environment]::SetEnvironmentVariable("PATH", "$global:NEWPATH", "User")
if ($penv) {
$pdeactivate = $penv + "\Scripts\deactivate"
deactivate
}