# Set-OpenTextToolbar.ps1 - replace the HostExplorer default VT toolbar. # # Copies the toolbar shipped in this share over the local one at: # C:\ProgramData\Hummingbird\Connectivity\15.00\Shared\HostExplorer\Toolbar\ # # Runs from the common manifest with DetectionMethod Always, so it also # self-heals if the file is changed locally. # # Deliberately does NOT bump the OpenText version. Setup-OpenText.ps1 skips # unless HKLM:\SOFTWARE\GE\OpenText\Installed differs from version.txt, so a # bump re-runs the whole thing - MSI plus the SP1 patch - on every OpenText # machine over SMB, to ship a 565-byte file. This entry copies just the file. $ErrorActionPreference = 'Continue' $fileName = 'Default VT Toolbar.tbv' $src = Join-Path $PSScriptRoot "..\apps\opentext\HostExplorer\Toolbar\$fileName" $dstDir = 'C:\ProgramData\Hummingbird\Connectivity\15.00\Shared\HostExplorer\Toolbar' $dst = Join-Path $dstDir $fileName Write-Host '=== OpenText VT toolbar ===' if (-not (Test-Path -LiteralPath $src)) { Write-Host " source missing on share: $src - nothing to do." return } # Gate on OpenText actually being installed. The Shared root only exists once # HostExplorer content has been deployed, so its absence means this machine has # no OpenText and we should not create a stray Hummingbird tree. $sharedRoot = 'C:\ProgramData\Hummingbird\Connectivity\15.00\Shared' if (-not (Test-Path -LiteralPath $sharedRoot)) { Write-Host ' OpenText not installed on this PC - skipping.' return } # Skip when identical, so an Always entry is not rewriting the file every cycle. if (Test-Path -LiteralPath $dst) { $sh = (Get-FileHash -LiteralPath $src -Algorithm SHA256).Hash $dh = (Get-FileHash -LiteralPath $dst -Algorithm SHA256).Hash if ($sh -eq $dh) { Write-Host ' already current - no change.' return } Write-Host ' local copy differs - replacing.' } else { Write-Host ' not present locally - installing.' } try { if (-not (Test-Path -LiteralPath $dstDir)) { New-Item -ItemType Directory -Path $dstDir -Force -ErrorAction Stop | Out-Null } Copy-Item -LiteralPath $src -Destination $dst -Force -ErrorAction Stop Write-Host " replaced $dst" } catch { Write-Warning " failed to replace ${dst}: $_" }