-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.ps1
More file actions
31 lines (25 loc) · 989 Bytes
/
setup.ps1
File metadata and controls
31 lines (25 loc) · 989 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
<#
QuickPaths Online Installer
Usage: irm https://raw.githubusercontent.com/Sebastilan/QuickPaths/master/setup.ps1 | iex
#>
Add-Type -AssemblyName PresentationFramework
$installDir = Join-Path $env:LOCALAPPDATA 'QuickPaths'
$exeUrl = 'https://github.com/Sebastilan/QuickPaths/releases/latest/download/QuickPaths.exe'
$exePath = Join-Path $installDir 'QuickPaths.exe'
try {
# Create install dir
if (-not (Test-Path $installDir)) {
New-Item -ItemType Directory -Path $installDir -Force | Out-Null
}
# Download exe
Write-Host 'Downloading QuickPaths.exe...'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri $exeUrl -OutFile $exePath -UseBasicParsing
Write-Host "Downloaded to: $installDir"
# Run install
& $exePath --install
} catch {
[System.Windows.MessageBox]::Show(
"Installation failed:`n$($_.Exception.Message)",
'QuickPaths Setup', 'OK', 'Error')
}