Grasshopper

algorithmic modeling for Rhino

Determine existence/version of Grasshopper installed through Windows registry or other means?

Hi there.  

I'm working on deployment issues for our firm, building installer packages for various Grasshopper-related tools (using CreateInstall).  I've gotten to the point where I'd like to check for metadata on the Grasshopper installation but can't seem to find a reliable way to do this.

Issue #1 - Checking for an installation of Grasshopper

a) I can check to see if Grasshopper has been installed by searching the Windows registry, but it's not reliable.  It seems that Grasshopper no longer has an individual uninstall package (can't find in Add/Remove...), and rather is uninstalled if you uninstall Rhino.  However, the registry keys for Grasshopper do not appear to be cleaned on a Rhino uninstall, so my installer can get spoofed into thinking that there is a Grasshopper installed when it's not.

b) It appears that not every Grasshopper install creates a registry entry in HKEY_LOCAL_MACHINE.  On my machine, for instance, I can search for the Grasshopper key and return the directory of the .rhp file, and then verify that the file does in fact exist.  On other machines, however, I have found that there is no key in the HKEY_LOCAL_MACHINE, and the registry entry in HKEY_CURRENT_USER does not include the path to the .rhp file, so I can't verify whether it does in fact exist or if the registry is out of date.

c) I could brute-force search for the .rhp file, but I haven't found the most reliable parent director(ies) to search in order to be exhaustive and accurate.

Issue #2 -- Checking the Grasshopper Version

I would like to be able to trigger an update programmatically to a network installer (firm-sanctioned GH version) if the existing version is older than specified.

In some cases, if I can find the rhp through the HKEY_LOCAL_MACHINE key, I could theoretically parse the file path, which appears to contain the text representing the version.  This seems hacky, though, and I have to learn Gentee programming language to do it (trying to avoid that).  Also, as I said before, I am not guaranteed to have this path location if I am only able to find the HKEY_CURRENT_USER key.  Perhaps if I could reliably find the .rhp through a brute force file search, this would be my best option.

Just thought I would put this out there to see if you have any thoughts (David?).  :)  If I don't hear anything from the community, I'm going to try to do the brute force search and parsing method...

Thanks,

Marc

Views: 2135

Replies to This Discussion

Grasshopper these days is installed using the Rhino Installer Engine (rhi files). There is no uninstaller mechanism yet, but it does allow for updates. You're best off asking on our discourse forum how rhi works with the registry.

Incidentally, I found that the Grasshopper dll does in fact have the version number associated with it, which is good news.  The question now is whether I can reliably find the dll with brute force search...

It should be in the same folder as GrasshopperPlugin.rhp, a reference to which exists in the registry.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service