PDA

View Full Version : Dynamically adding resources



atomic
17th July 2015, 16:42
Hi,

I use rcc compiler resource and QResource::registerResource() to add dynamically external resources as it is describes here The Qt Resource System (http://doc.qt.io/qt-5.5/resources.html)

It works fine but I would like to embed this registered resources in my executable file.
Is any way to do this without recompile project?

d_stranz
17th July 2015, 16:58
Is any way to do this without recompile project?

No. How do you think the resource system gets embedded resources into the executable?

And think of what a security hole you would have for malware if changing the executable was possible without rebuilding.

atomic
17th July 2015, 20:57
Thank you very much,

so if I would like to allow my end users embed dynamically resources and recompile project on their machine, what I must also provides? It is enough qmake and for example mingw32-make? or i must have on their machine all Qt?

jefftee
17th July 2015, 23:30
You must have everything required to build your application. What type of resources do you want users to provide? Most (all?) resources that I've used in a Qt resource file can be directly loaded via other methods.

d_stranz
19th July 2015, 17:22
so if I would like to allow my end users embed dynamically resources

Why do you need to provide a way for users to embed resources?

Do you really want to force your users to become programmers just to be able to use your application?

Are your users going to redistribute your application after it has been changed to include their custom resources?

Why can't these resources live on the user's own hard drives somewhere and simply be dynamically loaded by your application?

Are you confused about how to implement something that lets users define their own resources and use them in your application?

atomic
19th July 2015, 21:06
I writting a program which allows users create animations from images or videos with text and then they can share with friends what they have done. And it would be great if users can send to their friends only one file with effects works.

anda_skoa
20th July 2015, 07:53
I writting a program which allows users create animations from images or videos with text and then they can share with friends what they have done. And it would be great if users can send to their friends only one file with effects works.
But don't you have that already?
What other file than the resource file does another user currently need?

Cheers,
-

d_stranz
20th July 2015, 21:54
I writting a program which allows users create animations from images or videos with text and then they can share with friends what they have done. And it would be great if users can send to their friends only one file with effects works.

So you are saying that your program allows users to edit a video file to add something to it, but the only way they can share it with others is to send them a copy of your program? Why don't you just write out a new video file with the changes the user has made?

Kryzon
21st July 2015, 00:37
You can append data to the end of the executable file:
http://oroboro.com/packing-data-compiled-binar/

d_stranz
21st July 2015, 17:52
This is all well and good, but it is unlikely you can get away with this at runtime on a Windows app, both because Windows locks apps (and their DLLs) while they are executing, and because Windows security won't let you write to the application install directory except during installation.

So, to do this in practice, the program would have to create a copy of itself somewhere with the new data appended, and then users would have to send each other the new program along with all of the Qt DLLs it depends on, and then get it installed correctly on their machines.

And each time a user wanted to edit a new image or video, they would have to create another copy of the program and data and Qt DLLs and ship that off to their friends.

I mean, really?

atomic
21st July 2015, 18:08
Yes, you are right, my app has two parts, one main part for create animations from images and texts and one small program for "read-only" effects and now the second small program must be provide with separate file( resources.rcc) which is dynamically loaded when user want see this animation and run this program. And i want embed this resource file inside this small program and I think I must read content from above link.

Thanks,