lightsystemdarkgreen
current commit
221216.14 · vulkan@1.3.231.1: Add registry notes and cleanup (Fix #4218) (#4222)
if ($global -and (-not $is_admin)) {
    Write-Host "ERROR write registries for global installation needs admin rights!" -ForegroundColor DarkRed
    exit 1
}

$reg_root = if ($global) { [Microsoft.Win32.Registry]::LocalMachine } else { [Microsoft.Win32.Registry]::CurrentUser }
$vk_explicit_reg_path = 'SOFTWARE\Khronos\Vulkan\ExplicitLayers'
$vk_explicit_reg = $reg_root.CreateSubKey($vk_explicit_reg_path)

$vk_layers = Get-ChildItem -Path $vulkan_bin -Filter '*.json' | ForEach-Object { $_.FullName }
foreach ($vk_layer in $vk_layers) {
    $vk_explicit_reg.SetValue($vk_layer, 0, [Microsoft.Win32.RegistryValueKind]::DWord)
}

$vk_explicit_reg.Close()