diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 60ce919..6b8af4e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,6 @@ find_package(Boost REQUIRED) +find_package(Threads REQUIRED) add_definitions(-DTIXML_USE_STL) @@ -34,6 +35,7 @@ target_link_libraries(updater tinyxml minizip # TODO - Mac and Windows version + pthread /usr/lib/libboost_thread.a ) diff --git a/src/main.cpp b/src/main.cpp index 2d0f041..716bc32 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,6 +12,9 @@ #include +#include +#include + void setupUi(UpdateInstaller* installer); int main(int argc, char** argv) @@ -43,7 +46,10 @@ int main(int argc, char** argv) installer.setPackageDir(options.packageDir); installer.setScript(&script); installer.setWaitPid(options.waitPid); + installer.run(); + boost::thread updaterThread(boost::bind(&UpdateInstaller::run,&installer)); + updaterThread.join(); return 0; }