Add big (> 2GB) resource asset to an executable

426 Views Asked by At

I want to make a simple, minimalist custom cross-platform installer for a specific Qt application. The installer looks like this:

Simple Installer UI

But in one use-case, the data to store there is > 5GB long. I have tried the following:

  1. Using Qt Installer Framework

    • Does not allow offline updates.
    • It is not possible (or it is very hard) to make a custom Qt Quick Controls 2 UI like the shown above
  2. Compiling Qt statically and embed the resource with rcc

    • Success on compiling Qt statically
    • Using CONFIG += resources_big in .pro file to allow two-pass of rcc tool to compile the big resources
    • Does works for files with < 2GB, but not for larger ones. I use this for files with < 2GB
    • If > 2GB, the linker (ld) fails with ...relocation truncated to fit...
    • I added the flag -mcmodel=medium as suggested here. It does not works, nor does -mcmodel=large nor -Wl,--image-base -Wl,0x100000000 nor -Wl,--image-base -Wl,0x180000000
  3. Compiling Qt statically and append data to the end of the executable (this seems to be the best approach for > 2GB files)

    • Append my > 5GB zip-compressed test file
    • Append 8 bytes with the size in bytes
    • Works on Linux
    • Works on Windows with no so large files (shows This app cannot run on your PC)

I want some advices about how to make the third approach work, as it seems to be the best one for > 2GB files. But new and fresh ideas are welcome too.

An alternative cross-platform installer framework that correct the missing features of Qt's one is also welcome.

I do not want to involve the winapi if possible. But a short and easy-to-implement solution will be accepted too.

BTW, I currently have a PC with 4GB of RAM. But this have not been a problem.

0

There are 0 best solutions below