piotrek
Posts: 8
Joined: Wed May 31, 2017 8:48 pm

How to install 32bit application in "Program Files (86)" folder on 64 bit Window OS

Hello,

I'm building a mixed 32/64 bit installer for a Java application. My application includes several DLL files which have to match JRE - 32bit DLLs with 32bit JRE and 64bit DLLs with 64bit JRE.

There is no problem on 32bit OS with 32bit JRE and 64bit OS with 64bit JRE.

On 64bit OS with 32bit JRE my installer properly installs 32bit application wrapper and 32bit DLLs but in a wrong place - all the files are installed under the Program Files folder instead of Program Files (86)

The files to be installed on 64bit OS with 32bit JRE are control by a feature added under Package Definition->Organization.

How would I direct the installer to use the "Program Files (86)" folder in the above case?
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: How to install 32bit application in "Program Files (86)" folder on 64 bit Window OS

Hello,

Please note that when using the "Mixed 32/64 bit Package" the APPDIR will be resolved to "C:\Program Files\Manufacturer\ProductName" regardless the OS type.

If you need to deploy files in "C:\Program Files (x86)\" you should place them in "Program Files" folder from "Files and Folder" page. This folder will be resolved to "C:\Program Files (x86)\" on 64 bits machines.

For more information about folder locations on 64-bit platforms, please take a look on this article:
Advanced Installer Package Types

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
piotrek
Posts: 8
Joined: Wed May 31, 2017 8:48 pm

Re: How to install 32bit application in "Program Files (86)" folder on 64 bit Window OS

Hello Sorin,

Thank you for the answer but i have a related question:
Looking at the "Files and Folder" page I can see three folders: "Application Folder", "Program Files", and "Program Files 64".
Let say that in the "Application Folder" I have: 32bit and 64 bit application wrapper, MyApplication.jar and the "lib" folder with all the other .jar files. If I move the 32bit application wrapper to the "Program Files" folder it will be installed to the "C:\Program Files (x86)\" on 64bit machine. That's what I want.
Should I move the 64bit application wrapper to to the "Program Files 64" folder?
Where should I put the "lib" folder to be installed properly with the 32bit or 64bit application wrapper?
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: How to install 32bit application in "Program Files (86)" folder on 64 bit Window OS

Hello,
Should I move the 64bit application wrapper to to the "Program Files 64" folder?
Yes, "Program Files 64" will be resolved to "C:\Program Files\" on a 64 bit OS.
Also, you should create two features in the "Organisation" page. One feature should contain the 32 bit files and the other the 64 bits files.
You should also condition the install of these features by the OS type, with the VersionNT64 property. Please take a look on this article for more information : How do I install resources based on the Operating System version?.
In this way, if a 32 bits OS is detected, the 32 bits files will be installed. Otherwise, if a 64 bit OS is detected, the 64 bits files will be installed.
Where should I put the "lib" folder to be installed properly with the 32bit or 64bit application wrapper?
You could place this folder in APPDIR as well.

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
piotrek
Posts: 8
Joined: Wed May 31, 2017 8:48 pm

Re: How to install 32bit application in "Program Files (86)" folder on 64 bit Window OS

Hello Sorin,
Also, you should create two features in the "Organisation" page. One feature should contain the 32 bit files and the other the 64 bits files.
I do have three features in the "Organization" page (all with "Installed" under "Installation Behavior" selected):
"64-bit" - 64bit files on 64bit OS - disabled if: NOT VersionNT64 OR NOT AI_DETECTED_JRE64_VERSION
"32on64bit" - 32bit files on 64bit OS - disabled if: NOT VersionNT64 OR AI_DETECTED_JRE64_VERSION
"32-bit" - 32bit files on 32bit OS - disabled if: VersionNT64

The "32on64bit" feature includes 32bit application wrapper from "Program Files" folder in the "Files and Folders" page.

On a 64bit Windows machine with 32bit JRE the installer still displays "c:\Program Files" as a default installation folder. I would expect it to be "c:\Program Files (86)".
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: How to install 32bit application in "Program Files (86)" folder on 64 bit Window OS

Hello,

Do you use bundled JRE from "Java Products" page? If you do, please note that the default Destination folder is "APPDIR" which in your case (Mixed Package type) will be resolved to "c:\Program Files". You could create a new folder in ProgramFilesFolder from "Files and Folders" page named "jre". After that you should go to "Java Product" and click "Edit JRE Bundle" and select JRE from "ProgramFilesFolder" as a destination folder for the 32 bits jre, as it is described in the attached screenshot. In this way the 32 bits jre will be installed in "c:\Program Files (x86)\jre"

If this doesn't help, could you please send us the .AIP (project) of the installation to support at advancedinstaller dot com so we can investigate it?

Best regards,
Sorin
Attachments
screenshot.jpg
screenshot.jpg (42 KiB) Viewed 8685 times
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: How to install 32bit application in "Program Files (86)" folder on 64 bit Window OS

Hello Piotr,

We have analysed your sample project. Thank you for your email.

Your current project configuration will trigger the following behaviour:

The lib folder is the only one placed in APPDIR, which in "Mixed 32/64-bit matching the platform" Package type case will always be resolved to "C:\Program Files\[Manufacturer]\[ProductName]" regardless the OS Type as it is shown in "Install Parameters" page, in Application Folder".

Please note that APPDIR is the only location in the "Files and Folders" page that could be changed by the user at install time, the rest of them being resolved in relation with the system's environment variables.

"Program Files" and "Program Files 64" entries from "Files and Folders" page are resolved at install time to the enviroment variables %ProgramFiles(x86)% and %ProgramFiles% respectively. So if the user decides to install the application on drive D, and the Windows Volume is "c:\" only the APPDIR will be on that drive.

If you need to let the user choose the install location of the wrapper, you have to add it to APPDIR as well. But, in this case, The 32 bit wrapper will also be installed in "c:\Program Files", as APPDIR in mixed package type is always resolved to this value.

To overcome this, you could place the 32 bits files in both "Application Folder" and "Program files" in your "Files and Folders" page. In this way you will have duplicate components. You could condition these components in the following way:

-set the condition

Code: Select all

APPDIR <> "C:\Program Files\Your Company\Your Application"
for components from "Application Folder"

-set condition

Code: Select all

APPDIR = "C:\Program Files\Your Company\Your Application":
for components from "ProgramFiles"

Note: You cand easily go to the corresponding component of a file from "Files and Folders" by pressing F8 shortcut key.

If you configure the project in this way you will achieve the following behaviour:

-If the user doesn't modify APPDIR, the 32 bit files will be installed in "C:\Program Files (86)" and the rest of the files in "C:\Program Files"
-If the user selects for example d:\ as the install location, all the files(including 32 bit ones) will be installed in this location (APPDIR)

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
piotrek
Posts: 8
Joined: Wed May 31, 2017 8:48 pm

Re: How to install 32bit application in "Program Files (86)" folder on 64 bit Window OS

Hello Sorin,
Please note that APPDIR is the only location in the "Files and Folders" page that could be changed by the user at install time, the rest of them being resolved in relation with the system's environment variables.
It seems that I can control the files to be installed with the three features I have defined in the "Organization" page. Is there any reason that there is no option to modify APPDIR depending on the feature being installed? Could this be considered to be added to the Advanced Installer program?
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: How to install 32bit application in "Program Files (86)" folder on 64 bit Window OS

Hello,

The way Advanced installer is developed regarding this subject is the following:

APPDIR is a public property that is resolved at install time, and it can be configured in "Install Parameters", in "Application folder" field. Here you could observe that, in mixed package type case, by default APPDIR is [AI_ProgramFiles][Manufacturer]\[ProductName].

The way this value will be resolved is only conditioned by the package type (this will influence the Program Files folder), manufacturer and product name.

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
piotrek
Posts: 8
Joined: Wed May 31, 2017 8:48 pm

Re: How to install 32bit application in "Program Files (86)" folder on 64 bit Window OS

Hello Sorin,

Looking at http://www.advancedinstaller.com/user-g ... types.html the AI_ProgramFiles folder is used only by the Mixed 32/64 Package and it is always defined to be "C:\Program Files\".
In my case I have to install 32bit binaries on a 64bit OS. I need a way to redefine AI_ProgramFiles to point to "C:\Program Files (86)\".
Is there a way to do it?

Regards,
Piotr
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: How to install 32bit application in "Program Files (86)" folder on 64 bit Window OS

Hello,
In my case I have to install 32bit binaries on a 64bit OS. I need a way to redefine AI_ProgramFiles to point to "C:\Program Files (86)\".
Is there a way to do it?
If you are planing to maintain your current project organisation: - a 64 bit feature, a 32 bit feature and a 32on64bit feature you would need AI_ProgramFiles to point to "C:\Program Files (86)\" only for this feature, as you would still need to install the other features in "C:\Program Files".

Please take a look on the solution I presented in my penultimate post. This solution generates the following behaviour:

In case of the package being installed on a 64 bits machine:

-if the user doesn't change the default installation location, the 32 bits JRE will be installed in "c:\Program Files (x86)", the 64 bit files will be installed in "c:\Program Files"
-if the user changes the default install location, the 32 bits JRE will be installed in the new location, along with the rest of the 64 bit files.

Is this what are you trying to achieve?

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”