Convert zip to rbz

Background Info:

  1. I had programming experience before, but It’s my first time to write SketchUp extension.
  2. I had problem on zipping the folder to make up a RBZ file (Detail explained in following)
  3. OS: Windows 10, CPU Intel® Core i5 @2.50 GHz, SketchUp 2019 Pro.

Before I post this tag, I have read:




https://sketchucation.com/forums/viewtopic.php?f=323&t=43485
https://sketchucation.com/forums/viewtopic.php?f=180&t=47278
However, I didn’t find a solution after all.

My problem:
OK, let’s see… I have a folder on my desktop named “my_ext_1.0”.
And inside this folder, there are two parts: one is a sub-folder, named “ext_subfolder” (contains a rb file “ext_main.rb” and a folder “ext_images”); Another is a rb file “ext_loader.rb”.

Let’s make it clear:
my_ext_1.0 >> ext_subfolder (ext_main.rb + ext_images) + ext_loader.rb

Now, I am ready to publish this into a SketchUp extension.
So:

  1. I send “my_ext_1.0” to the compressed folder, and get a “my_ext_1.0.zip”
  2. I renamed “my_ext_1.0.zip” to “my_ext_1.0.rbz”, the logo of the zipped file changed to SketchUp Ruby Extension RBZ icon.
  3. I open the SketchUp 2019, windows -> extension manager -> install extension -> select “my_ext_1.0.rbz”
  4. I restart the SketchUp 2019, AND DID NOT FIND MY EXTENSION THERE.
  5. I check in file explorer:
    C:\Users\ME\AppData\Roaming\SketchUp\SketchUp 2019\SketchUp\Plugins

In the plugin folder, I was surprised that:

Instead of having two files “ext_subfolder” and “ext_loader.rb”, I actually got a combined folder “my_ext_1.0”.

When installing an rbz file, the zipped file is meat to be exploded, all the inside parts should go into the Plugins folder. However, I believe the problem is due to when I install my “my_ext_1.0.rbz” file, this file was regarded as an entity to added into Plugin folder.

I will be so grateful if someone offers help.

The structure of your zip/rbz file is wrong. By convention, the structure of a SketchUp extension rbz is:

zip file
-> extension registration rb file
-> extension folder
-> extension loader rb file
-> any other required rb files
-> other subfolders and content as needed (e.g. images, icons, dialog html, etc.)

Edit: that didn’t format right. I need to review my markdown syntax. I meant the first two items to be at the same level and the rest to be nested inside the extension folder.

Also by convention, the name of the registration file matches the name of your extension and the extension folder has the same name without the .rb suffix. The extension loader file can have any name; it is specified in the registration file.

To create an rbz,

  1. change to the folder that contains the registration rb fle

  2. create a zip file containing the registration file, the extension folder and its contents

  3. rename the file extension from .zip to .rbz

To install the resulting rbz

  1. open the Extension Manager window

  2. click the install extension button at the bottom

  3. find your rbz file in the dialog that pops up

  4. click OK to install

Thanks to Steve Baumgartner for your replying. You have suggested very useful stuff which names of the folder and the registration must be the same.
After I fix this, I tried the procedure, however, it’s the same result that:

I actually got a combined folder “my_ext_1.0" in Plugins.

I wondered whether the registration.rb is not working. So:

  1. I put my subfolder (containing “ext_loader.rb”, “ext_main.rb” and “images”) into the Plugins. (I did NOT put “ext_register.rb” into the Plugin)
  2. Rather, I opened SketchUp 2019 and opened up Ruby Code Editor, copy all stuff from “ext_register.rb” and run.
  3. The ruby console said:

Registration of extension Edge Connect was blocked
“false”

I have not submit this extension to be accessed by the reviewers yet, I just want to test everything works. ^v^

Let’s assume your tool is named Qiny-WonderTool
It will consist of two parts when it’s in the Plugins folder:
Qiny-WonderTool.rb [the loader RB which sets up the Extension]
and a subfolder named exactly the same:
Qiny-WonderTool
that subfolder contains all of the other files needed to make the Extension work.
ALL Ruby files should be RB at this stage, because any ‘signing’ process requires that, and any desired encryption to RBE is done during that process.

When you make the ZIP select both the RB and the same name subfolder, add them to the ZIP file - named say Qiny-WonderTool.zip
To check it’s worked open the ZIP and you should see the two at its base level, opening the zipped subfolder should reveal its contents.
Now you simply rename the .ZIP as .RBZ [you need to have filetype extensions visible to do this].
Qiny-WonderTool.rbz
You can probably set up your compression software to treat RBZ files as ZIP - then you can double-check its contents.

On installing Qiny-WonderTool.rbz the RB and same name subfolder should appear in the Plugins folder.
Errors in the loader RB file might prevent the Extension Manager showing it as loaded…

Having those files in the Plugins folder and using the Ruby Console to:

load "Qiny-WonderTool.rb"

Will show error messages without ever going through the RBZ steps…

In the past a very few compression apps have caused issues with making suitable ZIP files - what are you using ??

Thank you for replying mate. I will have a go now.

I am not using an application, I used Windows 10 right click - send to - compressed folder. By the way, my [control panel - personalize - file explorer options - view - advanced - (un-tick hide)] is correctly settled.

Problem solved, which is Awesome! Thank you very much to slbaumgartner and TIG, I really appreciate your help.

Here is a quick summary:
After you made the zip folder, you must click on it to check what’s inside. If it only contains a folder, IT WON’T WORK.
You must do create another zip file by the correct procedure. which is:

  1. Select your rb file (for registration)
  2. press Ctrl, select another your folder (contains all other stuff)
    (#WARNING: both items must have the same name. for example: Qiny-WonderTool.rb & Qiny-WonderTool)
  3. right click, send both file to the compressed folder.
    Then it should work!
1 Like