update installation instructions and add mpv handler setup script

This commit is contained in:
2026-04-18 18:12:17 -07:00
parent 0bd3bff92d
commit 3bd335cfb5
9 changed files with 982 additions and 413 deletions
+29 -1
View File
@@ -129,6 +129,29 @@ function Get-MpvPathFromConfig {
}
}
function Resolve-CommandPath {
param(
[Parameter(Mandatory = $true)]
[string[]]$Names
)
foreach ($name in $Names) {
try {
$command = Get-Command -Name $name -ErrorAction Stop
if ($command.Path) {
return $command.Path
}
if ($command.Source) {
return $command.Source
}
} catch {
}
}
return $null
}
function Remove-ProtocolKey {
param(
[Parameter(Mandatory = $true)]
@@ -204,7 +227,12 @@ $effectiveIconPath = if ($IconPath) {
}
(Resolve-Path -LiteralPath $IconPath).Path
} else {
Get-MpvPathFromConfig -ConfigPath $configPath
$configuredPath = Get-MpvPathFromConfig -ConfigPath $configPath
if ($configuredPath) {
$configuredPath
} else {
Resolve-CommandPath -Names @('mpv.com', 'mpv.exe', 'mpv')
}
}
if (-not $effectiveIconPath) {