Cannot install .rbz extensions if I zip them myself

rbz
extensions
mac
zip
extensionmanager

#1

Background:
I’ve been trying to create my own SketchUp extension. I downloaded a template (this one), modified it and added some Ruby code for the functionality I wanted to create. Then I zipped the extension folder using the native MacOS “compress” utility, changed the extension from .zip to .rbz, and attempted to install it by opening the extension manager, clicking “Install Extension”, and selecting my extension.
The problem:
Nothing happened. Absolutely nothing - no error, no change, nothing.

Troubleshooting attempts so far:

  1. I tried and failed to figure out what I’d messed up in the ruby code or folder structure
  2. I decided to try installing the template extension straight up. It installed fine, worked great.
  3. Then, I wondered if there was something wrong with the zipping process, so I unzipped the template extension, the re-zipped it using the native Mac OS “compress” utility, changed the extension to .rbz, and tried installing it in SketchUp. NOTHING HAPPENED. This suggested to me that there was something wrong with the way Mac OS was zipping the archive.
  4. I downloaded “Keka”, a 3rd party archiving tool. I again unzipped the archive, but this time zipped it using Keka, changed the extension to .rbz, and tried to install it. Again, NOTHING HAPPENED! I tried changing the handful of options Keka provides, but it didn’t change anything.

System info:
OS: macOS Sierra 10.12.6
SketchUp version: SketchUp Pro 2018

Any advice? I’m pretty baffled - I can’t find any mention of other people having this problem. Is there somewhere I can see some error output from Sketchup that might help me diagnose this? Some other zipping tool I should be using? Thank you for any help you can provide!


#2

When you unpack an archive, some archivers unpack the contents of the archive root directly to the destination directory and some create a new folder and put them inside. The same can happen when creating the archive, that the files are put into a directory in the archive instead of the root.
This is usually circumvented by choosing another archiver (or passing options to the archiver), so the fact that your problem is reproducible with Keka makes me think it is rather something else.

  • Have you browsed the zip/rbz contents with an archive program and verified it is structured as expected?
  • Have you unzipped the zip archive manually and checked whether it unpacks the structure that SketchUp expects?
  • I think it is not the problem in this case, but one needs to have an eye on that the archive type is set to zip (and not e.g. .tar.gz). Sometimes there are options for the compression algorithm, but I would expect SketchUp understands all that are standardized.
  • (…and on Windows: Enable display of file extensions so see that the full name is not .rbz.zip)

#3

Could you share your rbz with us?


#4

YES! Thank you! Your first suggestion did the trick. I opened the zip archive on a Windows machine, which has an integrated archive browser utility, and found that it was definitely not simply the structure of the plugin folder I was compressing. I used the windows archive tool, and even that added an unnecessary extra folder level, which I had to remove to make it work.

For reference for future users:

  1. The organization I expected to see in the archive (the same as the original folder structure I created)
    | - plugin_loader.rb
    | - plugin_subdirectory
    _____| - images
    __________| - icon1_16.png
    __________| - etc…
    _____| - extension_info.txt
    _____| - plugin_data.rb
    _____| - plugin_menus.rb

  2. Here’s the archive structure the macOS native archiver utility created:
    _____ | - __MACOSX
    __________ | - whole bunch of extra garbage directories and files…
    _____ | - plugin_directory
    __________ | - plugin_loader.rb
    __________ | - .DS_Store
    __________ | - plugin_subdirectory
    _______________ | - images
    ____________________ | - icon1_16.png
    ____________________ | - etc…
    _______________ | - .DS_Store
    _______________ | - extension_info.txt
    _______________ | - plugin_data.rb
    _______________ | - plugin_menus.rb

  3. Here’s what the windows native archiving utility created:
    _____ | - plugin_directory
    __________ | - plugin_loader.rb
    __________ | - plugin_subdirectory
    _______________ | - images
    ____________________ | - icon1_16.png
    ____________________ | - etc…
    _______________ | - extension_info.txt
    _______________ | - plugin_data.rb
    _______________ | - plugin_menus.rb

  4. Here’s how I edited the archive that Windows created to make it actually install in SketchUp
    _____| - plugin_loader.rb
    _____| - plugin_subdirectory
    __________| - images
    _______________| - icon1_16.png
    _______________| - etc…
    __________| - extension_info.txt
    __________| - plugin_data.rb
    __________| - plugin_menus.rb

My plugin still isn’t working (I probably messed something up), but at least it now shows up in the Extension Manager when I install it! Thanks for your help!!

Update:

I figured out how to to make the zip file directly from Mac OS:
In the terminal, cd into the base directory of your extension, then run
zip -r -X ../ExtensionName.rbz *