-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
44 lines (35 loc) · 1.63 KB
/
Copy pathinstall.ps1
File metadata and controls
44 lines (35 loc) · 1.63 KB
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
$ErrorActionPreference = "Stop"
$RepoUrl = "https://github.com/psycodess/hz-plugin/raw/main/hz-plugin.zip"
$TempZip = "$env:TEMP\hz-plugin.zip"
# 1. Determine Flow Launcher plugins folder
$flUserPath = "$env:APPDATA\FlowLauncher\Plugins"
$flPluginsPath = "$env:LOCALAPPDATA\FlowLauncher\Plugins"
$TargetDir = $null
if (Test-Path $flPluginsPath) { $TargetDir = $flPluginsPath }
elseif (Test-Path $flUserPath) { $TargetDir = $flUserPath }
if (-not $TargetDir) {
Write-Error "Flow Launcher plugins directory not found. Please ensure Flow Launcher is installed."
exit 1
}
$DestDir = "$TargetDir\hz-plugin"
# 2. Download ZIP
Write-Host "Downloading pre-packaged plugin from GitHub..." -ForegroundColor Cyan
Invoke-WebRequest -Uri $RepoUrl -OutFile $TempZip -UseBasicParsing
# 3. Extract ZIP directly to the destination directory
Write-Host "Installing to Flow Launcher..." -ForegroundColor Cyan
if (Test-Path $DestDir) { Remove-Item -Recurse -Force $DestDir }
New-Item -ItemType Directory -Path $DestDir -Force | Out-Null
Expand-Archive -Path $TempZip -DestinationPath $DestDir -Force
# 4. Clean up temp files
Remove-Item -Path $TempZip -Force
# 5. Check Python
try {
$pyVersion = python --version 2>&1
Write-Host "Python detected: $pyVersion" -ForegroundColor Green
} catch {
Write-Warning "Python is not installed or not in PATH! Please install Python from https://python.org to run this plugin."
}
Write-Host "=== Installation Successful! ===" -ForegroundColor Green
Write-Host "Please restart Flow Launcher and trigger with 'hz'." -ForegroundColor Yellow
# Open Instagram Profile
Start-Process "https://instagram.com/psychowhoqustionmark"