This is the fourth and final post in our series about 64-bit installation development in InstallShield. The previous posts are located here:
In Scenario 3, an application has both 32-bit and 64-bit components. For this, one installation project can be used to build both the 32-bit and 64-bit installations. You may find this is not as difficult as it sounds.
Let’s assume we are working with a new installation project and we only want to create Single Exe releases. Here are the general steps:
- Create a feature called AllVersions. Set the Release Flags property to AllVersions.
- Create a feature called x86. Set the Release Flags property to x86.
- Create a feature called x64. Set the Release Flags property to x64.
- Associate all of the components that apply to both x86 and x64 versions of the application with the AllVersions feature.
- Associate all of the components that apply to the x86 version of the application with the x86 feature.
- Associate all of the components that apply to the x64 version of the application with the x64 feature. The Setup Design view now looks like this:
- In the Releases view, create a Product Configuration called x86. Set the Setup File Name property to setup_x86.
- In the Releases view, create a Product Configuration called x64. Set the Setup File Name property to setup_x64.
- Under the x86 Product Configuration node, create a SingleExe release called x86. Set the Release Flags property to AllVersions,x86.
- Under the x64 Product Configuration node, create a SingleExe release called x64. Set the Release Flags property to AllVersions,x64. The Releases view now looks like this:
- Create a .NET application (called Launch.exe) that when run, checks the Windows bit-type, either 32-bit or 64-bit. If the application is being run on 32-bit Windows, execute setup_x86.exe. If the application is being run on 64-bit Windows, execute setup_x64.exe.
- Add Launch.exe to the Support Files view, Language Independent folder.
Now that the installation has been set up, how do we build the releases? Here are the instructions for that:
- To create the 32-bit installer, in the General Information view, make sure the Template Summary field is set to Intel;1033 Then, go to the Releases view, click on the x86 release and build it.
- To create the 64-bit installer, set the Template Summary field to x64;1033 Then go to the Releases view, click on the x64 release and build it.
- For the customer, you need three files, Launch.exe, setup_x86.exe, and setup_x64.exe. The user runs Launch, it detects the OS, and runs the appropriate setup program.
What I have just outlined is how I handle this common scenario. I have used it many times, and it works well. Now that I have given you the information, you probably have some questions. So, let me read your mind and answer them for you.
Q: This information is all well and good, but my boss only wants to have one setup.exe file that works on both 32-bit and 64-bit Windows. There has to be a way to do that. If you don’t have the answer, it must be out there somewhere. What if I call InstallShield tech support and ask them how to do it with one setup.exe file?
A: Go ahead and call them. They will tell you the same thing I have. There is no way to get around having separate 32-bit and 64-bit versions of setup.exe.
Q: I still don’t believe you. I bet you are holding out on us and saving the secret information on having one setup.exe, so you can put it into your InstallShield Training courses. That’s right, isn’t it?
A: No, I’m not holding out on you. I have just told you everything I know about this subject. If you look at the Table of Contents for the courses I have created for InstallShield 2010 and 2011, you will see that the 64-bit information isn’t there. I haven’t put it in yet. That’s why I’m giving it out on this blog.
Q: I still don’t believe you, as you are a known trickster. You’re holding out on us, right?
A: Okay, you got me. You have worn me down to the point where I must confess that I do have the secret information on having one setup.exe. It’s just that my bosses at the NSA won’t let me give it to you.