Passing target directory from QT Installer to the Application
-
I am planning to deploy my application to macOS and Windows. Upon reading the documentation of QT Installer Framework, I understand that I can provide a default installation path in the config xml which the user can overwrite.
In my application, I want to generate license files based on the installation path decided by the user. Hence, I need to have the installation path selected by the user passed to the application.
Is there a way that I can get the target installation directory selected by the user in the application.
Thanks.
-
Hi
Just thinking out loud here.
Do you really need to pass the path to your app?in your app
qDebug() << "App path : " << qApp->applicationDirPath();should tell you where 'you' were installed.
So if the license files are not there, then you can read the path and generate it on the first run. -
Hi,
One thing to take into account: if installed properly, you won't be able to write anything in the application folder as their location shall be read-only and on macOS you shall not modify the application bundle content. You should rather store the license file in an application specific storage path provided by QStandardPaths.
-
@SGaist
hi
A very good point that might also hold true for other platforms as well.
Also, care should be taken that the location used for "generate license "
is not affected by the user changing the Os language after app is installed. -
@mrjj said in Passing target directory from QT Installer to the Application:
A very good point that might also hold true for other platforms as well.
Depending, if you do a "proper" install under Windows it will go into
\Program Files ...
and under Linux into/usr/...
. Neither of which are writeable by your average user, so this is not just a Mac issue :) -
@SGaist @mrjj When I check the writable locations available on macOS with QStandardPaths, I only get user specific path :
"/Users/faisalkhan/Library/Application Support/Fairlinx/RapidFSM/"Which tells me that the files would not be available system wide : To other users.
QStandardPaths with AppDataLocation shows a system wide path such as:
"/Library/Application Support/Fairlinx/RapidFSM/" as non-writable path.Any workaround you would suggest to write the files to the later location.
Thanks.
-
You have to request higher privileges from your user to be able to write there.