Exported app is not working; having a permissions error (maybe)

edited March 2016 in Library Questions

I built the following app using the video library to capture images from the webcam. It runs fine from the PDE. I also exported the app and it works on my computer. However, it is not working on other people's computers. So, far, I have onyl tested the Mac export (Java embedded).

The code:

import processing.video.*;

Capture cam;

PImage people;
PGraphics peopleMask;
int x1, x2, y1, y2;

void setup() {
  size(1280, 720);
  background(192);
//size is set to largest available camera
  String[] cameras = Capture.list();

  if (cameras.length == 0) {
    println("There are no cameras available for capture.");
    exit();
  } else {
    println("Available cameras:");
    for (int i = 0; i < cameras.length; i++) {
      println(cameras[i]);
    }
    cam = new Capture(this, cameras[0]);
    cam.start();     
  }      

  noStroke();

  peopleMask = createGraphics(width,height);

}

void draw() {

   x1 = int(random(-20,width));
  x2 = int(random(5,width/10));
  y1 = int(random(-20,height));
  y2 = int(random(10,height/2));

  peopleMask.beginDraw();
  peopleMask.fill(0);
  peopleMask.rect(0,0,width,height);
  peopleMask.fill(255);
  peopleMask.rect(x1,y1,x2,y2);
  peopleMask.endDraw();  

  if (cam.available() == true) {
    cam.read();
    cam.mask(peopleMask);
    image(cam, 0, 0);
  }

}

My friend just emailed me the following; it originally did not on his computer but did later:

I looked at this more today. The root error was about permissions to launch:

3/23/16 10:42:26.569 AM com.apple.xpc.launchd[1]: (eFelt.317472[5205]) Could not find and/or execute program specified by service: 13: Permission denied: /Users/ejerrett/Desktop/eFelt_1280x720.app/Contents/MacOS/eFelt

I performed a chmod (via Terminal) and now I can launch it and it runs fine:

chmod -R 755 ~/Desktop/eFelt_1280x720.app/

How can I export this without causing permissions problems?

Sign In or Register to comment.