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(R) 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 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!
2 Likes

I hate to resurrect this topic, but I have a similar issue:

There is an extension called FPS Nav (link to extension page) on Sketchucation. It works okay, but someone on GitHub has written a fork (link to github fork) to fix a lot of things and make it more usable.

My issue though is once I had downloaded the master file (click to download), the plugin is not an RBZ file, it’s a ZIP that looks like this in the file explorer:

I know basically nothing about code and very little about Github, but I really would like to use this FPS Nav fork.

How can this ZIP be turned into an RBZ?

An rbz is simply a zip file with a particular internal structure. It always contains a top-level Ruby file, and for a SketchUp extension usually a folder named for the extension. The top level file is the “registrar “ that tells SketchUp about the extension. The folder contains any additional Ruby files and supporting files such as images. With that structure, you get an rbz from a zip simply by changing the .zip file’s extension to .rbz.

So if that’s the structure of what you have, you simply need to rename it. If that’s not the structure it is not a valid rbz.

1 Like

So I need to go in and rearrange the zip? Also, when I rename the file, it ends up adding “.rbz.zip”

You need to edit the name by changing the filename extension. Your OS may resist that, making you verify that it is really what you wanted to do, as changing the filename extension will usually associate a file with a different app. In the listing you showed, I don’t know what the Thumbs database file is for, but it wouldn’t usually be top-level like that in an rbz. When the SketchUp extension manager installs the rbz, I think it will put Thumbs directly into the Plugins folder, where it really doesn’t belong. You might try removing that file and see if the extension will load and run correctly.

1 Like

Is there any reason for there to be two RB files in the folder?
block

Probably, Better not touch the structure - the files seemed to be different size. I would guess that the folder FPSNav_for _SketchUp_Master ís the one you need to zip and rename to .rbz but I am only guessing.

1 Like

Guessing?! O.o

I don’t wanna break my stuuuufff :frowning: I have no idea what I’m doing.

Did you check, for instance, the Readme.txt or others there that might contain intructions?

1 Like

I have, and there are no instructions, but i did get a response from the fork author, though, I don’t quite understand it:

So, It seems like he’s saying I need to move the Chatham_FPSNav.rb into the plugins folder, then move the “thumbs” into the fps nav folder, like this, (Starting from the extraction):

Then I need to put the fps nav folder into the plugins folder, like this:

Didn’t you installed once already? :confused:

1 Like

I installed FPS Nav successfully, but the fork from GitHub I couldn’t figure out:

So, I thought it would be a good idea to ask for help on a topic that was discussing the very issue I’m having.

If I have broken some of the bullets in Keep it Tidy, please forgive me, and I will condense my replies into one post, then delete, copy, and paste a new reply into the “Walk/Fly WASD+Mouse Navigation Mode” topic that was referred to by @dezmo.

To short it out:

Keep in mind what I said in the other topic:

I did not find any harmful code with a quick check, but could be conflicted by other extension…because it does not follow the basic rules of making extensions.
Use your own risk:
Here is the .rbz
FPSNav.rbz (343.9 KB)

1 Like

Thanks for doing that for me @dezmo, it seems to not work right anymore though. It probably isn’t your fault. Eye height is not locked when moving. Thank you so much!

Edit: actually I kinda like that the eye height isn’t locked now.