Associating frameworks with QuickLook plugins

I am trying to write a QuickLook generator. To do this, I need to associate with the map I created. However, as soon as I refer to the specified structure, qlmanage refuses to load my plugin, telling me:

 [ERROR] Can't load plug-in at /path/to/my-ql.qlgenerator: The bundle "my-ql" couldn't be loaded because it is damaged or missing necessary resources. 

I read all the relevant manuals for Linking, Frameworks, and QuickLook, but could not find an answer.

Things I have discovered / ruled out so far

  • Architecture: When you turn on the Framework as a 32-bit binary, the whole binding process happens, so this doesn't seem to be a problem.
  • I checked that the Framework was copied to the plugins package in Contents/Frameworks .
  • The framework installation path is set to @executable_path/../Frameworks

In addition, when using the framework in another application, everything is going well. The only possible explanation that I can understand is: When qlmanage executed, @executable_path actually points to this binary, and so my structure will never be found. If so, how should I set the installation path in order to still resolve the location relative to the plugin? I do not want to establish my infrastructure around the world.

EDIT

otool -L on the built-in QuickLook plugin gives the following:

 /System/Library/Frameworks/QuickLook.framework/Versions/A/QuickLook (compatibility version 1.0.0, current version 327.4.0) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 38.0.0) /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 44.0.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 550.29.0) /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 15.0.0) @executable_path/../Frameworks/PESHandler.framework/Versions/A/PESHandler (compatibility version 1.0.0, current version 1.0.0) <== *this is my framework* /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0) /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0) 

otool -D in my structure gives the following:

 @executable_path/../Frameworks/PESHandler.framework/Versions/A/PESHandler 

Framework does not require garbage collection.

+6
source share
2 answers

@executable_path removes the main executable for the process. This will be the quicklook daemon, not your plugin. You should use @loader_path instead.

Here 's a blog post covering this.

+7
source

You do not say if the application in which you used your framework required garbage collection. You also don’t say if your infrastructure requires it. Perhaps you are trying to compile a Quick Look generator using garbage collection. But "Quick Look generators are not going to garbage collection," according to Nikolai Riley, who responds to this post . This in itself may explain why, as you say, β€œthe whole binding process”, if what you are trying is really.

Not familiar with your infrastructure, I have no idea how the process is involved to eliminate the dependency on garbage collection (if this is again), but your infrastructure may need to be reworked so that it can be used in the Quick Look generator.

+1
source

Source: https://habr.com/ru/post/886422/


All Articles