run application on startup (raspberry PI)
I am study and trying with QT for device (I am very noob), the question is simple, it is possible to run my own application on raspberry startup? Thanks for your help I hope that i can help you too!
the easiest way would be to add your program to
hi dear! thanks for your fast reply, i got a few questions, when you say (rc.localin /etc.) you mean to rootfs/etc?, i am trying to paste the project there but i Cant, i press right click but the paste option is no enabled. How can I add my program to start in the boot?
My method is wrong?. Thanks!
dear! i found the option:
Project > Run settings > Deployment "Make this application the default one". when i turn on my raspberry PI i have a small QT introduction and my application starts automatically, now, how i can do to turn on my application immediately when i turn on the raspberry pi (without QT introduction)?
Normally you deploy your program to a folder say
/etc/rc.localis a bash script that is run on startup. So just add a
line to the bottom of this file pointing to your program.
See https://www.raspberrypi.org/documentation/linux/usage/rc-local.md for more information.
no dear, i got in the raspberry the boot2QT i does not have that directory... ONLY way is "Make this application the default one" in Run settings. Regards!
i finally find that i was wanted for a long time is here:
Include this header QSettings
Add this into your code.
QSettings settings("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run", QSettings::NativeFormat); settings.setValue("YourApplicationName", QCoreApplication::applicationFilePath().replace('/', '\\'));
And when you want to disable startup`
Include this header QSettings [...]
This is a windows specific answer - but Qt4Devices / Boot2Qt is linux based...
So your answer might be corrent for windows platforms but does not match to this question :-)