megastep / makeself

A self-extracting archiving tool for Unix systems, in 100% shell script.
https://makeself.io
GNU General Public License v2.0
2.31k stars 372 forks source link

[SOLVED] macOS: app translocation preventing any installation #145

Closed JayBrown closed 6 years ago

JayBrown commented 6 years ago

I have successfully created a makeself command on macOS, using the .command extension instead of .run, so it will be automatically opened & executed in Terminal.

It executed, but it didn't install anything. So I added an echo "$PWD" command to the after-extraction script, and the result is always e.g. /var/folders/jf/my8xnjkx1jxukx_fx1q205r01050hm/T/selfgz4178853260 which means that App Translocation (aka "Path Randomization") occurred, essentially meaning that you can't use makeself anymore to install something on macOS.

Normally, App Translocation only occurs if the quarantine extended attribute is set, and if a process isn't codesigned. In this case, there is no code signature, but no quarantine xattr either, because it wasn't downloaded from anywhere (still testing locally), so translocation shouldn't occur. But for some reason it does.

Anyone who has gotten makeself to work on modern versions of macOS?

JayBrown commented 6 years ago

Tried uploading to and re-downloading from a filehoster. Then removed the quarantine xattr. Still being translocated.

JayBrown commented 6 years ago

Found the reason: it's the temp directory created by the makeself installer script in /tmp/<dirname>. If I used --notemp or an extraction directory somewhere in $HOME, then it worked.