I have the need to create an Intel-only version of a tool (large client requirement). To do this and support the binary helper tools involved, I create a Helpers tarball that is extracted on first launch. To separate the Helpers, I create two versions of this file:
OHelpers-Universal.tgz
OHelpers-Intel.tgz
What I would like to do is to only copy the required helper based on the build platform (Intel or Any) and then rename it to the more generic OHelpers.tgz for the app.
Is there a flag that I can check either at build time to allow me to script the proper copy and rename (best), or determine at runtime if the app is Intel or Universal so I know which named file to extract?
My immediate solution is to copy both helper tar balls into Resources and then check for the platform going back to El Capitan using @Christian_Schmitz fantastic SystemInformationMBS class.
During compile/run time, you could also resolve this using two different CopyScripts – one for Universal, one for Intel, and before them a script like this one which en/disables the appropriate CopyScript.
If CurrentBuildTarget = 9 Then // macOS UB
PropertyValue("CopyUniversalScript.Applies To") = "0"
PropertyValue("CopyIntelScript.Applies To") = "3"
ElseIf CurrentBuildTarget = 16 then // macOS Intel 64 bit
PropertyValue("CopyUniversalScript.Applies To") = "3"
PropertyValue("CopyIntelScript.Applies To") = "0"
End If