Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


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

Community Beginner ,
Oct 31, 2021 Oct 31, 2021

Copy link to clipboard

Copied

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

TOPICS
macOS, SDK

Views

79

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Nov 01, 2021 Nov 01, 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 Ma...

Likes

Translate

Translate
LEGEND ,
Nov 01, 2021 Nov 01, 2021

Copy link to clipboard

Copied

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

 

 

 

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 01, 2021 Nov 01, 2021

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 02, 2021 Nov 02, 2021

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 02, 2021 Nov 02, 2021

Copy link to clipboard

Copied

Great. Thank you!!! Still some way to go...

What do you mean by executable? The compiled *.lua?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 02, 2021 Nov 02, 2021

Copy link to clipboard

Copied

I though you said your plugin runs an external program: "The Plugins runs an external executable on Init.".  Any external program distributed as part of your plugin would have to be notaraized or use the code above for "unquarantining" it.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 03, 2021 Nov 03, 2021

Copy link to clipboard

Copied

Yes, your are right. I intended to run cwebp or magick (ImageMagick)  externally to convert from jpg to webp prior to upload to WordPress (I know that WordPress could do that also after upload).

But with my knowledge on macOS it was such a mess to install one of these command line tools that I skipped that.

But, re-reading your comment: If I were successful I wouldn't have needed that because it is only required for executables that are delivered as part of my plugin.

Now, it's only possible with Windows. There it is just 'download, click and run' with ImageMagick

I intend to provide the Plugin as 'DonationWare' (practically GPL2.0) so, I don't want to bother the user with that.

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 04, 2021 Nov 04, 2021

Copy link to clipboard

Copied

I can't delete my last previous answer.

- Finally managed to install ImageMagick on macOS. 

- If I run the code below in my Plugin in the 'PluginInit.lua'. (DIRSEP = '/' on macOS)

LrTasks.startAsyncTask( function(  )
        local p2 = LrPathUtils.getStandardFilePath( 'documents' )
        
        -- do test for availability Imagemagick 
        local cmd = 'magick -version > ' .. p2 .. DIRSEP ..'LRTestImagick.txt' 
        
        Log ('Checking ImageMagick: ', cmd)
        LrTasks.execute( cmd ) 
    end 
)

 The Log says:

"Checking ImageMagick: " "magick -version > /Users/martinvonberg/Documents/LRTestImagick.txt"

OK. But the txt-file is empty although generated. Filesize = 0. ???

If I run the command in terminal the version info of magick is in the file. Filesize is 370 Bytes

Now, I exptected some file with "_quarantined" or so in my .lrdevplugin-Folder. But, this is not there.

I checked with 'ls -al' and in Finder. 

The SDK-manual tells me someting about Sandboxing, what I don't understand. Because if the call is dis-allowed I wouldn't expect to find an emtpy LRTestImagick.txt rather no file at all. Sigh.

Could somebody help?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 06, 2021 Nov 06, 2021

Copy link to clipboard

Copied

LATEST

Update for macOS:

It works if the binary 'magick' is copied to the LR-Plugin-folder and if it is called then form this folder:

/User/martin/WordPress.lrdevplugin/magick ...

No other activities required.

So, this is the solution now on macOS.

People that go through the process of installing xcode, homebrew and ImageMagick are expected to copy the binary of magick to the plugin folder. Not nice, but found no other solution.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines