Company Only Extension

Created an extension for use within a company and wish to start sharing so multiple users can use on different machines.

However at the moment having to package the .rbz they sent to users to un-install and re-install whenever something is changed within the extension

Is there a way to get this process to update automatically from a main source? (Understand that the extension warehouse requires the extensions to be public which would not work as require this for internal company use only)

Though public, you can scramble the code, so it would be ‘protected’?
We get the same sort of questions for models and collections on the 3D Warehouse. There, you can set models to ‘Private’ but then it would require that all employees use the same email (Trimble ID)

Maybe, a ‘Private’ option could be implemented in the Extension Warehouse, but, like the private setting in the 3D Warehouse would gain usebility if you can restrict to domain

The is usually no need to uninstall an Extension when its RBZ is updated - the re-installation overwrites existing files and adds in any new ones. You might have to restart SketchUp to see the changes - it depends what’s involved.
You can have the RBZ placed in a central network based folder [your client will want control of their own software anyway?]
The RBZ name can include the current version - e.g. ABC_Extension_v1.2.rbz
When you give the client an updated version they place it in the network folder - as say ABC_Extension_v1.3.rbz
In you extension’s code you can have it run a checker whenever the tool is run.
When the tool runs it looks through the RBZ files in that network folder that match the pattern /ABC_Extension_v[1-9].[1-9].rbz/ and collects them into an array, sorts that list and takes the last one rbz = array[-1] - in this case: ABC_Extension_v1.3.rbz
Also ensure that rbz defaults to nil if an RBZ match is not found…
From that you can parse the version ver = rbz.split(‘v’)[1].gsub(/.rbz$/,‘’) (which is “1.3”) OR set ver = nil if ! rbz
If ver exists then your Extension has a version set up in the loader RB, so you just need to set that as a Constant e.g. VERSION=“1.2”
you can then compare that
if VERSION == ver …
If they match do nothing, but if ver and the RBZ’s version has changed, then you can warn the user that an update is available in a UI.messagebox, and then auto-install that RBZ using the API method…
Module: Sketchup — SketchUp Ruby API Documentation
Note its syntax and errors etc…
If it successfully installs [or not] you tell the user in a final UI.messagebox - if necessary tell them to restart SketchUp…

6 Likes

For developers, there is always an easy way!
:smiley:

Worked perfectly thanks

1 Like