December 17, 2010

smotiwala smotiwala
Lab Rat
28 posts

Packaging extra folder and files in Qt for symbian?

Page  
1

I want to package extra folder and files to deploy with the application (.sis) file in Qt for symbian.

How can I package extra folder and files with sis file?

Please help me in this regard,

Thanks

25 replies

December 17, 2010

Deleted Member # 4a2 Deleted Member # 4a2
Ant Farmer
1481 posts

any reason why you can’t use a resource file?

December 17, 2010

Alexander Kuchumov Alexander Kuchumov
Hobby Entomologist
377 posts

add next lines in .pro file

  1. samplefiles.sources = file1
  2. samplefiles.path = dir1
  3. DEPLOYMENT += samplefiles

December 17, 2010

QtK QtK
Gene Splicer
1140 posts

Make use of DEPLOYMENT in your .pro file. Something like

  1. PrjRes.sources = images\icon.png
  2. PrjRes.path = c:\data\images\icon.png
  3. DEPLOYMENT += PrjRes

Edit: Didn’t refresh the page so missed the above posts.

December 17, 2010

QtK QtK
Gene Splicer
1140 posts

Also note that there is a Bug [bugreports.qt.nokia.com] in Qt 4.6.3 which is fixed in Qt 4.7. So above will have some issues in Qt 4.6.3. So in Qt 4.6.3 DEPLOYMENT keyword is not handles properly.

December 17, 2010

smotiwala smotiwala
Lab Rat
28 posts

Thanks for ur reply. I think “PrjRes.sources” is the path where the files to be packaged?

Please let me know how do I add folder?

I have following folder and file hierarchy to be packaged

@ [Package] // — folder [data1] // — folder file1.txt // file conf1.txt // file icon1.png // file icon2.png // file [data2] // — folder file2.txt // file conf2.txt // file logo.png // file image.png // file
@—

If DEPLOYMENT has bug then what is the alternative to. I have read about “INSTALLS” but unfortunately “INSTALLS” didn’t work.

thanks in advance.

December 17, 2010

Alexander Kuchumov Alexander Kuchumov
Hobby Entomologist
377 posts

QtK :)

December 17, 2010

roopeshchander roopeshchand..
Ant Farmer
39 posts

To elaborate:

  1. samplefiles.sources = path/in/build/machine/to/file.ext
  2. samplefiles.path = dir/in/the/device/to/place/file/
  3. DEPLOYMENT += samplefiles

It’s a little easier in Qt Creator 2.1, where Qt Creator adds a DEPLOYMENTFOLDERS variable in the pro file when it creates the project (QTCREATORBUG-3203 [bugreports.qt.nokia.com] has some details), like:

  1. DEPLOYMENTFOLDERS = # file1 dir1

which you can edit to

  1. file1.source = relative/path/in/build/machine/to/file.ext
  2. dir1.source = relative/path/in/build/machine/to/dir/
  3. DEPLOYMENTFOLDERS = file1 dir1

December 17, 2010

smotiwala smotiwala
Lab Rat
28 posts

Thanks. But I have QTCreator 2.0

December 17, 2010

QtK QtK
Gene Splicer
1140 posts

smotiwala wrote:

If DEPLOYMENT has bug then what is the alternative to.

thanks in advance.

Please do verify if the bug is valid in your case. Say if you are targeting for Qt 4.7 then the bug is probably solved in that version.

If you still face problems. One way out is to try modify the .pkg file and build the sis. This is not recommended, so didn’t mention it – but you can try this if other options don’t work.

December 17, 2010

roopeshchander roopeshchand..
Ant Farmer
39 posts

@smotiwala The DEPLOYMENT part of my answer (just elaborating what @alexander and @qtk said) does not need Qt Creator 2.1. Maybe you could try that and let us know if that helped or not.

December 17, 2010

smotiwala smotiwala
Lab Rat
28 posts

Thanks all for your help. I’ll try it.

December 23, 2010

smotiwala smotiwala
Lab Rat
28 posts

Hi,

I was trying the above options but didn’t installs the file or folder. can you please give me working example for Qt (symbian). how do i define relative path etc.?

Thanks

December 23, 2010

smotiwala smotiwala
Lab Rat
28 posts

The code i use

  1. file1.path = Image   // folder where i want to copy splash_image.jpg
  2. file1.source = splash_image.jpg  // image file to be copied which is placed in root folder where .pro file resides
  3. DEPLOYMENTFOLDERS +=  file1

please help me what is the problem.

Thanks

December 23, 2010

Alexander Kuchumov Alexander Kuchumov
Hobby Entomologist
377 posts

if try to use DEPLOYMENT instead DEPLOYMENTFOLDERS?
edit : I forgot, you tried it:)

December 23, 2010

QtK QtK
Gene Splicer
1140 posts

smotiwala wrote:
The code i use

  1. file1.path = Image   // folder where i want to copy splash_image.jpg
  2. file1.source = splash_image.jpg  // image file to be copied which is placed in root folder where .pro file resides
  3. DEPLOYMENTFOLDERS +=  file1

please help me what is the problem.

Thanks

If your source is a file it should be DEPLOYMENT. If its folder it should be DEPLOYMENTFOLDERS.

So use it like this

  1. file1.source = Image  // Folder name
  2. DEPLOYMENTFOLDERS +=  file1

Page  
1

  ‹‹ QLineEdit problem in Qt for Symbian      How to view Images ››

You must log in to post a reply. Not a member yet? Register here!