How do I unify two msi installation packages (64bit and 32bit) created by Windows Installer into one? - installation

I created 32-bit and 64-bit installation files respectively with Windows Installer. How can I create a unified installation file that can check the bits during installation, and merge these two into one to install automatically according to the bits?

Heath Stewart: Different Packages are Required for Different Processor Architectures. Here is an extract: "A common question is how to create a Windows Installer package that installs 32-bit binaries on 32-bit platforms, and both 32- and 64-bit binaries on 64-bit platforms. If you’re actually trying to install 64-bit binaries to appropriate directories and write to the 64-bit view of the registry, the short answer is that you can’t build a single package."
You should be able to use a setup.exe creation tool such as WiX's Burn or Advanced Installer or InstallShield (all can create setup.exe launchers). I am unsure of the built-in mechanisms they provide for this at the moment - I haven't looked at it for a while.
In any case you need a 32-bit setup.exe so that it can launch on both 32 and 64 bit systems and inside it you can keep your 64-bit setup along with the 32-bit one.
Rob Mensching's on the topic: How to deploy 64-bit and a 32-bit Windows Installer package as a single setup?.
Here is one of his blogs on Burn: https://robmensching.com/blog/posts/2009/7/14/lets-talk-about-burn/ and here is the normal starting point in the WiX documentation for Burn.
Here is my attempt to show a basic, functional Burn package (many links - too many - towards the bottom).
Links:
Single MSI to install correct 32 or 64 bit c# application
https://www.firegiant.com/wix/tutorial/net-and-net/bootstrapping/

Related

Auto lauch 32bit/64bit according to OS bitness?

I am using Visual Studio 2008 to write applications. When deploying the app, some of the systems are 32bit, while the others are 64bit. Therefore, I plan to deliver both 32bit/64bit version in the installer, then launch the corresponding version based on the bitness of the OS. How to implement the latter, i.e., get the bitness of the OS and launch the corresponding version?
Let me clarify the situation. I already developed both 32bit and 64bit EXE application with C++. Then I want to detect the bitness of the Windows in C++(I don't know .NET) and launch the corresponding version of application.
Thanks
I would recommend looking for a more powerful MSI packaging tool. Most professional tools offer you a built-in bootstrapper that provides this functionality with one click.
The VS setup project is useful for basic application packaging, but never intended to offer you full power.
It depends on what you mean by "launch the corresponding version". This implies that you already have code written that needs to choose, in which case this isn't an installer question at all - you just need to find the bitness of the OS and then install the appropriate MSI file (or VS-generated setup.exe). If it's a C# launcher you'd perhaps use Environment.Is64BitOperatingSystem.
Your question doesn't say if you are delivering code (assemblies, COM Dlls etc) that will be used by client programs. I mention this because your 32-bit setup will install and run on 64-bit OS versions in the 32-bit subsystem. The 64-bit version will presumably contain only native 64-bit code.
Note that your 64-bit setup won't install on a 32-bit OS anyway.

Registering 32 and 64 bit DLL in a single MSI using WiX

I need to create a SINGLE Windows installer that performs the following tasks when it is run on the target m/c:
Runs a service
Registers a 32 bit DLL
Stores the 32 bit and 64 bit log4cxx.dll libraries in C:\Windows\sysWoW64 folder and C:\Windows\system32
Registers a 64 bit DLL
Currently, I am using WiX to create an installer and I am at a point where I can register either 32 bit OR 64 bit installer but not both. Unfortunately, I don't have the option of separating the 32 and 64 bit installer as I need to register both the installers on a 64 bit machine.
I would like to know if there was a way to register both the DLLs in one installer. Thanks in advance.
WiX doesn't support mixed 32/64-bit packages. So the only option is using separate packages:
A 32-bit package for 32-bit systems.
A 64-bit package which installs both 32-bit and 64-bit resources on a 64-bit machine.
Another solution is to use a different setup authoring tool which supports mixed 32/64-bit packages. Perhaps this list will help: http://en.wikipedia.org/wiki/List_of_installation_software

Install VC++ Runtime 64-bit if system is 64-bit

I am creating a Visual Studio 2010 Setup project for installing my application. My application works by having multiple executable for different system bitness, and detects if you are running on a 32-bit or 64-bit system.
I'd like to have the Visual C++ 2010 x64 Runtime installed by the installer if it is a 64-bit system. Setting this as a prerequisite, disables installation on 32-bit systems. Is there any way to set this as a prerequisite, but only on 64-bit systems, without resorting to two different installers?
You need to create separate MSI files for the 64-bit version and the 32-bit version to deal with the specialities of WOW64.
It is not possible to have one single MSI install both a 64-bit and a 32-bit version:
Different Packages are Required for Different Processor Architectures
Because you will have separate MSI files it should be easy to add the 64-bit VC++ Runtime Redistributables to the 64-bit MSI and the 32-bit ones to the 32-bit MSI respectively.
Of course, you may create a bootstrapper that checks the system architecture and then launches the respective MSI file. I believe dotNetInstaller offers such a mechanism as has been indicated in a related question.

Microsoft Windows 64-bit application development best practises installation folder

My problem is that a vendor is providing me with a 64bit application (packed in a 64bit installer) but it goes and installs to the x86 (Program Files) Folder and he keeps telling me its OK but I want it to install in the Program Files directory; as the 32 bit version does that and scripts for the app are developed based on this assumption.
Can someone direct me to the Microsoft recommended best practices for 64bit applications(links).
Thanks in advance.
This may help:
About Windows Installer on 64-Bit Operating Systems
http://msdn.microsoft.com/en-us/library/aa367451.aspx
Is your vendor installing the app via an MSI file? If so, their app setup generator (WIX, InstallShield, etc) should be creating MSI's that store their components in the correct places.
If not and they're installing using a custom script, suggest they start investing in learning WIX ;)
Either way, they should be following the recommended guidelines and installing 64-bit code and 32-bit code to the correct locations and modifying the correct registry trees accordingly.

Modify existinig WIX 2 script to add 64-bit components

I have an installer script written in Wix 2 several years ago. Now I need to add two 64-bit components. One 64-bit DLL to be copied to system32 folder and another b4-bit EXE to ProgramFiles.
The installer needs to create registry key. Currently it uses a element to write a key, and a custom action (in 32-bit MSI dll) to write the serial number.
The key must be accessible to 64-bit EXE.
Is it possible to do in one MSI? Also how to create a condition that only copies the 64-bit files when the system is 64-bit?
msi doesn't allow installing 32-bit and 64-bit components in the same msi. You have to create a separate msi for both architectures.
In order to install 64-bit components, the MSI needs to be marked as being 64-bit - otherwise, filesystem and registry paths will be redirected. As well as adding the 64-bit attributes, the 32-bit and 64-bit packages should appear as different products; i.e. you should create new Product and Upgrade codes.
I think there may be problems with using WiX 2 to create 64-bit MSIs, so you may need to upgrade to WiX 3.x.
Since you need two MSI files for 32-bit vs. 64-bit Windows, you can easily prevent 32-bit files being installed on a 64-bit PC by not including them in the 64-bit installer. If you need a single installer executable for both x86 and x64 you'll need to use a bootstrapper which chooses which MSI to run. I don't know if burn.exe from the WiX distribution can do this.
One way to approach the source layout is to use a single master WiX file with conditionals which select which features to build in depending on the target architecture, and then have architecture-specific modules which get linked in. You can find an example of such a solution at https://svn.bluestop.org/viewvc/repos/sctpDrv/wix/ . Note that it only supports x86 and x64 and not Itanium (aka Intel64).

Resources