Liviu
Posts: 1026
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Mixed package type with per-user installation

Tue Aug 31, 2021 10:13 am

Hi,

By default, "Mixed 32/64-bit matching the platform" Package type is not compatible with “Per-user only” installation type.
This happens because our mixed package type makes some changes which work on per-machine only, for example modifying registry and folder location which a per-user can not access.

In the "Mixed 32/64-bit matching the platform" Package type, Advanced Installer defines the “AI_ProgramFiles” property that will point to the system program files (C:\Program Files\) on both platform types. As we can see this location is not compatible with "Per-user only".

However, there is a method we can use to conditionally install the application resources based on the OS bitness.

As detailed in our Advanced Installer Package Types article, the "32-bit package" can be installed on both 32-bit and 64-bit platforms.

1. Create a new project.
2. From the "Install Parameters" page, we select the "32-bit package" type and "Per-user only" installation type.
installParameters.png
installParameters.png (30.73KiB)Viewed 221748 times

3. Now, from the "Files and Folders" page we can create 2 folders under "Application Folder":
  • x86 res
  • x64 res
4. After that, right click on the folders → Properties and from the "Properties" tab check the "Install folder content into the parent folder" option. We need to do that for both folders.
parentFolder.png
parentFolder.png (60.05KiB)Viewed 221748 times

5. Now we add the resources we want on a "32-bit" machine on the "x86 res" folder and the resources for "64-bit" machine on the "x64 res" folder. For this demo I added a "x64.txt" txt file into the "x64 res" folder and "x32.txt" txt file into "x86 res" folder.
Folders res.png
Folders res.png (35.64KiB)Viewed 221748 times

6. On the "Organization" page, we create 2 new features:
  • x64
  • x86
7. Select the "x64" feature and on the "Not installed if" option add "NOT VersionNT64".
not x64.png
not x64.png (23.15KiB)Viewed 221748 times

8. Select the "x86" feature and on the "Not installed if" option add "VersionNT64".
x64.png
x64.png (22.93KiB)Viewed 221748 times

9. Now we go back to the "Files and Folders" page, right click on the "x64 res" folder → Move To Feature, select the "x64" Feature from the list and click "Ok". Do the same for the "x86 res" folder.
move_to_Feature.png
move_to_Feature.png (70.62KiB)Viewed 221748 times

After that, based on the machine type where our application is installed, the "Per-user" install contains only the specific resources.
For example, on my per-user install after installing the application, only the 64-bit resources were installed since my machine is 64-bit type. In the below screenshot is the result:
result.png
result.png (5.43KiB)Viewed 221748 times
The sample project is attached to this thread, so if you are interested to take a look directly at my project, you are more than welcome to download the project file.

Best regards,
Liviu
Attachments
Demo App.zip
(3.37KiB)Downloaded 1919 times
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Sample Projects”