Conditionally providing ODBC driver

Got a problem you cannot solve? Try here.
anja_laenge
Posts: 114
Joined: Tue Nov 20, 2012 1:02 am

Conditionally providing ODBC driver

Postby anja_laenge » Tue Nov 17, 2020 7:36 am

Hi,

using InstallAware X9 I need to deploy an application utilizing the Microsoft Access 2016-Runtime, available from https://www.microsoft.com/de-de/downloa ... x?id=50040
This is available for x64 and x86 separately, both as .exe.

So, am I correct that I can not use the ODBC page of IA but instead need to create two separate application runtimes, using
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\ODBC\ODBCINST.INI\ODBC Drivers :: Microsoft Access Driver (*.mdb, *.accdb) :: Installed
respectively
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers :: Microsoft Access Driver (*.mdb, *.accdb) :: Installed

as checks for presence combined with a switch in the "Install Application Pre-Requisites" MSI area based on Processor Architecture to choose which one to check&install?

kind regards
Anja

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Conditionally providing ODBC driver

Postby FrancescoT » Tue Nov 17, 2020 1:41 pm

You may simply create a ODBC DSN on the base of the target OS architecture (x86/x64). This will assign the correct driver automatically.

In other words, and supposing the "Microsoft Access 2016-Runtime" (x64 or x86) has been already installed on target machine, you may do as follow:

Code: Select all

Set Variable IS_X64 to FALSE
Get System Setting Windows in 64 bit Mode into IS_X64
if Variable IS_X64 Equals TRUE
  Set x64 - Native 64 bit Windows, AMD64, EM64T, and ARM64 Architectures - installation mode
end
 
Set Variable NATIVE_ENGINE to TRUE
Comment: Switching ON NATIVE ENGINE for immediate execution
Create ODBC DSN  (uses driver )
Set Variable NATIVE_ENGINE to FALSE
 
if Variable IS_X64 Equals TRUE
  Comment: In case you don't need to keep ON the X64 MODE
  Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation mode
end

Code: Select all

~InstallAware Clipboard Data~
~End~
~{FA3F0B48-FB71-43A7-9ED0-C32DEDA81D23}~
~Set 64 Bit Mode~
~{33DB3C0B-7430-4AC5-92DA-8A7CE91742B4}~
~TRUE~
~FALSE~
~FALSE~
~Comment~
~{698BF645-33A5-4252-8E63-0B3D7F4D84D0}~
~In case you don't need to keep ON the X64 MODE~
~If~
~{5E424CFE-6C16-4060-9ADF-A47308045F4C}~
~IS_X64~
~0~
~TRUE~
~FALSE~
~Comment~
~{AF8AB83A-FA38-4B03-998F-3872DFF70A66}~
~~
~Set Variable~
~{89C037BD-59E7-4405-A07C-EA29973F2BE8}~
~NATIVE_ENGINE$MYAH$MYAH$FALSE~
~FALSE~
~Create ODBC DSN~
~{84B84EFD-AC3E-43EF-85EE-4922929DF0F5}~
~~
~~
~TRUE~
~~
~Comment~
~{80F140E5-9D55-42D4-BADE-31EC6F1E0042}~
~Switching ON NATIVE ENGINE for immediate execution~
~Set Variable~
~{FE47861A-9F81-4D5A-90D6-22795359C004}~
~NATIVE_ENGINE$MYAH$MYAH$FALSE~
~TRUE~
~Comment~
~{40410C8F-F716-4B3F-94A7-B5F66DD27284}~
~~
~End~
~{CFDA338A-46C1-4D94-A834-74B80D55C1C0}~
~Set 64 Bit Mode~
~{B03279EE-C819-44E5-A2DF-6F45A7DB1151}~
~FALSE~
~FALSE~
~TRUE~
~If~
~{5B1423EA-5596-4106-BA75-CB16202B6324}~
~IS_X64~
~0~
~TRUE~
~FALSE~
~Get System Settings~
~{2E67FE45-6894-467B-9D72-ABDDD6F1771A}~
~IS_X64~
~65~
~Set Variable~
~{B98E6187-4D44-4471-B286-FFF58ADF4B50}~
~IS_X64$MYAH$MYAH$FALSE~
~FALSE~


At any rate, please consider that on a x64 target both x86 and x64 ODBC drivers can coexist. This because a x64 target OS has both x86 and x64 ODBC environments. Then depends on the calling app which of these is actually used.

If your app runs natively in 32 bit mode (x86), regardless of the target OS architecture, this will only have access to the x86 version of the ODBC drivers. If this is your case, you even don't need to have the x64 version of the "Microsoft Access 2016-Runtime" installed.
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

anja_laenge
Posts: 114
Joined: Tue Nov 20, 2012 1:02 am

Re: Conditionally providing ODBC driver

Postby anja_laenge » Wed Nov 18, 2020 3:36 am

FrancescoT wrote:supposing the "Microsoft Access 2016-Runtime" (x64 or x86) has been already installed on target machine


No, I can not assume that but the setup must ensure the customer can access legacy .mdb files.

If your app runs natively in 32 bit mode (x86), regardless of the target OS architecture, this will only have access to the x86 version of the ODBC drivers. If this is your case, you even don't need to have the x64 version of the "Microsoft Access 2016-Runtime" installed.


The application is .NET Core 3.1 based, not all components can target AnyCPU and it seems these components do not execute x86 compiled on a 64bit processor architecture. Currently this is a subject with no final decision.

kind regards
Anja


Return to “Technical Support”

Who is online

Users browsing this forum: Google [Bot] and 47 guests