QT4: Deploying QT Assistant inside Mac OS X bundle
Hello!
My application is using QT Assistant as a help viewer on Mac OS X. I am considering deploying QT Assistant with my application.
I want my App Bundle to be self-contained as much as possible.
I have reviewed the following options and none is good:
1) Install QT Assistant as a separate application in /Developer/Application/Qt/ or whatever.
Downsides:
- My own App Bundle is not self-contained
- I do not want an extra unexpected application to be installed to the user computer
- I have either to install QT globally or duplicate QT libs both for my app and the Assistant.
2) Install QT Assistant inside Contents/Applications subdirectory of my App Bundle (I have seen some OS X apps from Apple do this)
Downsides:
- Have to duplicate QT Libraries to both my Frameworks subdirectory as well as Frameworks subdirectory of QT Assistant.
3) Put just QT Assistant executable to my Contents/MacOS/ subdirectory of my bundle
Downsides:
- QT Assistant is launched with the same icon as my own application
What is standard or recommended way to deploy QT Assistant with QT-based software?
Re: QT4: Deploying QT Assistant inside Mac OS X bundle
Sorry for annoying, but I still did not find a suitable solution for this question. Does anyone deploy QT Assistant on Mac??
Re: QT4: Deploying QT Assistant inside Mac OS X bundle
In case someone will face this problem also - I chose the third variant.
Howto:
1) Copy Assistant (I use stripped no-webkit version) to some directory.
2) !! Copy Qt/plugins/sqldrivers/libqsqlite.dylib inside Assistant bundle
3) macdeployqt Assistant.
4) Copy MacOS, PlugIns and Frameworks directory from the Assistant bundle to your app bundle.
5) macdeployqt your application.
6) !! Make sure you have qt.conf in your app bundle directory (I have to copy it myself since I use -no-plugins for macdeployqt). Otherwise your app just crashes.
qt.conf:
[Paths]
Plugins = PlugIns
Here is the QMake pro-file code:
RESOURCE_FILES.files = Resources/Mac/qt.conf
RESOURCE_FILES.path = Contents/Resources/
QMAKE_BUNDLE_DATA += RESOURCE_FILES
QMAKE_POST_LINK += rm -r ./../Assistant/Assistant.app;
QMAKE_POST_LINK += mkdir -p ./../Assistant/Assistant.app;
QMAKE_POST_LINK += cp -R ../Assistant_nokit/Assistant.app ./../Assistant/;
# sqlite driver is necessary for assistant
QMAKE_POST_LINK += mkdir -p ./../Assistant/Assistant.app/Contents/PlugIns/sqldrivers;
QMAKE_POST_LINK += cp /Developer/Applications/Qt/plugins/sqldrivers/libqsqlite.dylib ./../Assistant/Assistant.app/Contents/PlugIns/sqldrivers;
QMAKE_POST_LINK += macdeployqt ./../Assistant/Assistant.app;
QMAKE_POST_LINK += cp ./../Assistant/Assistant.app/Contents/MacOS/Assistant ./YourApp.app/Contents/MacOS/;
QMAKE_POST_LINK += cp -R ./../Assistant/Assistant.app/Contents/Frameworks ./YourApp.app/Contents/Frameworks;
QMAKE_POST_LINK += cp -R ./../Assistant/Assistant.app/Contents/PlugIns ./YourApp.app/Contents/PlugIns;
QMAKE_POST_LINK += macdeployqt YourApp.app -dmg -no-plugins;
VoilĂ !