Results 1 to 3 of 3

Thread: Distribute app with directories intacked

  1. #1
    Join Date
    Jul 2010
    Location
    TN
    Posts
    10
    Thanks
    2
    Qt products
    Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows Android

    Question Distribute app with directories intacked

    Good afternoon everyone,

    I have a question I am hoping someone can help with. I was trying to find out if, when an app is finally built, if there is a way to keep a directory structure within the final build so that the directories are able to distributed with the app?

    Example, if I build an app with a "doc" directory and an "image" directory, is there a way to keep those directories once the app is built successfully. (I kinda like structure in my apps lol)

    Would like to be able to do this and when I distribute the app all the user has to do is unzip it, all directories will be there, and then run when needed. If anyone can give some insight on this I would greatly appreciate it. QT has been such a pleasure to work with that I have literally stopped using MS Visual Studio, which was the only thing keeping me using windows.

    Many thanks for any assistance

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Distribute app with directories intacked

    If your application relies on having hard-coded paths to places where it accesses files (a really, really bad idea most of the time, by the way), then there are any number of ways to ensure that:

    - use an actual installer that creates (and populates) these directories when your app is installed
    - look for and create the directories when the app is run up if they don't exist
    - if you distribute your app as a zip file, then add those directories when you create the zip file. They will be created when the file is unzipped.

    Why is it a really, really bad idea to create hard-coded directories?

    - On Windows 10, apps run with ordinary User permission aren't allowed to create files or directories in Program Files or Program Files (x86)
    - Having hard-coded files runs counter to the Windows preferred method of having app-specific data in AppData and user-specific data under Users.
    - Maybe the user has a small solid state disk as a C: drive, and doesn't want it cluttered up with app-related data files, or maybe has several PCs and keeps the stuff he wants to move from PC to PC on a removable USB drive (like I do).

    Qt has a whole set of OS-friendly ways to create App and User-specific files at run-time (see QStandardPaths), as well as to run standard programs (see QDesktopServices). You can also Google for Qt Windows deployment and read all about what is required to successfully deploy a Qt app on a system where no Qt development tools are installed.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Jul 2010
    Location
    TN
    Posts
    10
    Thanks
    2
    Qt products
    Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows Android

    Default Re: Distribute app with directories intacked

    d_stranz

    Thank you very much for your reply. I appreciate the information and it makes very good sense, got me thinking twice about doing it now lol. I also appreciate the links to the documentation for this. Was doing some searching but wasn't sure what to look for in regards to the classes etc. that this specific question fell into. I will be reading through them today to learn more.

    Many thanks

Similar Threads

  1. How to safely distribute under LGPL
    By mchome in forum General Discussion
    Replies: 7
    Last Post: 7th October 2012, 22:23
  2. Replies: 1
    Last Post: 12th September 2012, 12:46
  3. Finished my project, how do I distribute it?
    By danoc93 in forum Installation and Deployment
    Replies: 6
    Last Post: 16th May 2012, 21:20
  4. Return number of directories in a directories
    By franco.amato in forum Newbie
    Replies: 7
    Last Post: 29th September 2010, 23:29
  5. Distribute a executable
    By xgoan in forum Installation and Deployment
    Replies: 9
    Last Post: 6th October 2006, 12:51

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.