Skip to content

Commit 738233c

Browse files
committed
x64 installer bundles both 64-bit and 32-bit ODBC drivers
The x64 MSI now installs both the native 64-bit driver (System32) and the 32-bit driver (SysWOW64), matching the old InnoSetup behavior. Both 64-bit and WoW64 32-bit applications can use the ODBC driver after a single install. Changes: - Product.wxs: x64 builds include DriverPathX86 components with Bitness='always32' for the 32-bit DLL and WOW6432Node registry entries - release.yml: x64 package-windows job downloads both x64 and x86 artifacts; passes DriverPathX86 to WiX; includes x86/ subfolder in ZIP - release.yml: new test-installer job verifies MSI install/uninstall and checks both 64-bit and 32-bit ODBC driver registrations for x64 MSI
1 parent e961c3f commit 738233c

2 files changed

Lines changed: 161 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ jobs:
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

installer/Product.wxs

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
<!-- Variables passed from the build: -->
44
<!-- $(ProductVersion) — e.g. 3.5.0.0 -->
5-
<!-- $(DriverPath) — full path to FirebirdODBC.dll -->
5+
<!-- $(DriverPath) — full path to native FirebirdODBC.dll -->
66
<!-- $(Configuration) — Debug or Release -->
77
<!-- $(TargetArch) — x86, x64, or arm64 -->
8+
<!-- $(DriverPathX86) — (x64 only) full path to 32-bit FirebirdODBC.dll -->
89

910
<?define DriverName = "Firebird ODBC Driver" ?>
1011

@@ -40,7 +41,7 @@
4041

4142
<MediaTemplate EmbedCab="yes" />
4243

43-
<!-- The driver DLL -->
44+
<!-- Native driver DLL -->
4445
<StandardDirectory Id="$(SystemDir)">
4546
<Component Id="DriverDLL" Guid="B8F4E3C2-5D6E-7F8A-9B0C-1D2E3F4A5B6C">
4647
<File Id="FirebirdODBCDll"
@@ -50,7 +51,7 @@
5051
</Component>
5152
</StandardDirectory>
5253

53-
<!-- ODBC Driver registration -->
54+
<!-- Native ODBC Driver registration -->
5455
<Component Id="OdbcDriverReg" Directory="$(SystemDir)"
5556
Guid="C9F5E4D3-6E7F-8A9B-0C1D-2E3F4A5B6C7D">
5657
<RegistryKey Root="HKLM" Key="SOFTWARE\ODBC\ODBCINST.INI\$(DriverName)">
@@ -70,10 +71,53 @@
7071
KeyPath="yes" />
7172
</Component>
7273

74+
<?if $(TargetArch) = "x64" ?>
75+
<!-- ── 32-bit (x86) driver bundled in the x64 installer ──────────── -->
76+
<!-- The x64 installer ships both 64-bit and 32-bit drivers so that -->
77+
<!-- both native x64 and WoW64 32-bit applications can use ODBC. -->
78+
<!-- This matches the behavior of the old InnoSetup installer. -->
79+
80+
<!-- 32-bit driver DLL → SysWOW64 -->
81+
<StandardDirectory Id="SystemFolder">
82+
<Component Id="DriverDLL_x86" Guid="F1A2B3C4-5D6E-7F8A-9B0C-1D2E3F4A5B6C"
83+
Bitness="always32">
84+
<File Id="FirebirdODBCDll_x86"
85+
Source="$(DriverPathX86)"
86+
Name="FirebirdODBC.dll"
87+
KeyPath="yes" />
88+
</Component>
89+
</StandardDirectory>
90+
91+
<!-- 32-bit ODBC Driver registration (writes to WOW6432Node via 32-bit registry view) -->
92+
<Component Id="OdbcDriverReg_x86" Directory="SystemFolder"
93+
Guid="F2B3C4D5-6E7F-8A9B-0C1D-2E3F4A5B6C7D"
94+
Bitness="always32">
95+
<RegistryKey Root="HKLM" Key="SOFTWARE\ODBC\ODBCINST.INI\$(DriverName)">
96+
<RegistryValue Name="Driver" Type="string" Value="[SystemFolder]FirebirdODBC.dll" />
97+
<RegistryValue Name="Setup" Type="string" Value="[SystemFolder]FirebirdODBC.dll" />
98+
<RegistryValue Name="APILevel" Type="string" Value="1" />
99+
<RegistryValue Name="ConnectFunctions" Type="string" Value="YYY" />
100+
<RegistryValue Name="DriverODBCVer" Type="string" Value="03.51" />
101+
<RegistryValue Name="FileUsage" Type="string" Value="0" />
102+
<RegistryValue Name="SQLLevel" Type="string" Value="1" />
103+
</RegistryKey>
104+
<RegistryValue Root="HKLM"
105+
Key="SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers"
106+
Name="$(DriverName)"
107+
Type="string"
108+
Value="Installed"
109+
KeyPath="yes" />
110+
</Component>
111+
<?endif?>
112+
73113
<!-- Features -->
74114
<Feature Id="DriverFeature" Title="$(DriverName)" Level="1">
75115
<ComponentRef Id="DriverDLL" />
76116
<ComponentRef Id="OdbcDriverReg" />
117+
<?if $(TargetArch) = "x64" ?>
118+
<ComponentRef Id="DriverDLL_x86" />
119+
<ComponentRef Id="OdbcDriverReg_x86" />
120+
<?endif?>
77121
</Feature>
78122

79123
</Package>

0 commit comments

Comments
 (0)