fix: mount HKCR PSDrive before PDF association writes
All checks were successful
release / build-and-release (push) Successful in 25s
All checks were successful
release / build-and-release (push) Successful in 25s
HKCR: is not available by default in PS sessions - must be explicitly mounted via New-PSDrive before any registry operations on it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
7e6095d1bd
commit
3991e7a6d0
1 changed files with 5 additions and 0 deletions
|
|
@ -142,6 +142,11 @@ if (Get-Feature $Config "software" "pdfDefault") {
|
||||||
} else {
|
} else {
|
||||||
Write-Log " Found: $acroExe" -Level INFO
|
Write-Log " Found: $acroExe" -Level INFO
|
||||||
|
|
||||||
|
# Mount HKCR PSDrive - not available by default in PS sessions
|
||||||
|
if (-not (Get-PSDrive -Name HKCR -ErrorAction SilentlyContinue)) {
|
||||||
|
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
|
||||||
|
}
|
||||||
|
|
||||||
# Set file type association via HKCR (system-wide, requires admin)
|
# Set file type association via HKCR (system-wide, requires admin)
|
||||||
$progId = "AcroExch.Document.DC"
|
$progId = "AcroExch.Document.DC"
|
||||||
$openCmd = "`"$acroExe`" `"%1`""
|
$openCmd = "`"$acroExe`" `"%1`""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue