32 and 64-bit assemblies in the same Windows installer

I have an application written in C # that depends on a managed SQL provider. The sqlite provider is platform dependent (there are two DLLs for 32 and 64-bit applications with the same name). The application loads the desired runtime based on the OS.

The problem is that when creating the installer, I cannot add the 64-bit mode dll to the installation project, because I get the following error: The file '' targeting 'is not compatible with the target platform of the project'.

I would use a different installer, but I have a custom action that needs to be called during installation.

So, I wanted to know if there is an installer that will allow me to add a 32-bit and 64-bit DLL to it and perform an arbitrary action written in C #.

One possible solution is to have two installers, but I would like to avoid it if possible.

Any suggestions?

+6
installer 64bit windows-installer custom-action
source share
4 answers

Inno Setup The installer supports the function that you request, this installer is very flexible and reliable, there are many sample scripts on the Internet to make a conditional installation depending on the architecture of the end client.

Check out this script located in C:\Program Files\Inno Setup 5\Examples\64BitThreeArch.iss

  -- 64BitThreeArch.iss -- ; Demonstrates how to install a program built for three different ; architectures (x86, x64, Itanium) using a single installer. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES! [Setup] AppName=My Program AppVerName=My Program version 1.5 DefaultDirName={pf}\My Program DefaultGroupName=My Program UninstallDisplayIcon={app}\MyProg.exe Compression=lzma2 SolidCompression=yes OutputDir=userdocs:Inno Setup Examples Output ; "ArchitecturesInstallIn64BitMode=x64 ia64" requests that the install ; be done in "64-bit mode" on x64 & Itanium, meaning it should use the ; native 64-bit Program Files directory and the 64-bit view of the ; registry. On all other architectures it will install in "32-bit mode". ArchitecturesInstallIn64BitMode=x64 ia64 [Files] ; Install MyProg-x64.exe if running on x64, MyProg-IA64.exe if ; running on Itanium, MyProg.exe otherwise. Source: "MyProg-x64.exe"; DestDir: "{app}"; DestName: "MyProg.exe"; Check: IsX64 Source: "MyProg-IA64.exe"; DestDir: "{app}"; DestName: "MyProg.exe"; Check: IsIA64 Source: "MyProg.exe"; DestDir: "{app}"; Check: IsOtherArch Source: "MyProg.chm"; DestDir: "{app}" Source: "Readme.txt"; DestDir: "{app}"; Flags: isreadme [Icons] Name: "{group}\My Program"; Filename: "{app}\MyProg.exe" [Code] function IsX64: Boolean; begin Result := Is64BitInstallMode and (ProcessorArchitecture = paX64); end; function IsIA64: Boolean; begin Result := Is64BitInstallMode and (ProcessorArchitecture = paIA64); end; function IsOtherArch: Boolean; begin Result := not IsX64 and not IsIA64; end; 
+6
source share

With Windows Installer, no. You will need two installations.

However, NSIS is capable of handling both platforms in the same installation with runtime detection. It really depends on whether you are configured for Enterprise users or not, corporate clients will require Windows Installer (MSI) packages, while your average Internet user does not care :)

+1
source share

I like the idea of ​​installing Inno, I would probably try, but consider the following:

Microsoft MSI's best practice is to have two separate settings: one for 32 and one for 64, and many third-party IDEs like Installshield support these best practices. IMO, there is probably a reason for this, otherwise they would add this feature in order to have an advantage over competitors.

To create 2 installations from one installation project, you would have both installers built from the same installation project, using the release flags, you basically create one function containing your 32-bit assemblies, the other of which contains 64-bit , assign to release a flag for each of them and deploy each version separately,

So, during the build, you create a 32-bit version, it is packed, and the 64-bit version is ignored, then you do the same for the 64-bit one. You can pass these flags through command line arguments if necessary.

Thus, you do not have duplicate setup code to support.

+1
source share

Windows installer works fine in this scenario, for example. they have two components, each of which has one of the sqlite files and conditionally installs an object based on the VersionNT64 property, which is installed only when the installation is performed on a 64-bit platform.

+1
source share

All Articles