New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"openFrameworks path is wrong" issue #138

Closed
icq4ever opened this Issue Oct 19, 2016 · 22 comments

Comments

Projects
None yet
6 participants
@icq4ever

icq4ever commented Oct 19, 2016

screen shot 2016-10-19 at 5 36 16 pm

recently I downloaded new oF 0.9.4. projects.
everytime launch projectGenerator, it says path is wrong.
I never had issue before. is there anyone who have same problem?

@ofZach

This comment has been minimized.

Show comment
Hide comment
@ofZach

ofZach Oct 19, 2016

Contributor

what OS are you running?

this looks like some kind of security thing -- that the app is being run in another location where changes don't get saved... investigating...

Contributor

ofZach commented Oct 19, 2016

what OS are you running?

this looks like some kind of security thing -- that the app is being run in another location where changes don't get saved... investigating...

@icq4ever

This comment has been minimized.

Show comment
Hide comment
@icq4ever

icq4ever Oct 19, 2016

running on macOS 10.12 / xCode 8.0

still I have oF0.9.3, different directory. but I didn't run projectGenerator at the same time.

icq4ever commented Oct 19, 2016

running on macOS 10.12 / xCode 8.0

still I have oF0.9.3, different directory. but I didn't run projectGenerator at the same time.

@ofZach

This comment has been minimized.

Show comment
Hide comment
@ofZach

ofZach Oct 19, 2016

Contributor

ugh it's maybe something related to this maybe?

http://lapcatsoftware.com/articles/app-translocation.html
https://eclecticlight.co/2016/06/16/macos-sierra-will-break-many-installers-and-updaters/

Starting in OS X v10.12, you can no longer provide external code or data alongside your code-signed app in a zip archive or unsigned disk image. An app distributed outside the Mac App Store runs from a randomized path when it is launched and so cannot access such external resources.

I will look into a fix, not running 10.12 yet but I'll get a machine up to speed and take a look.

Contributor

ofZach commented Oct 19, 2016

ugh it's maybe something related to this maybe?

http://lapcatsoftware.com/articles/app-translocation.html
https://eclecticlight.co/2016/06/16/macos-sierra-will-break-many-installers-and-updaters/

Starting in OS X v10.12, you can no longer provide external code or data alongside your code-signed app in a zip archive or unsigned disk image. An app distributed outside the Mac App Store runs from a randomized path when it is launched and so cannot access such external resources.

I will look into a fix, not running 10.12 yet but I'll get a machine up to speed and take a look.

@icq4ever

This comment has been minimized.

Show comment
Hide comment
@icq4ever

icq4ever Oct 19, 2016

aha.. I see.. though sounds complicate..

icq4ever commented Oct 19, 2016

aha.. I see.. though sounds complicate..

@arturoc

This comment has been minimized.

Show comment
Hide comment
@arturoc

arturoc Oct 19, 2016

Member

in linux i set the OF_PG_PATH environment var in $HOME/.profile through the install script (could be done the first time the path is set) which also makes it way easier to use the command line tool directly from the console

Member

arturoc commented Oct 19, 2016

in linux i set the OF_PG_PATH environment var in $HOME/.profile through the install script (could be done the first time the path is set) which also makes it way easier to use the command line tool directly from the console

@icq4ever

This comment has been minimized.

Show comment
Hide comment
@icq4ever

icq4ever Oct 19, 2016

@arturoc yes I guess.. so I tried to find something like PG_PATH in OSX but I cannot find yet :(

icq4ever commented Oct 19, 2016

@arturoc yes I guess.. so I tried to find something like PG_PATH in OSX but I cannot find yet :(

@ofTheo

This comment has been minimized.

Show comment
Hide comment
@ofTheo

ofTheo Oct 19, 2016

Contributor

If you put your OF folder and project generator inside /Users/YourUserFolder/Applications/OF/ does it work then?

Contributor

ofTheo commented Oct 19, 2016

If you put your OF folder and project generator inside /Users/YourUserFolder/Applications/OF/ does it work then?

@icq4ever

This comment has been minimized.

Show comment
Hide comment
@icq4ever

icq4ever Oct 20, 2016

@ofTheo Yeah! it works!!! I just moved "projectGenerator.app" from OF_ROOT/projectGenerator-osx to /Applications

screen shot 2016-10-20 at 9 01 18 am

icq4ever commented Oct 20, 2016

@ofTheo Yeah! it works!!! I just moved "projectGenerator.app" from OF_ROOT/projectGenerator-osx to /Applications

screen shot 2016-10-20 at 9 01 18 am

@icq4ever icq4ever closed this Oct 20, 2016

@ofTheo

This comment has been minimized.

Show comment
Hide comment
@ofTheo

ofTheo Oct 20, 2016

Contributor

@ofZach - maybe we could add an Install-Instructions-OSX.txt or something like that to the projectGenerator-osx/ folder?

@arturoc what would be the correct way to get this to pull in for the OF releases?

Contributor

ofTheo commented Oct 20, 2016

@ofZach - maybe we could add an Install-Instructions-OSX.txt or something like that to the projectGenerator-osx/ folder?

@arturoc what would be the correct way to get this to pull in for the OF releases?

@ofZach

This comment has been minimized.

Show comment
Hide comment
@ofZach

ofZach Oct 20, 2016

Contributor

I am not sure this is the best fix :) maybe the command line xattr will be better since the PG will stay in place? (In my opinion the PG should be in the download folder so it's all relative). Since we alter the PG per release, it can be confusing if we separate the app from the release.

I haven't had a chance to test this, but it seems like there's some sort of script we can add which would fix the app by removing the "com.apple.quarantine" attributes which are getting added. it require su but I think it would basically fix the flags that are making it run in it's own read only space....

Contributor

ofZach commented Oct 20, 2016

I am not sure this is the best fix :) maybe the command line xattr will be better since the PG will stay in place? (In my opinion the PG should be in the download folder so it's all relative). Since we alter the PG per release, it can be confusing if we separate the app from the release.

I haven't had a chance to test this, but it seems like there's some sort of script we can add which would fix the app by removing the "com.apple.quarantine" attributes which are getting added. it require su but I think it would basically fix the flags that are making it run in it's own read only space....

@jedahan

This comment has been minimized.

Show comment
Hide comment
@jedahan

jedahan Oct 24, 2016

Can we re-open this issue until we find an xattr-based fix?

It seems like we might not need sudo if the application is owned by the current user...

jedahan commented Oct 24, 2016

Can we re-open this issue until we find an xattr-based fix?

It seems like we might not need sudo if the application is owned by the current user...

@icq4ever icq4ever reopened this Oct 25, 2016

@icq4ever

This comment has been minimized.

Show comment
Hide comment
@icq4ever

icq4ever commented Oct 25, 2016

@jedahan re-opend.

@ofZach

This comment has been minimized.

Show comment
Hide comment
@ofZach

ofZach Oct 25, 2016

Contributor

I don't have a 10.12 machine (am traveling) but if someone with access can test, it should be using xattr -d from this write up

http://mjtsai.com/blog/2016/06/16/gatekeeper-path-randomization/

maybe tweaking something like this line:

http://apple.stackexchange.com/questions/87313/how-to-remove-xattr-com-apple-quarantine-from-all-webarchive-files-with-that-ex

find . -iname '*.webarchive' -print0 | xargs -0 xattr -d com.apple.quarantine

for something more appropriate (I don't know if we need to recursively do xattr -d or if there's one file we need to touch, etc)

testing is greatly appreciated !

Contributor

ofZach commented Oct 25, 2016

I don't have a 10.12 machine (am traveling) but if someone with access can test, it should be using xattr -d from this write up

http://mjtsai.com/blog/2016/06/16/gatekeeper-path-randomization/

maybe tweaking something like this line:

http://apple.stackexchange.com/questions/87313/how-to-remove-xattr-com-apple-quarantine-from-all-webarchive-files-with-that-ex

find . -iname '*.webarchive' -print0 | xargs -0 xattr -d com.apple.quarantine

for something more appropriate (I don't know if we need to recursively do xattr -d or if there's one file we need to touch, etc)

testing is greatly appreciated !

@jedahan

This comment has been minimized.

Show comment
Hide comment
@jedahan

jedahan Oct 25, 2016

@ofZach I was able to get it working with

sudo xattr -d OF_ROOT/projectGenerator-osx/*app

I will test working without the sudo.

I do not think we will be able to automate this without user interaction, because then like, what would be the point of the quarantine?

jedahan commented Oct 25, 2016

@ofZach I was able to get it working with

sudo xattr -d OF_ROOT/projectGenerator-osx/*app

I will test working without the sudo.

I do not think we will be able to automate this without user interaction, because then like, what would be the point of the quarantine?

@ofZach

This comment has been minimized.

Show comment
Hide comment
@ofZach

ofZach Oct 25, 2016

Contributor

I think it's ok if we include maybe a readme (like OSX_10_12_README.txt) and a sticky forum post for the meantime while we figure out how to sign the app and dmg which might take some time.

Contributor

ofZach commented Oct 25, 2016

I think it's ok if we include maybe a readme (like OSX_10_12_README.txt) and a sticky forum post for the meantime while we figure out how to sign the app and dmg which might take some time.

@ofTheo

This comment has been minimized.

Show comment
Hide comment
@ofTheo

ofTheo Oct 25, 2016

Contributor

@jedahan from testing on 10.9 it looks like sudo isn't needed, but the correct command should be:

 xattr -d com.apple.quarantine OF_ROOT/projectGenerator-osx/projectGenerator.app

without the com.apple.quarantine the command succeeds but it doesn't remove the quarantine file.

So simply we could add a 10.12-Users-RunMeFirst.sh or something to the PG folder.

Contributor

ofTheo commented Oct 25, 2016

@jedahan from testing on 10.9 it looks like sudo isn't needed, but the correct command should be:

 xattr -d com.apple.quarantine OF_ROOT/projectGenerator-osx/projectGenerator.app

without the com.apple.quarantine the command succeeds but it doesn't remove the quarantine file.

So simply we could add a 10.12-Users-RunMeFirst.sh or something to the PG folder.

@jedahan

This comment has been minimized.

Show comment
Hide comment
@jedahan

jedahan Oct 25, 2016

Wait, if the app launched, first gets copied to /var/private/blablabla, does that mean we could just do:

ofSystem("xattr -d com.apple.quarantine OF_ROOT/projectGenerator-osx/projectGenerator.app");

assuming we can get OF_ROOT from a launched app?

jedahan commented Oct 25, 2016

Wait, if the app launched, first gets copied to /var/private/blablabla, does that mean we could just do:

ofSystem("xattr -d com.apple.quarantine OF_ROOT/projectGenerator-osx/projectGenerator.app");

assuming we can get OF_ROOT from a launched app?

@jedahan

This comment has been minimized.

Show comment
Hide comment
@jedahan

jedahan Oct 25, 2016

We should see if we can set this before zipping, in our build script. It is possible xcode adds it, and we can avoid having to remove it after unzipping. ref: Homebrew/homebrew-cask#17540

jedahan commented Oct 25, 2016

We should see if we can set this before zipping, in our build script. It is possible xcode adds it, and we can avoid having to remove it after unzipping. ref: Homebrew/homebrew-cask#17540

@ofZach

This comment has been minimized.

Show comment
Hide comment
@ofZach

ofZach Oct 26, 2016

Contributor

I think it's the browser that's adding these flags on the download.

I think it's possible for the PG to call a shell script also -- in the case, we could have the user find OF, fix the PG and even relaunch it if we are quarantined (ie, does are current working directory look like /private/var/etc...) on first launch.

a shell script and note is good too

Contributor

ofZach commented Oct 26, 2016

I think it's the browser that's adding these flags on the download.

I think it's possible for the PG to call a shell script also -- in the case, we could have the user find OF, fix the PG and even relaunch it if we are quarantined (ie, does are current working directory look like /private/var/etc...) on first launch.

a shell script and note is good too

@arturoc arturoc closed this in 4358ddd Oct 31, 2016

@arturoc

This comment has been minimized.

Show comment
Hide comment
@arturoc

arturoc Oct 31, 2016

Member

i've added some code in the frontend to detect if we are running on sierra from /private and if that's the case show a different error message saying that you are running on osx sierra or later and need to set the correct OF path for security reasons. once you choose the OF path it'll set remove the quarantine attribute from the .app in that folder's PG

i'm preparing a 0.9.7 release with some other fixes, will include this too

Member

arturoc commented Oct 31, 2016

i've added some code in the frontend to detect if we are running on sierra from /private and if that's the case show a different error message saying that you are running on osx sierra or later and need to set the correct OF path for security reasons. once you choose the OF path it'll set remove the quarantine attribute from the .app in that folder's PG

i'm preparing a 0.9.7 release with some other fixes, will include this too

@lauramartinezpalacio

This comment has been minimized.

Show comment
Hide comment
@lauramartinezpalacio

lauramartinezpalacio Aug 8, 2018

https://www.youtube.com/watch?v=TiS6yyX1ADI
FAST AND EASY SOLUTION
NOTE: DO THIS ALWAYS THE PROGRAM IS OPENED.

lauramartinezpalacio commented Aug 8, 2018

https://www.youtube.com/watch?v=TiS6yyX1ADI
FAST AND EASY SOLUTION
NOTE: DO THIS ALWAYS THE PROGRAM IS OPENED.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment