Qt app on mac
-
@SGaist
With application bundle you mean the compiled installer, if I understand correctly.
My MyAppInstaller.app structure is as follows:- MyAppInstaller.app
- Contents
- Frameworks
- Info.plist
- MacOS
- MyAppInstaller
- PkgInfo
- Resources
- MyAppInstaller.icns
- installer.dat
Now that you asked the question I wonder where it should be located....
- Contents
- MyAppInstaller.app
-
What does the installer do exactly ?
-
@SGaist
(I realised the structure was weirdly missformed, I edited it.)
The Installer is supposed to install MyApp in the "home directory" which works fine.
The App is later supposed to start automatically at boot, therefor when the installation-wizard it done, the App is supposed to start automatically.
(Basically the user shouldn't open the App themselves at all)
I hope that helped. -
How do you start the application at the end of the installation process ?
By the way, why the home directory ? That feels odd with regard to macOS standards.
-
I use the home directory right now, just to have something to test with. I want to change it later, so the user can choose the directory themselves.
This is the code, to call the application after the installation process:
function Component() { installer.installationFinished.connect(this, Component.prototype.installationFinishedPageIsShown); installer.finishButtonClicked.connect(this, Component.prototype.installationFinished); } Component.prototype.createOperations = function() { component.createOperations(); } Component.prototype.installationFinishedPageIsShown = function() { try { if (installer.isInstaller() && installer.status == QInstaller.Success) { installer.addWizardPageItem( component, "page", QInstaller.InstallationFinished ); } } catch(e) { console.log(e); } } Component.prototype.installationFinished = function() { try { if (installer.isInstaller() && installer.status == QInstaller.Success) { installer.executeDetached(installer.value("TargetDir") + "/myapp/./main.py"); } } catch(e) { console.log(e); } } -
@T_oni said in Qt app on mac:
/myapp/./main.py
That's a strange path.
Why not start the app bundle ?
-
That is the app bundle (At least in my understanding).
That is the installed app and inside it (the main.py) is the main code.
Or is it not? I'm sorry, maybe I didn't understand it correctly?@T_oni You should not call anything inside the bundle. By default the bundle (.app) is the only executable you should call.
More info https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW13How do you deploy bundle, how do you put deployment files in it? Does it pass the validation from Gatekeeper? Do you sign the code properly?
-
@T_oni You should not call anything inside the bundle. By default the bundle (.app) is the only executable you should call.
More info https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW13How do you deploy bundle, how do you put deployment files in it? Does it pass the validation from Gatekeeper? Do you sign the code properly?
@artwaw
Thank you for the link, I will read the information.I used this command to make the executable app with Qt Installer Framework:
/Users/myname/Documents/qtinstallerframeworkmac/bin/binarycreator -c config/config.xml -p packages MyAppInstaller.appWith this command I than have the installer, that the user is supposed to double-click on to install MyApp. When MyApp is installed it is a folder-structure. And inside that is the main.py that I am executing after the installer is finished. However that only works when I execute the installer over open command.
I unfortunately don't know what you mean with "validation from Gatekeeper".
I'm going to look into it, though. Thank you.
Edit: I have looked into it, however until now I didn't run into Gatekeeper at all with my application. So I'm not sure, if this has anything to do with it. And if, why does my app run fine, when I execute the installer over the terminal? -
Hello,
I hope I’m even correct to ask this question here.
I am working on an app in Qt. The goal is, that the app is running on linux, mac and windows.
Right now I ran into a problem on mac.
So about the app:
The interface is built with Qt Creator, however any code I wrote myself is python.
I am using a MacBook Air with Big Sur 11.3.1.
I am using Qt 5.14.2With this Code:
from qtpy import uic
uic.compileUiDir(“ui”)
I’m converting the C++ code to python code so I can work with it.I have successfully created an installer for mac with the Qt Installer Framework. I have a wizard which is running fine. After clicking on the “done”-button of the installation wizard, the ui is supposed to open automatically.
Now to the problem:
When I use the open command (like this: open MyAppInstaller.app) everything is working just fine. The wizard runs through without problem and the ui opens after hitting the “done”-button.
However when double-clicking the MyAppInstaller.app the wizard is running completely fine BUT the ui just doesn’t open. And I have no idea why. I’m really confused about this and can’t really find anything that helps.
I’m not sure if it’s a difference in the way I open the installer or if it has anything to do with my code. But I feel like, if it was my code the wizard wouldn’t work either….Does anybody have any idea?
Edit: I solved it. Or better said, the problem is gone.
I made the application executable by using pyinstaller. I used to just give the command my path to the application. However, my application runs in a virtual environment.
Installing pyinstaller in said virtual environment and executing the command while still in the virtual env, the problem with the double-click was resolved.