-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.ps1
59 lines (47 loc) · 1.6 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
#!/usr/bin/env pwsh
# $args[0] = -y
# $args[1] = installation path from root
# $args[2] = silent mode (true/false)
$confirm = $args[0]
If( $args[1] -eq $null )
{
$path2out = "toolchain"
} # specify path to install programs
Else
{
$path2out = $args[1]
}
$silent = $args[2]
$Documents = [Environment]::GetFolderPath('MyDocuments')
New-Item $Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 -type file -ErrorAction SilentlyContinue
Set-Variable -Name "PROFILE" -Value "$Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1"
. "$PROFILE"
$project = "Blender Graph Viewer"
$log = "install_$project.log"
# For the right Permission
# Set-ExecutionPolicy Bypass -Scope CurrentUser
Write-Host "Installing $project dependecies:" -ForegroundColor Yellow
Write-Host " - Blender (networkx, pandas, matplotlib and numpy)"
. ".\shut\pwsh\install_blender.ps1"
Write-Host "Installation path : $env:HOMEDRIVE$env:HOMEPATH\$path2out" -ForegroundColor Green
Push-Location
Set-Location $env:HOMEDRIVE$env:HOMEPATH > $null
New-Item -Path $path2out -ItemType directory -Force > $null
New-Item -Path $Documents\WindowsPowerShell -ItemType directory -Force > $null
Set-Location $path2out
Write-Host "Looking for packages..."
Remove-Item $log -Force -Recurse -ErrorAction SilentlyContinue
# Blender Installer
Write-Host "Installation Blender"
if ( $silent )
{
Start-Transcript -Append -Path $log
}
install_blender -add2path $true -confirm $confirm -modules networkx, pandas, matplotlib, numpy
if ( $silent )
{
Stop-Transcript
}
. "$PROFILE"
Pop-Location > $null
exit 0