Skip to main content
Known Participant
November 1, 2021
Answered

Notarize Lrdevplugin MAC OS BigSur 11.0. : Help or Manual needed

  • November 1, 2021
  • 1 reply
  • 432 views

Help needed:

I developped an Export-Plugin for LR 6.14 and LR11 on Windows10 (21Hx). Runs well. Wanted 'simply' to test it on a MacBook Air M1 2020 with BigSur 11.0.x. Does not run at all. Jut cryptic error messages that are not written to any log-file.

Found in the LR Classic, PROGRAMMERS GUIDE, the hint on Notarization for macOS above 10.15 and that one should use .lrdevplugin for development. The Plugins runs an external executable on Init.

So, is there a (simple) manual how to notarize a lrdevplugin for development purposes? And, once read, for a 'productive' plugin?

Thank's to all reponders

Martin

This topic has been closed for replies.
Correct answer johnrellis

Here's an article on how to notarize command-line executables:

https://scriptingosx.com/2021/07/notarize-a-command-line-tool-with-notarytool/

 

It's more than a little tedious to set up. However, you don't need to notarize the executable -- instead, the Init can remove the com.apple.quarantine extended attrribute from the executable.  Here's what several of my plugins do:

 

 

 

 

 

--[[----------------------------------------------------------------------------
public boolean unquarantinePlugin ()

On Mac, if the file "_quarantined" exists in the current plugin's folder,
removes the "com.apple.quarantine" extended attribute from all files in the
folder and removes the "_quarantined" file. Returns true if successful.
Returns false if there's any sort of error, displaying an error message to the
user, and leaving the "_quarantined" file in place.

On Windows, always returns true.
------------------------------------------------------------------------------]]

function Util.unquarantinePlugin ()
    if WIN_ENV then return true end

    local path = child (_PLUGIN.path, "_quarantined")
    if not LrFileUtils.exists (path) then return true end

    local code, err = Util.safeExecute (
        "xattr -r -d com.apple.quarantine '" .. _PLUGIN.path .. "'", true)
    if code ~= 0 then 
        Debug.logn ("xattr: ", code, err)
        LrDialogs.message ("Problem unquarantining the plugin after download", 
            "See 'debug.log' for details. The plugin may not run correctly " ..
                " -- contact support via the Help page")
        return false
        end

    LrFileUtils.delete (path)
    return true
    end

 

 

 

 

1 reply

johnrellis
johnrellisCorrect answer
Legend
November 1, 2021

Here's an article on how to notarize command-line executables:

https://scriptingosx.com/2021/07/notarize-a-command-line-tool-with-notarytool/

 

It's more than a little tedious to set up. However, you don't need to notarize the executable -- instead, the Init can remove the com.apple.quarantine extended attrribute from the executable.  Here's what several of my plugins do:

 

 

 

 

 

--[[----------------------------------------------------------------------------
public boolean unquarantinePlugin ()

On Mac, if the file "_quarantined" exists in the current plugin's folder,
removes the "com.apple.quarantine" extended attribute from all files in the
folder and removes the "_quarantined" file. Returns true if successful.
Returns false if there's any sort of error, displaying an error message to the
user, and leaving the "_quarantined" file in place.

On Windows, always returns true.
------------------------------------------------------------------------------]]

function Util.unquarantinePlugin ()
    if WIN_ENV then return true end

    local path = child (_PLUGIN.path, "_quarantined")
    if not LrFileUtils.exists (path) then return true end

    local code, err = Util.safeExecute (
        "xattr -r -d com.apple.quarantine '" .. _PLUGIN.path .. "'", true)
    if code ~= 0 then 
        Debug.logn ("xattr: ", code, err)
        LrDialogs.message ("Problem unquarantining the plugin after download", 
            "See 'debug.log' for details. The plugin may not run correctly " ..
                " -- contact support via the Help page")
        return false
        end

    LrFileUtils.delete (path)
    return true
    end

 

 

 

 

martinvb1Author
Known Participant
November 2, 2021

John, Thank's again for your help! 

It was not an issue of notarization. This is obviously not required for .lrdevplugin and LR 11.0.0 and bigSur 11.6.1.

Sorry, for bothering you with that.

Just one line in that startDialog was wrong. It works now identical to Win10.

Regards

Martin

johnrellis
Legend
November 2, 2021

Good, glad you got it resolved.  If you ever distribute your plugin, however, you'll need to notarize or unquarantine its executable, whether it's .lrdevplugin or .lrplugin.