Jump to content

Application Virtualization: Bundle Qt Runtime to Single Executable for Windows


x00x

Recommended Posts

qt-logo-150x150.png

We have been asked about the ability of our application virtualization solutions to bundle numerous dynamic link library (dll) files for Qt programs (http://qt.nokia.com/) compiled for Windows and in this post I will show how to bundle/merge Qt runtime libraries to the single executable. Application Virtualization in this context means emulation of files (and registry) in memory, without having the files on the disk (and registry items in real registry).

trans.gif

What are benefits of application virtualization?

1. Distribute your program as a single, stand-alone executable, or as a portable application. All virtual files are being added to the main executable, so there is no need to have these files on the disk.

2. Compress virtual files. In the example below we will virtualize 2 Qt runtime dll – QtCore4.dll and QtQui4.dll. Size of these two dll files is about 12.4 Mbytes + 0.1 MBytes of main executable, after virtualization, size of the bundled executable is being decreased up to 5.5 MBytes, that gives us 55% compression ratio!

3. We can be sure that only our virtual runtime libraries will be loaded. Imagine you distribute your Qt application, compiled for Windows, to customers. Customer’s system may already have Qt runtime libraries installed, but the version of installed files differ from the one your application requires, let’s say your application requires the latest versions of runtime, but installed older. If the older runtime files will be located in Windows directory but your new one in the folder with exe file, the system will be trying to use files located in Windows directory, i.e. older files. Using older files may be impossible for your application that will cause refusing of execution.

If Qt runtime libraries are virtualized and even if the system already contains any Qt runtime, the virtualized one will be applied to your application anyway.

4. Make sure virtual files are not modified. Since virtual files are not stored on the disk, it is quite difficult to change/patch them.

5. Virtualize any other files from your application! Virtualization ability is not limited by bundling only runtime libraries, it supports any other kind of files: images, video, music, data files and any other.

How to do?

Virtualization can be done using freeware program – Enigma Virtual Box, or more featured commercial – Enigma Protector. I will show examples with both.

Enigma Virtual Box (freeware)

- Download

Enigma Virtual Box from http://enigmaprotector.com/en/downloads.html install it and run

- Select the input file – main executable of the compiled Qt program (output file name will be assigned automatically)

- Add Qt runtime libraries to the files list, in the %DEFAULT FOLDER% (QtCore4.dll and QtQui4.dll)

s1-300x198.png

- Enable compression options for files

s2-300x142.png

- Click Process button

Now test output file. It will be working well even if we delete QtCore4.dll and QtQui4.dll from the disk.

Enigma Protector

- Download Enigma Protector from

http://enigmaprotector.com/en/downloads.html install it and run

- Go to Input panel (from the left side navigation menu) and select the input file – main executable of the compiled Qt program (output file name will be assigned automatically)

s3-300x207.png

- Go to Virtual Box – Files panel, enable files virtualization feature and add Qt runtime libraries to the files list, in the %DEFAULT FOLDER% (QtCore4.dll and QtQui4.dll)

s4-300x207.png

- Enable compression options

- Click Protect button

Please note, the Enigma Protector allows same virtualization functionality as Enigma Virtual Box, but also offers many features to protect your software, protect virtual files, add licensing features and so on.

Source: http://www.prasid.in/blog/application-virtualization-bundle-qt-runtime-to-single-executable-for-windows/

Link to comment
Share on other sites


  • Views 1.8k
  • Created
  • Last Reply

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...