
$content = @"
Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\.vpy]

[-HKEY_CLASSES_ROOT\AVIFile\Extensions\VPY]

[-HKEY_CLASSES_ROOT\CLSID\{58F74CA0-BD0E-4664-A49B-8D10E6F0C131}]

[-HKEY_CLASSES_ROOT\Media Type\Extensions\.vpy]

[-HKEY_CLASSES_ROOT\vpyfile\DefaultIcon]

[-HKEY_CLASSES_ROOT\vpyfile]

"@

# delete reg keys
$path = Join-Path $env:TEMP Uninstall-VapourSynth.reg
$content > $path
Start-Process $path -Wait
Remove-Item $path

# remove from PATH
$path = [Environment]::GetEnvironmentVariable('Path', 'User')
$dir = $PSScriptRoot + '\..\VapourSynth'
$dir = Convert-Path $dir

if ($path.Contains($dir)) {
    $path = $path.Replace($dir, '')
    $path = $path.Replace(';;', ';')
    $path = $path.TrimEnd(';')
    [Environment]::SetEnvironmentVariable('Path', $path, 'User')
}
