View Single Post
marxian's Avatar
Posts: 2,448 | Thanked: 9,523 times | Joined on Aug 2010 @ Wigan, UK
#10
Originally Posted by flotron View Post
i added the script folder with script.sh inside but (with right click to project, add existing file) when i install i explore the opt folder on phone and i only see "bin" and "qml" folders.

This is the pro file:
OTHER_FILES += \
qtc_packaging/debian_harmattan/rules \
qtc_packaging/debian_harmattan/README \
qtc_packaging/debian_harmattan/manifest.aegis \
qtc_packaging/debian_harmattan/copyright \
qtc_packaging/debian_harmattan/control \
qtc_packaging/debian_harmattan/compat \
qtc_packaging/debian_harmattan/changelog \
script/script.sh
In your .pro file, you need something like this:

Code:
script.path = /opt/<application_name>/script
script.files += script/script.sh

INSTALLS += script
The example assumes that the script folder is a direct subfolder of your main project folder. In the ScriptLauncher, you set the command to "sh /opt/<application_name>/script/script.sh", or you could change the launchScript() method to take a QString argument, and you would then be able to launch different scripts from QML (there is also the option of subclassing QProcess and exposing its methods/properties to QML, which would ultimately be more flexible).
__________________
'Men of high position are allowed, by a special act of grace, to accomodate their reasoning to the answer they need. Logic is only required in those of lesser rank.' - J K Galbraith

My website

GitHub
 

The Following 2 Users Say Thank You to marxian For This Useful Post: