-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
32 lines (27 loc) · 906 Bytes
/
install.ps1
File metadata and controls
32 lines (27 loc) · 906 Bytes
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
# Enable error handling
$ErrorActionPreference = "Stop"
# Relaunch as admin if not elevated
if (-not ([Security.Principal.WindowsPrincipal] `
[Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
[Security.Principal.WindowsBuiltInRole] "Administrator"))
{
Start-Process powershell "-File `"$PSCommandPath`"" -Verb RunAs
exit
}
$ccPython = "C:\Program Files\CloudCompare\plugins\Python\python.exe"
Write-Host "Installing cloud_compare_python_plugin..." -ForegroundColor Cyan
try {
& $ccPython -m pip install $PSScriptRoot/. --break-system-packages
}
catch {
Write-Host "ERROR OCCURRED:" -ForegroundColor Red
Write-Host $_.Exception.Message -ForegroundColor Yellow
Write-Host ""
Write-Host "Press Enter to close..."
Read-Host
exit 1
}
Write-Host "Installation complete."
Write-Host ""
Write-Host "Press Enter to close..." -ForegroundColor Cyan
Read-Host