Its time to discuss an important subject: Plugins/Extensions
-
Here's an overview of writing and installing plugins/extensions.
The simplest plugin possible is one RB file.
This needs to be in the user's Plugins folder, so that it auto-loads as SketchUp starts.
It is possible to load an RB file manually using the Ruby Console andload "full_path_to_RB"
This 'home-made' RB plugin will only load in >=v2016 if the loading-policy is set to 'unrestricted', because it's not 'signed'.
A simple RB plugin is not an Extension - more about those later...
Let's assume you want to give this lone RB to others but in an easily installed RBZ format.
You must put it in a ZIP file and rename the ZIP with the .RBZ suffix.
It can then be installed using the Load Extension... tool... the user does not now need to access their Plugins folder.
However, as the RBZ is unsigned there will be potential loading-policy issues.Let's assume you want to avoid any loading-policy issues...
Make the RBZ as above, but also include in the ZIP an empty subfolder with the very same name as the RB.
You then need to be a registered developer at Trimble, and submit it for signing here:
https://extensions.sketchup.com/en/developer_center/extension_signature
The signing process will fail unless the RBZ contains just the RB and a matching named subfolder.
The RBZ is quickly processed and a modified RBZ is then available for download.
This now has two additional files in the subfolder .hash and .susig - these confirm the signing and compatibility with all loading-polices.
If you modify the RB in any way the hash/signing is broken and it will be limited in loading under stricter policies.
You can distribute the RBZ to others who can easily install it using the native [or SCF] tools.Back to "Extensions"...
An Extension is just a plugin written in a special way, which lets you enable/disable it in the Extensions manager, so it does not fully load as SketchUp starts unless it is enabled...
A typical Extension comes in an RBZ and as above it also has a loader RB and subfolder of the same name, the RB contains code to set up the Extension and loads another Ruby file within the subfolder.
This could then load other Ruby files within that subfolder, or even subfolders with that.
It can also use HTML/JS/CSS files in this subfolder etc to make dialogs etc.
The signing process hashes all of these files, so changing any negates the hash.
The subfolder can of course contain other files like images used in dialogs and toolbars...When you submit an RBZ for signing there are options to encrypt your RB files...
The 'loader' RB is never encrypted, but any within the subfolder can be made into RBS or RBE files.
RBE only load in >=v2016; they are a securely encrypted format, the old RBS is known to have been cracked and is therefore only suitable for low-grade obfuscation, however it has the advantage of being compatible with all SketchUp versions...
Unless you have some wondrous intellectual property in your code which you wish to protect, then encryption is not a likely option ?If you are to have your Extension hosted at the PluginStore there are few further restrictions. However, if you wish to submit it to the Extension-Warehouse then it is far more onerous.
I suggest that you read their detailed guidance directly before proceeding.
You would need to be a registered developer, and write your code in a particular way, otherwise your submission will be rejected for EWH processing and hosting [the signing process is less proscriptive], assuming your RBZ is not found wanting, then they will encrypt the RBZ's RB files as you instruct and sign it for you etc... -
For the benefit to other members reading this thread.
- I emailed TIG one of my for purchase ruby scripts in .zip format
- We both agreed that indeed when renamed to .rbz the SU 2016 Extension Manager failed to install the script.
to quote TIG: "As to why there are some issues with some of your ZIP/RBZ files is a mystery..."
Coincidentally SU 2016 Extension Manager also fails to install all of the other for purchase ruby scripts. This situation came to light when one of my Clients informed me that my scripts do not work in SU 2016. That's the reason I started this thread.
I also warned clients not to use my scripts for SU 2016 on my blog.Manual installation, without the use of Extension Manager in SU 2015 ....works!
Hence loading the file in the Ruby Console also ....works!Manual installation, without the use of Extension Manager in SU 2016 .....fails!
Hence loading the file in the Ruby Console also ....fails!So now you have the problem you can no longer write or edit an .rb files the way you did with past version of SU 2015 and earlier.
- If you have to convert the .rb to .rbz first, then try to install in into SU 2016
and if that install fails, You wont be able to read any Ruby script errors in the Ruby Console.....So now what!
If you still have SU 2015 installed, stay with that version, and you wont have any install problems.
-
For my part...
Your item 2. is not entirely correct.
I siad to you that I can take your supplied ZIP file and rename it as a RBZ...
and it willinstall and load OK in v2016/v2017Whereas you cannot get yours to install.
Which is the quoted 'mystery'...
You did not supply your RBZ - perhaps that's the missing lonk ??There is clearly some issue...
I suggest you try remaking your ZIP using another [known to be compatible] exe - like 7-Zip or Windows's own 'Send to > ZIP' context-menu.
Then rename that .ZIP file as .RBZ [ensuring that the folder-options are set to display all file-types, so that you do really rename the file-extension - e.g. "xxx.zip" needs to become "xxx.rbz" not "xxx.rbz.zip", which can happen if folder-options are set to hide known file-types] - this is yet another idea, which I've had since our last exchanges...I always use a very similar method to the one you have described, when I make all of my RBZ files [in Win 10] - so it is clearly quite possible to make usable RBZ archives from ZIP files, which will then install and load OK in ALL current versions of SketchUp...
-
Rather than send me the ZIP can you send me the equivalent RBZ so that I can test it too...
Obviously use PM, to avoid publishing it unduly... -
thanks for the clarification!
I sent the same file yesterday to my Client who purchased this particular plugin
and who also informed me about the SU 2016 issue. I just got his response
-
@tig said:
Rather than send me the ZIP can you send me the equivalent RBZ so that I can test it too...
Obviously use PM, to avoid publishing it unduly...I will do that, and then in return you can send me a new .rbz file you made for me to try.
(urgent issue to attend to... I will do this next hr.) -
I've sent you my RBZ by PM, I await yours...
-
@tig said:
I suggest you try remaking your ZIP using another [known to be compatible] exe - like 7-Zip or Windows's own 'Send to > ZIP' context-menu.
This is the second time you've told him that some zip makers do not work well with SketchUp.
What was he using to make his Zip files ?
And are his rb files properly UTF-8 (without BOM) encoded ?
-
I think we probably have reached a solution.
Tomot gave me a ZIP - which was a true ZIP [code starting "PK"] - when renamed as RBZ it installed fine.
He then gave me his failing RBZ - its code started "Rar" - showing it to be a WinRAR files NOT a ZIP file.So we are now resolving by PM how this happened, and can be avoided in the future.
I have also suggested he tries making his ZIP files in alternative ways [like 7-Zip or the Win > Send to>Zip...], thereby avoiding issues with RAR files that masquerade as ZIP files ! -
Here is the bottom line in the .ZIP to .RBZ saga
My current version of Winrar 5.31 (64-bit) ....failed to faithfully do a proper .zip conversion.
TIG informed me how one script I sent him was able to be installed while the other was not.
How is this possible?
That lead me to investigate what had happens to WinRar, which I have used for .rar .zip and password protect files since the early 2000'sI attached one of my very old XP HDD's via a none sata to usb connection to my PC. And there it was, an old copy of Winrar 3.71
- I used the old Winrar 3.71 to make a new zip file
- renamed .zip to .rbz
- installed the .rbz
- voila! ... it installs via the dreaded Installation Manager!
I admit I'm a so learner, this is not the first time I have regretted getting on that bloody upgrade treadmill. I can hardly wait for SU 2018
Advertisement