diff options
-rwxr-xr-x | TOOLS/osxbundle.py | 6 | ||||
-rw-r--r-- | TOOLS/osxbundle/mpv.app/Contents/Info.plist | 4 | ||||
-rw-r--r-- | osdep/macosx_application.m | 9 |
3 files changed, 7 insertions, 12 deletions
diff --git a/TOOLS/osxbundle.py b/TOOLS/osxbundle.py index bf08061c31..bd1ab45a58 100755 --- a/TOOLS/osxbundle.py +++ b/TOOLS/osxbundle.py @@ -38,10 +38,6 @@ def apply_plist_template(plist_file, version): for line in fileinput.input(plist_file, inplace=1): print(line.rstrip().replace('${VERSION}', version)) -def create_bundle_symlink(binary_name, symlink_name): - os.symlink(os.path.basename(binary_name), - os.path.join(target_directory(binary_name), symlink_name)) - def bundle_version(): if os.path.exists('VERSION'): x = open('VERSION') @@ -72,8 +68,6 @@ def main(): copy_bundle(binary_name) print("> copying binary") copy_binary(binary_name) - print("> create bundle symlink") - create_bundle_symlink(binary_name, "mpv-bundle") print("> generating Info.plist") apply_plist_template(target_plist(binary_name), version) diff --git a/TOOLS/osxbundle/mpv.app/Contents/Info.plist b/TOOLS/osxbundle/mpv.app/Contents/Info.plist index 2c52d16d91..e239dc74f9 100644 --- a/TOOLS/osxbundle/mpv.app/Contents/Info.plist +++ b/TOOLS/osxbundle/mpv.app/Contents/Info.plist @@ -173,7 +173,7 @@ </dict> </array> <key>CFBundleExecutable</key> - <string>mpv-bundle</string> + <string>mpv</string> <key>CFBundleIconFile</key> <string>icon</string> <key>CFBundleIdentifier</key> @@ -192,6 +192,8 @@ <dict> <key>MallocNanoZone</key> <string>0</string> + <key>MPVBUNDLE</key> + <string>true</string> </dict> <key>CFBundleURLTypes</key> <array> diff --git a/osdep/macosx_application.m b/osdep/macosx_application.m index ff8fac6cbb..73503ad66c 100644 --- a/osdep/macosx_application.m +++ b/osdep/macosx_application.m @@ -310,10 +310,10 @@ static void init_cocoa_application(bool regular) }); } -static bool bundle_started_from_finder(char **argv) +static bool bundle_started_from_finder() { - NSString *binary_path = [NSString stringWithUTF8String:argv[0]]; - return [binary_path hasSuffix:@"mpv-bundle"]; + NSString* bundle = [[[NSProcessInfo processInfo] environment] objectForKey:@"MPVBUNDLE"]; + return [bundle isEqual:@"true"]; } static bool is_psn_argument(char *arg_to_check) @@ -338,7 +338,6 @@ static void setup_bundle(int *argc, char *argv[]) @"/opt/local/bin", @"/opt/local/sbin"]; setenv("PATH", [path_new UTF8String], 1); - setenv("MPVBUNDLE", "true", 1); } int cocoa_main(int argc, char *argv[]) @@ -351,7 +350,7 @@ int cocoa_main(int argc, char *argv[]) ctx.argc = &argc; ctx.argv = &argv; - if (bundle_started_from_finder(argv)) { + if (bundle_started_from_finder()) { setup_bundle(&argc, argv); init_cocoa_application(true); } else { |