When I send openFrameworks app to my frined, app does not find data folder. This is because of "translocation", known issue on openFrameworks forum. There are couple of solution to avoid translocation but here I tried different way by codesigning. But quesion is, is it possible to codesign wihout Apple Developer license? Looks like possible...? https://stackoverflow.com/questions/27474751/how-can-i-codesign-an-app-without-being-in-the-mac-developer-program/27474942
-
Open Keychain Access.
-
Choose Keychain Access > Certificate Assistant > Create Certificate ...
-
Enter a name
- just use xcode and compile
cd to/oF/apps/myApp
sudo codesign -fs "my-new-cert" myApp.app/Contents/Frameworks/libfmodex.dylib
sudo codesign -fs "my-new-cert" myApp.app
sudo codesign -dv myApp.app
- zip app with data folder
- send or upload app via internet
- open
Do you want to put /data folder inside of the myApp.app?
- Call
ofSetDataPathRoot("../Resources/data/");
function from main.cpp or ofApp.cpp - Compile app with AppStore scheme
- Make sure you have all data in myApp.app/Contents/Resources/data
- Codesign like explained above
- Done! Now you have codesigned, no security alarm, single package app ready to send to your friend.
I recommend to call ofSetDataPathRoot() in the very begining of main.cpp like example below.
#include "ofMain.h"
#include "ofApp.h"
int main(){
ofSetDataPathRoot("../Resources/data/");
ofSetupOpenGL(1920,1080,OF_WINDOW);
ofRunApp(new ofApp());
}
If we call ofSetDataPathRoot() in ofApp::setup(), app could crash or missing data. For example you have custom class which load data in its constructor, it can not find data. This is because your constructor can be called before ofApp::setup(), hence it try to find default data path)