7373 name : ${{ matrix.artifact }}
7474 path : artifacts
7575
76+ - name : Download Windows x86 artifacts (bundled in x64 installer)
77+ if : matrix.target-arch == 'x64'
78+ uses : actions/download-artifact@v8
79+ with :
80+ name : windows-x86-binaries
81+ path : artifacts-x86
82+
7683 - name : Install WiX Toolset
7784 run : dotnet tool install --global wix --version 5.0.2
7885
@@ -84,12 +91,19 @@ jobs:
8491 $msiVersion = ($version -replace '-.*', '') + '.0'
8592 $dllPath = Resolve-Path "artifacts/FirebirdODBC.dll"
8693
94+ $extraArgs = @()
95+ if ('${{ matrix.target-arch }}' -eq 'x64') {
96+ $x86DllPath = Resolve-Path "artifacts-x86/FirebirdODBC.dll"
97+ $extraArgs = @('-d', "DriverPathX86=$x86DllPath")
98+ }
99+
87100 wix build `
88101 -d ProductVersion=$msiVersion `
89102 -d DriverPath="$dllPath" `
90103 -d Configuration=Release `
91104 -d TargetArch=${{ matrix.target-arch }} `
92105 -arch ${{ matrix.wix-arch }} `
106+ @extraArgs `
93107 -o "firebird-odbc-driver-$version-${{ matrix.suffix }}.msi" `
94108 installer/Product.wxs
95109
@@ -104,6 +118,13 @@ jobs:
104118 Copy-Item "artifacts/FirebirdODBC.lib" -Destination $packageDir -ErrorAction SilentlyContinue
105119 Copy-Item "README.md" -Destination $packageDir -ErrorAction SilentlyContinue
106120
121+ # x64 package also includes the 32-bit DLL for WoW64 applications
122+ if ('${{ matrix.target-arch }}' -eq 'x64') {
123+ $x86Dir = Join-Path $packageDir "x86"
124+ New-Item -ItemType Directory -Path $x86Dir -Force | Out-Null
125+ Copy-Item "artifacts-x86/FirebirdODBC.dll" -Destination $x86Dir
126+ }
127+
107128 Compress-Archive -Path "$packageDir/*" `
108129 -DestinationPath "firebird-odbc-driver-$version-${{ matrix.suffix }}.zip"
109130
@@ -114,6 +135,99 @@ jobs:
114135 firebird-odbc-driver-${{ needs.release.outputs.version }}-${{ matrix.suffix }}.msi
115136 firebird-odbc-driver-${{ needs.release.outputs.version }}-${{ matrix.suffix }}.zip
116137
138+ - name : Upload MSI as workflow artifact (for installer tests)
139+ uses : actions/upload-artifact@v7
140+ with :
141+ name : msi-${{ matrix.suffix }}
142+ path : firebird-odbc-driver-${{ needs.release.outputs.version }}-${{ matrix.suffix }}.msi
143+
144+ test-installer :
145+ needs : [package-windows]
146+ runs-on : windows-2022
147+
148+ strategy :
149+ matrix :
150+ include :
151+ - suffix : win-x64
152+ expect-x86 : true
153+ - suffix : win-x86
154+ expect-x86 : false
155+ # ARM64 MSI cannot be installed on x64 runners — skip
156+
157+ steps :
158+ - name : Download MSI
159+ uses : actions/download-artifact@v8
160+ with :
161+ name : msi-${{ matrix.suffix }}
162+ path : msi
163+
164+ - name : Find MSI file
165+ id : find-msi
166+ shell : pwsh
167+ run : |
168+ $msi = Get-ChildItem -Path msi -Filter '*.msi' -Recurse | Select-Object -First 1
169+ if (-not $msi) { throw "No MSI file found" }
170+ "msi_path=$($msi.FullName)" >> $env:GITHUB_OUTPUT
171+ Write-Host "Found MSI: $($msi.FullName)"
172+
173+ - name : Install MSI
174+ shell : pwsh
175+ run : |
176+ $proc = Start-Process msiexec.exe -ArgumentList "/i `"${{ steps.find-msi.outputs.msi_path }}`" /qn /l*v install.log" -Wait -PassThru
177+ if ($proc.ExitCode -ne 0) {
178+ Get-Content install.log -Tail 50
179+ throw "MSI install failed with exit code $($proc.ExitCode)"
180+ }
181+
182+ - name : Verify ODBC driver registration
183+ shell : pwsh
184+ run : |
185+ $driverName = 'Firebird ODBC Driver'
186+
187+ # Check 64-bit or 32-bit native registration
188+ $drivers = Get-OdbcDriver -Name $driverName -ErrorAction SilentlyContinue
189+ if (-not $drivers) {
190+ throw "ODBC driver '$driverName' not found after install"
191+ }
192+ Write-Host "Found ODBC drivers:"
193+ $drivers | Format-Table -AutoSize
194+
195+ # For x64 installer, verify both 64-bit and 32-bit registrations
196+ if ('${{ matrix.expect-x86 }}' -eq 'true') {
197+ $reg64 = Test-Path "HKLM:\SOFTWARE\ODBC\ODBCINST.INI\$driverName"
198+ $reg32 = Test-Path "HKLM:\SOFTWARE\WOW6432Node\ODBC\ODBCINST.INI\$driverName"
199+
200+ if (-not $reg64) { throw "64-bit ODBC registration missing" }
201+ if (-not $reg32) { throw "32-bit (WOW6432Node) ODBC registration missing" }
202+
203+ $dll64 = Join-Path $env:SystemRoot 'System32' 'FirebirdODBC.dll'
204+ $dll32 = Join-Path $env:SystemRoot 'SysWOW64' 'FirebirdODBC.dll'
205+
206+ if (-not (Test-Path $dll64)) { throw "64-bit DLL missing: $dll64" }
207+ if (-not (Test-Path $dll32)) { throw "32-bit DLL missing: $dll32" }
208+
209+ Write-Host "PASS: Both 64-bit and 32-bit drivers installed correctly"
210+ }
211+
212+ - name : Uninstall MSI
213+ shell : pwsh
214+ run : |
215+ $proc = Start-Process msiexec.exe -ArgumentList "/x `"${{ steps.find-msi.outputs.msi_path }}`" /qn /l*v uninstall.log" -Wait -PassThru
216+ if ($proc.ExitCode -ne 0) {
217+ Get-Content uninstall.log -Tail 50
218+ throw "MSI uninstall failed with exit code $($proc.ExitCode)"
219+ }
220+
221+ - name : Verify clean uninstall
222+ shell : pwsh
223+ run : |
224+ $driverName = 'Firebird ODBC Driver'
225+ $drivers = Get-OdbcDriver -Name $driverName -ErrorAction SilentlyContinue
226+ if ($drivers) {
227+ throw "ODBC driver '$driverName' still registered after uninstall"
228+ }
229+ Write-Host "PASS: Driver cleanly uninstalled"
230+
117231 package-linux :
118232 needs : [build-and-test, release]
119233 runs-on : ubuntu-latest
0 commit comments