0

I'm developing a Qt app in Qt Creator. I'm creating an install package via InnoSetup. And everything works OK except all the images are missing in the installed program (running it in Qt Creator works fine).

I'm using The Qt Resource System

In my .pro file I have

RESOURCES += \
res/resources.qrc

If in my resources.qrc I have something like this:

<RCC>
   <qresource prefix="/icons">
       <file>4000003.png</file>
       ...
   </qresource>
</RCC>

I access my images for example like this:

title->setIcon(QPixmap(":/icons/" + QString::number(id) + ".png"));

The structure of my directory is :

MyApp
 -sources files (i.e. `.cpp`, `.h`) 
 -res/
   -all the images
   -resources.qrc
build-release
 -release/
   - MyApp.exe

So should I have exactly the same struture in InnoSetup? Meaning I should have the build-release\release directory and the MyApp\res as well? Because I tried that and it didn't help.

madasionka
  • 812
  • 2
  • 10
  • 29
  • And it's still not clear to me, what you ask for. You have to instruct Inno Setup to create the same directory structure on the target machine that works for you locally. So what is the structure that you need? – Martin Prikryl Dec 06 '17 at 16:34
  • I created the same structure, but it didn't fix my problem. So I assumed the problem is on the Qt side and that maybe The Qt Resource System doesn't work as I would like it to work in this case. – madasionka Dec 06 '17 at 17:11
  • So can you deploy your app manually, by copying the required files to another system? – Martin Prikryl Dec 06 '17 at 19:44
  • No, it only works from within Qt Creator or when I deploy the exe created by Qt Creator in it's original place. – madasionka Dec 13 '17 at 12:10
  • @MartinPrikryl please see the updated question. – madasionka Dec 13 '17 at 12:31
  • If you cannot even deploy your application manually, then do not ask an Inno Setup question. First ask how to deploy an application created in Qt Creator. Your current question requires someone who has both Qt Creator and Inno Setup knowledge. You will have hard times finding anyone who knows both. Solve one problem at a time. – Martin Prikryl Dec 13 '17 at 12:34
  • @MartinPrikryl Sorry I didn't uderstand your question. Yes I can deploy my app on different systems. – madasionka Dec 13 '17 at 12:35
  • You wrote "No, it only works from within Qt Creator" – Martin Prikryl Dec 13 '17 at 12:36
  • Yes, I thought you were asking about whether the images are there. – madasionka Dec 13 '17 at 12:37
  • 2
    If you use the Qt resource system correctly, then the images are all compiled into your `MyApp.exe`, and are also retrieved from there at run time. So we need more information to be able to help you, like how your project file looks like (are your correctly point to your resource file), and how you access your image resources in your application. – E4z9 Dec 13 '17 at 13:06
  • @E4z9 Thanks for answering! I updated the question. If you need any more information, let me know! – madasionka Dec 13 '17 at 13:30
  • That looks fine to me. Does your InnoSetup install your application executable verbatim without fiddling around with it? Not sure how to check on Windows, but on mac/linux I'd start with comparing e.g. the checksum of the installed .exe vs the one from the build – E4z9 Dec 14 '17 at 14:09

0 Answers0