Skip to main content
Known Participant
July 23, 2025
Answered

How to determine Platform and Architecture via SDK

  • July 23, 2025
  • 1 reply
  • 219 views

I have a plugin that uses external binaries.  I have binaries for Windows, Mac ARM, and Mac AMD that I provide with my plugin.  When I run 

LrTasks.execute, I need to determine which one to use.  I have searched all over the SDK, but have not been able to find anyway to determine which one to run.  Any suggestions for introspection?
 
Paul
Correct answer johnrellis

Use the built-in global booleans MAC_ENV and WIN_ENV to determine whether LR is running on Mac or Windows. Then call LrSystemInfo.architecture() to determine the CPU architecture. I think the current possible values are "x64" (for Intel and AMD) and "arm64" (for ARM). I don't think it distinguishes between Intel and AMD -- do you need that granularity?  (I can't test because I only have Mac ARM and Win ARM test machines.)

1 reply

johnrellis
johnrellisCorrect answer
Legend
July 23, 2025

Use the built-in global booleans MAC_ENV and WIN_ENV to determine whether LR is running on Mac or Windows. Then call LrSystemInfo.architecture() to determine the CPU architecture. I think the current possible values are "x64" (for Intel and AMD) and "arm64" (for ARM). I don't think it distinguishes between Intel and AMD -- do you need that granularity?  (I can't test because I only have Mac ARM and Win ARM test machines.)

PaulWaldoAuthor
Known Participant
July 23, 2025

Ah, I see it in the SDK Guide (now that I know what to look for 🙂 )  I do need the granularity, as my binaries are golang compiled code for each of the M-series and Intel CPUs.  The Oracle of GPT says "To create a universal binary that runs on both Intel and Apple Silicon, you can build two separate binaries and then use the lipo tool to combine them."  That way may just do the trick and all I need is MAC_ENV and WIN_ENV!

 

As always, thank you for your sage advice!