We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

mg3hockey
Posts: 2
Joined: Thu Oct 10, 2013 9:47 pm

Building a java package for Mixed 32/64bit on Windows & Mac

Hi Guys,

I have built a java desktop client application and packaged each runnable jar separately for each OS platform: Windows 32, Windows 64, Mac OSx 32 and Mac OSx 64.
They are all runnable jar files, so that you can execute those files using this command: java -jar ****. jar. I want to make an windows installer that can be used on 32bit/64bit architecture of Windows operating system using Mixed 32/64bit platform installer functionality in Advanced Installer 10.6. I have tried several times by myself, but no luck yet.

The intended installation process is as follows:
- Install prerequisites files. (jre 32 on 32bit OS, jre 64 on 64bit OS)
- install a driver setup executable.
- install my java desktop application and some additional resource files.
- create shortcut for user execution.
- finish the installation.

Please let me know how all of you make this sort of the installation package.

Thank you, all.
Mike
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Building a java package for Mixed 32/64bit on Windows &

Hello Mike and welcome to our forums,

Thank you for your interest in Advanced Installer.
I have built a java desktop client application and packaged each runnable jar separately for each OS platform: Windows 32, Windows 64, Mac OSx 32 and Mac OSx 64.
In the Files and Folders page please add the related .jars. You can take a look on the Add files article.

The easiest way to create mixed packages is to have a separate build for each platform:
Windows 32bit
Windows 64bit
Mac Osx 32/64 bit mixed platform
So, you can go in the Media page and add a new MSIBuild and a MacBuild.
So, you will have 3 builds two for Windows Operating Systems and another one for the Mac OS which can be run on 32/64bit platforms.

In the Java page you can define a Java Products (also name them properly e.g JavProdWin32, JavProdWin64 and MacOSX). Add for each java product the related JAR.

Also, please make sure that for the Java Products for the Windows Operating System you set the right attribute for the Platform type from the Java Product Settings tab (e.g. for the JavProdWin32 set the 32-bit platform; for the JavaWin64 set the 64bit attribute).
Also, for these two Java Windows Platforms you should go in the Mac OS X tab and make sure that the Include the Java Product in the Mac OS build option is disabled.

Now you can add the third “Java Product” that will be added in the Mac OS X build.
Please make sure that you select the Any CPU (32/64) option for the Platform type.

This option enables your GUI or Console application to use any JRE installed on the target machine. Your java application will work on any platform having a 32-bit or a 64-bit JRE installed. It uses two java products (one for each JRE type) the 64-bit product being synchronized to have the same settings as the 32-bit product, so you only need to configure the 32-bit product. To have different settings for the 64-bit Java Product just select it from tree and start configuring it.

Now you can go in the Organization page add for each build you should create a feature(e.g. Win32Feature, Win64Feature and a MacFeature).
Please note that when a java product has been added in the “Java” page, automatically a component has been created in the “Organization” page.

You should also add in each feature the component specific for it. Also you can select in the Builds pane the build where the related feature will be included.
Install prerequisites files. (jre 32 on 32bit OS, jre 64 on 64bit OS)
To add a prerequisite you can go in the from the Prerequisites page and use:
  • [New Package Prerequisite] toolbar button to create a new prerequisite using a package from disk
    [New URL Prerequisite] toolbar button to create a new prerequisite using a package on a online location.

In the [http://www.advancedinstaller.com/user-g ... tions.html ] Install Conditions [/url] tab of the prerequisite you can select the supported Windows Versions in the related label.
You can also take a look on the Add prerequisite article which may be useful to you.
install a driver setup executable.
If it is a installation package you can add it as a prerequisite as I described above.
If this isn't your case you can launch the .EXE through a custom action. In order to achieve that you can go in the Custom Actions page and add the Launch attached file predefined custom action with sequence. Using this type of custom action you can execute an application (EXE or DLL) or run a script (VB or Java script) which is not among your project files. This usually happens when this functionality is only useful in the installation process, but not for the installed application itself.This source file will be embedded in the MSI file but will not be deployed at install time with the other application files.
Also you can take a look on the Install a Driver article which may be useful to you.
create shortcut for user execution.
To create a shortcut you can take a look on the Create Shortcuts article which may be useful to you.

Please let us know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”