sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    How to check registry for pro version?

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 4 Posters 202 Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      mhd
      last edited by

      I think the topic says it all: I need to check in the registry whether the pro or free version is installed. Can anyone help me?

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        The method
        Sketchup.is_pro?
        tells you if the current version of Sketchup running is Pro.

        This code tells you which ' Pro' versions are installed [PC only]

        def pro_installed?()
          if [PLATFORM].grep(/mswin/)!=[PLATFORM]
            UI.beep
            puts 'Windows method only!'
            return nil
          end#if
          cmd='pro_installed.cmd'
          txt='pro_installed.txt'
          file=File.new(cmd,'w')
          file.puts('reg query "HKCU\Software\Google" | find "SketchUp" | find " Pro" > pro_installed.txt')
          file.close
          UI.openURL(cmd)
          sleep(0.1)
          result=IO.read(txt)
          File.delete(cmd)
          File.delete(txt)
          return result
        end
        

        usage: copy+paste all of this code into a file ' pro_installed.rb' in the Plugins folder

        and restart, then type: pro_installed?

        or add as a 'method' in other code...

        returns:

        HKEY_CURRENT_USER\Software\Google\SketchUp7 Pro

        HKEY_CURRENT_USER\Software\Google\SketchUp8 Pro

        etc

        TIG

        1 Reply Last reply Reply Quote 0
        • J Offline
          Jim
          last edited by

          TIG, what if the user installed Pro, then let it expire? Does the Pro reg key still exist? I think it might.

          Hi

          1 Reply Last reply Reply Quote 0
          • TIGT Offline
            TIG Moderator
            last edited by

            Yes... it just tells you if 'Pro' has been installed... but the question was, 'Is Pro installed?' and this code might effectively return, 'Yes it is!'... or 'No it's not!'... even if it's now expired!! So the code does 'what it says on the tin', and what was asked for πŸ˜’

            I can't see how we might tell if the Pro version is 'valid' or 'licensed' ??

            So, the Sketchup.is_pro? is likely to be the only route, and can only be used when Sketchup is open... πŸ˜•

            TIG

            1 Reply Last reply Reply Quote 0
            • Dan RathbunD Offline
              Dan Rathbun
              last edited by

              @tig said:

              I can't see how we might tell if the Pro version is 'valid' or 'licensed' ??

              The API has a method, but it's defined in the wrong place (which is why you overlook it. I reported this, but basically, Scott said that it was to late to change, or move it, which of course I disagree with. The method might be cloned into the Sketchup module.)

              see: Model.get_product_family()

              Perhaps something like this may make it easier to use ??

              module Sketchup
                def self.get_product_family()
                  self.active_model.get_product_family()
                end #def
              end #module
              

              I seem to recall during beta, that there may be issues with this method.

              I'm not here much anymore.

              1 Reply Last reply Reply Quote 0
              • M Offline
                mhd
                last edited by

                @jim said:

                TIG, what if the user installed Pro, then let it expire? Does the Pro reg key still exist? I think it might.

                I just tested that. It seems the registry keys get deleted if you uninstall SU Pro. I will use this to check for my program. It's not ideal, since you could probably have a pro version running as a free version, but better than nothing πŸ˜„

                Thanks!

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                Buy SketchPlus
                Buy SUbD
                Buy WrapR
                Buy eBook
                Buy Modelur
                Buy Vertex Tools
                Buy SketchCuisine
                Buy FormFonts

                Advertisement