Recent

Author Topic: How to get OSX App to work previous OSX Versions  (Read 4504 times)

Josh

  • Hero Member
  • *****
  • Posts: 1271
How to get OSX App to work previous OSX Versions
« on: November 12, 2018, 06:49:47 pm »
Hi

Hopefully i am just missing something..

Using Laz 2.1.0 59397, fpc 3.3.1 (carbon ide)

I created a simple test app, that has just a few buttons on, Set for Carbon i386, and have "-macosx_version_min 10.6" set in project options/compilation and linking.
I created the application bundle, i then transferred the executable to MacOS folder in the bundle removing the symlink.
I would have thought this would allow it to run on 10.6 and above.

If I run this on my High Sierra ( the one its compiled on) it works, if I run it on Mojave it works, If I run in Sierra I get error "this app requires Mac OS 10.13.6 or later".

Any ideas as to what I am missing.
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1058
Re: How to get OSX App to work previous OSX Versions
« Reply #1 on: November 12, 2018, 08:38:27 pm »
Use the compiler option -WM10.6, and remove the linker option.

Josh

  • Hero Member
  • *****
  • Posts: 1271
Re: How to get OSX App to work previous OSX Versions
« Reply #2 on: November 12, 2018, 10:35:36 pm »
Hi Jonas,

I have updated laz and fpc to latest trunk 59528.
When I go Project/Options/Custom Options then Click All Options, I can scroll down the list and put the value 10.6 in the box. Click OK; but nothing is added to the list of options.
I tried doing the same on Latest Trunk on windows with OSX Cross Compiler, and the same project; when I change the value the compiler otion -WM10.6 is added to the list.
Is there a bug in the latest Trunk Custom Compiler Options?
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

MISV

  • Hero Member
  • *****
  • Posts: 783
Re: How to get OSX App to work previous OSX Versions
« Reply #3 on: November 24, 2018, 04:45:22 pm »
Did you successfully solve this? I always assumed my app would work on all recent versions - I guess not

Josh

  • Hero Member
  • *****
  • Posts: 1271
Re: How to get OSX App to work previous OSX Versions
« Reply #4 on: November 24, 2018, 09:49:25 pm »
Hi

I added the below code into custom compiler options ( Project->Options->Compiler Options->Custom Options )

Code: [Select]
if TargetOS = 'darwin' then
begin
  UsageCustomOptions += ' -WM10.6';
end;                               
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

MISV

  • Hero Member
  • *****
  • Posts: 783
Re: How to get OSX App to work previous OSX Versions
« Reply #5 on: November 27, 2018, 12:36:44 am »
Thank you - I better do this as well then. I am really surprised it is necessary. I always tagged my downloads as being Yosemite+ (10.10) compatible

VTwin

  • Hero Member
  • *****
  • Posts: 1215
  • Former Turbo Pascal 3 user
Re: How to get OSX App to work previous OSX Versions
« Reply #6 on: November 27, 2018, 01:09:52 am »
Thanks. Apparently this changed as of FPC 2.6.2. I just updated my projects:

Code: Pascal  [Select][+][-]
  1. if TargetOS = 'darwin' then begin
  2.   //UsageCustomOptions += ' -k-macosx_version_min -k10.5';
  3.   //UsageCustomOptions += ' -XR/Developer/SDKs/MacOSX10.5.sdk/';
  4.   UsageCustomOptions += ' -WM10.6';
  5. end;

Cheers,
VTwin
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.6 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.6 (64 bit on VBox)

CCRDude

  • Hero Member
  • *****
  • Posts: 596
Re: How to get OSX App to work previous OSX Versions
« Reply #7 on: December 20, 2018, 12:23:04 pm »
I'm fighting a similar thing currently. Got the latest FreePascal/Lazarus trunk/trunk checked out this morning using fpcupdeluxe, but this has happened for weeks now. I've got those UsageCustomOptions in place.

When I let the Lazarus UI create the .app bundle folder for my binary, macOS tells me the app would be designed for 10.14, while I only run 10.13.6. If I run the executable directly, it works fine.
This is even valid for the Lazarus.app created by fpcupdeluxe.

It's getting spooky... I copied an older app bundle and modified it completely for the app I was testing. Adjusted icon, Info.plist entries, etc.. Runs fine - until I rename it, or compress/decompress it, then macOS again tells me it's incompatible. Same message appears on other Macs, so it's not strictly a local curiosity. A simple "touch" to the .app and the Info.plist renders the bundle incompatible.

Has anyone experienced similar (including Lazarus.app and stock created new app bundles not working)? Any workaround?

VTwin

  • Hero Member
  • *****
  • Posts: 1215
  • Former Turbo Pascal 3 user
Re: How to get OSX App to work previous OSX Versions
« Reply #8 on: December 28, 2018, 05:52:26 am »
When I let the Lazarus UI create the .app bundle folder for my binary, macOS tells me the app would be designed for 10.14, while I only run 10.13.6. If I run the executable directly, it works fine.

Strange. I don't know the answer, but have you looked at the info.plist LSMinimumSystemVersion entry in your application bundle? Mine shows:

Code: Pascal  [Select][+][-]
  1. <key>LSMinimumSystemVersion</key>
  2.   <string>10.5.0</string>


What value do you see?
« Last Edit: December 28, 2018, 05:54:37 am by VTwin »
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.6 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.6 (64 bit on VBox)

CCRDude

  • Hero Member
  • *****
  • Posts: 596
Re: How to get OSX App to work previous OSX Versions
« Reply #9 on: January 07, 2019, 08:01:32 pm »
My apologies for the late reply, I didn't work between the years.

My actual setting was:
Code: XML  [Select][+][-]
  1.     <key>LSMinimumSystemVersion</key>
  2.     <string>10.12.6</string>

I have tried with 10.5.0 as well, and without a minimum system version. Since I run 10.13.6, both should work.

I've been browsing /var/log/ to see if I can find anything logged about this, but did not find anything.

If no one else is experiencing this issue (should be quite visible, since here it even affects Lazarus.app), it's most likely some local problem on my Mac. But it only happens with Lazarus apps.

 

TinyPortal © 2005-2018