Implement something like tar archive in windows environment
-
@Zgembo said in Implement something like tar archive in windows environment:
Now I am trying to figure out how to unpack this archive file from my program.
That library uses the same interface for all "archives" so you can use the unzip example to extract your tar archive just by changing
KZip
toKTar
-
@VRonin said in Implement something like tar archive in windows environment:
@Zgembo said in Implement something like tar archive in windows environment:
Now I am trying to figure out how to unpack this archive file from my program.
That library uses the same interface for all "archives" so you can use the unzip example to extract your tar archive just by changing
KZip
toKTar
Thank you. Figured it out already :-)
-
I have moved my project from Qt Creator to Visual studio. I can compile the project in debug mode, but when I run it I get an error
"The application was unable to start correctly (0xc000007b). Click OK to close the application"I have added lib path to Project->Properties->Linker->Additional library directories
and I have added all required dll files to Linker->Input section (bzip2.lib, liblzma.lib, zlib.lib, KF5Archive.lib, KF5Archived.lib)I have added include path to Project->Properties->C/C++/General->Additional include directories
-
That error usually comes up when you mix 32 and 64 bits version of the libraries.
-
@VRonin Yes you are right. I have copied wrong dll to debug folder, so on runtime my app tried to open these 32-bit dlls.
Where is the best way to put these .dlls for production enviroment? Should I copy all these dlls to c:\windows\system32? -
@Zgembo said in Implement something like tar archive in windows environment:
Should I copy all these dlls to c:\windows\system32
Please not! :-)
Just put them in same directory where you have your executable. -
@jsulm OK, thank you. What about my include files? Now I have my KArchive folder that have "include" and "libs" subfolders in my C:\Downloads folder. I have included this two folders with their absolute path into my project (visual studio project).
Is there a better way to do this, because this is a large project that have a lot of developers. -
@Zgembo said in Implement something like tar archive in windows environment:
because this is a large project that have a lot of developers.
Every project will have its own convention. just ask how you guys handle 3rd party libraries locations
-
OK, thank you. My test program now works in debug mode. I am having problems compiling program in RELEASE mode. For some reason it can not see qplatformdefs.h . I have double checked that path to that file is included as @VRonin stated in some of the previous posts.
-
Visual studio uses different "Additional library directories" and "Additional include directories" for different platforms (x86 and x64) and configurations (Debug/Release) so every time you have to set the same thing multiple times for each of them using the comboboxes in the top part of the properties widow of the project
-
Figured it out. Everything works now. Thank you.
-
IIRC, qmake can generate Visual Studio Solutions that should handle that for you. Worth a try at least.
-
I have moved everything to my main project and it works. Now I can tar and untar files form my main project.
Right now I am trying to figure out best way to indicate to a user that archiving or unarchiving process is in progress. I was thinking of using qprogressbar but I do not see a way to send any signal from KArchive function to qprogressbar.
Lets say that I have for example three large files to unarchive (few gigabytes). What would be the best way to somehow indicate to a user what is going on? -
@Zgembo
In cases where you cannot know the length of the process/get status,
you can use a QLabel with a animated gif.
like
-
You can use a QProgressBar with both min and max set to 0. This will give you an "infinite" animated bar.
-
@SGaist I have tried your suggestion using "infinite" progress bar, but my tar and untar functions take a lot of processing power and animation is not working.
What would be the best way to move for example my two function to another thread? I have two function tarArchive(QString, QString) and unTarArchive(QString, QString).
-
If you'd like to avoid your GUI freezing, then yes. However, you should take a look at QtConcurrent::run before diving into QThread.
-
I have tried QtConcurrent::run but I have to wait before the process (tar and untar) that I have moved to another thread finishes. So I have to use waitForFinished() and my GUI still freezes. Any suggestions?
-
@Zgembo
Hi
Maybe you can use
http://doc.qt.io/qt-5/qfuturewatcher.html#details
to avoid the waitForFinished ? -
@Zgembo How did you implement that ?