coolscitist
coolscitist

Reputation: 3397

Setup file for application using QT Jambi

I want to use QT Jambi for GUI (Java project). The GUI needs to have animations (similar to Iphone apps). That is why, I do not want to use Java Swing.

My question is, after I develop the application, is there any automatic mechanism which would create a setup file which could be used to install my application in any computer (may be separate "setup" files for separate OS). In other words, I would like my users to download just one file: setup.exe. This should install the app in their computer.

I know there is one such app for .jar files (I forgot the name). But QT is a C++ library and I do not like bothering the users, asking them to download QT just to use my app.

Upvotes: 1

Views: 453

Answers (2)

dhardy
dhardy

Reputation: 12174

Good question, and one good attempt at an answer.

I've gone down a slightly different route: embed the Qt Jambi libraries, but not a JRE. I have some basic sh/bat launch scripts which configure the resources required and am using IzPack for the installer (though NSIS might be a good alternative).

Problem: how to find the JRE

  • Solution: the IzPack installer needs a JRE to run, so guarantees the availability of one. It can update a variable in scripts during installation.
  • Solution (Windows): use the registry
  • Last resort: use the path

The ideal would be to integrate all three into a batch file. Anyone done this?

Problem: Qt & Qt Jambi libraries

  • Solution: distribute with your application and link from the shell/batch file.

The problem with this is how to make sure your libraries get used when binary-incompatible Qt libraries are already installed on the system. On Linux, extracting the libraries and exporting LD_LIBRARY_PATH seems to work. On Windows I haven't solved this and on the Mac I haven't tried.

Problem: most appropriate Qt libraries

32-bit Qt libraries probably won't work with a 64-bit JRE; this is a problem I haven't yet had to deal with. Probably the best solution would be to include both 32-bit and 64-bit Qt libraries and select between them from a script at run-time (or possibly install-time).

Another issue is related to themes: Qt has support for using native themes, but only from the platforms it's compiled on. Thus, compiling Qt on an old Windows version and using the libraries on a modern version of Windows seems to work but results in ugly Windows-98-esque widgets. The easiest solution seems to be to launch with -style Plastique (or cleanlooks) to get nicer-looking widgets.

Upvotes: 0

Darryl Miles
Darryl Miles

Reputation: 4631

I presume you are tagetting win32 only on the desktop and looking for free/open tools. With no response to this questio so far I thought I'd provide some info towards this point even if it is not the answer you really want.

I have been looking over the QtJambi ecosphere for the past couple of years and I'm not aware of such a tool to provide you with a process to follow that results in an EXE. There are all kinds of caveats.

The task:

  1. Ensure the JRE5+ is installed on target system.
  2. Ensure QtJambi files and perform things like extraction of native JAR.
  3. Ensure QtJambi pre-reqs are installed on the target system (such as MSVCxxxx runtimes).
  4. Finally install your application and fixup the startup configuration to make use of information above.
  5. Setup desktop fo reasy access (Program Group, Desktop Icon, Menu items, Shortcuts)

You will find that NSIS http://nsis.sourceforge.net/ can be a tool to get some parts of the process and maybe provide a framework to write modules for NSIS that do other parts of the work. But I have found NSIS somewhat lacking when you step outside of a simple unzip of data and setup of desktop install process.

Another solution for you would be to simply provide everything that works in one ZIP file, this would include a copy of the Java JRE embedded, a copy of QtJambi embedded, the rest of your JAR and then write a toplevel *.BAT file to setup %PATH% and other arguments to run your supplied java.exe against your application. Obviously now the JRE is not likely to get updated so at some point will be considered insecure.

NSIS isn't the only such windows installer that exist.

Maybe there is a fully automatic one click install wrapper with custom parts to help setting up QtJambi, but I doubt it at this time.

Upvotes: 1

Related Questions