File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,10 @@ Invoke-WebRequest -Uri $asset.browser_download_url -OutFile $tmpPath -UseBasicPa
4545if (Test-Path - LiteralPath $dllPath ) {
4646 Write-Host " Unregistering existing DLL..." - ForegroundColor Yellow
4747 try {
48- & regsvr32.exe / s / u $dllPath
48+ $unregProcess = Start-Process - FilePath " regsvr32.exe" - ArgumentList " /s" , " /u" , " `" $dllPath `" " - Wait - PassThru - NoNewWindow
49+ if ($unregProcess.ExitCode -ne 0 ) {
50+ Write-Warning " Failed to unregister old DLL. Exit code: $ ( $unregProcess.ExitCode ) "
51+ }
4952 } catch {
5053 Write-Warning " Failed to unregister old DLL: $ ( $_.Exception.Message ) "
5154 }
@@ -61,9 +64,9 @@ if (!(Test-Path -LiteralPath $dllPath)) {
6164
6265# Register the COM DLL
6366Write-Host " Registering COM DLL with Windows..." - ForegroundColor Yellow
64- $regResult = & regsvr32.exe / s $dllPath
65- if ($LASTEXITCODE -ne 0 ) {
66- throw " Failed to register DLL. regsvr32 returned exit code: $LASTEXITCODE "
67+ $regProcess = Start-Process - FilePath " regsvr32.exe" - ArgumentList " /s " , " `" $dllPath `" " - Wait - PassThru - NoNewWindow
68+ if ($regProcess .ExitCode -ne 0 ) {
69+ throw " Failed to register DLL. regsvr32 returned exit code: $ ( $regProcess .ExitCode ) "
6770}
6871
6972Write-Host " Successfully installed and registered ltk-tex-thumb-handler $version " - ForegroundColor Green
You can’t perform that action at this time.
0 commit comments