Get SketchUp Install Path from Windows Registry


#1

Hello, is there a way to get the path that Sketchup is currently installed to? Perhaps a registry key?


#2

Yes they are in the HKLM/Software/ hive.

Depends upon the version and bitness of SketchUp:


On 32-bit Windows:

Sketchup 8 (and earlier just change the major version character.)

HKLM/Software/Google/Google SketchUp 8/InstallLocation/(default attribute)

Sketchup 2013 (and later, just change the major version characters.)

HKLM/Software/SketchUp/SketchUp 2013/InstallLocation/(default attribute)

On 64-bit Windows:

Sketchup 8 (and earlier just change the major version character.)

HKLM/Software/Wow6432Node/Google/Google SketchUp 8/InstallLocation/(default attribute)

SketchUp 2013 and 2014, and any higher 32-bit edition (just change the major version characters.)

HKLM/Software/Wow6432Node/SketchUp/SketchUp 2013/InstallLocation/(default attribute)

SketchUp 2015, and any higher 64-bit edition (just change the major version characters.)

HKLM/Software/SketchUp/SketchUp 2015/InstallLocation/(default attribute)

#3

Perfect, Thank you. For some reason these did not popup when I searched the registry.


#4

What about the plugin directory in C:\Users\User\AppData\Roaming\SketchUp\SketchUp 2015\SketchUp\Plugins


#5

%AppData% is a system environment variable, ie:
C:\Users\%USERNAME%\AppData\Roaming\

Also is %ProgramData% (aka %ALLUSERSPROFILE% on XP,) which is also honored in later SketchUp releases, (I think 2014+) but user plugins path takes precedence over public plugins path.

SketchUp that uses Ruby 1.8 was not Unicode friendly and so the plugins were not in the user paths. This was 2013 and earlier on Windows. They were in the “Plugins” sub-directory, of the InstallLocation.

https://en.wikipedia.org/wiki/Environment_variable
And see table for Windows:
https://en.wikipedia.org/wiki/Environment_variable#Default_values


#6

Let me also add, that for Ruby to use any plugins paths for loading scripts or libraries (via the require method,) paths need to be pushed into the Ruby global $LOAD_PATH (aka $:) array.

Sketchup.exe does this for certain paths when it initializes the Ruby interpreter. But the public %ProgramData% path is only pushed if it exists when SketchUp starts up. (So an Administrator or an installer would have had to create the version-ed SketchUp sub-directories in that path previously.)