extract python install info from registry

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rbt

    #1

    extract python install info from registry

    On windows xp, is there an easy way to extract the information that
    Python added to the registry as it was installed?
  • Laszlo Zsolt Nagy

    #2
    Re: extract python install info from registry

    rbt wrote:
    [color=blue]
    >On windows xp, is there an easy way to extract the information that
    >Python added to the registry as it was installed?
    >
    >[/color]
    Using regedit.exe, look at the registry keys and values under

    HKEY_LOCAL_MACH INE\Software\Py thon

    If you need to know how to read the registry from Python: please install
    the python win32 extensions (or use ActivePython).

    Les

    Comment

    • rbt

      #3
      Re: extract python install info from registry

      Laszlo Zsolt Nagy wrote:[color=blue]
      > rbt wrote:
      >[color=green]
      >> On windows xp, is there an easy way to extract the information that
      >> Python added to the registry as it was installed?
      >>
      >>[/color]
      > Using regedit.exe, look at the registry keys and values under
      >
      > HKEY_LOCAL_MACH INE\Software\Py thon
      >
      > If you need to know how to read the registry from Python: please install
      > the python win32 extensions (or use ActivePython).
      >
      > Les
      >[/color]

      There's more to it than that... isn't there? I've used _winreg and the
      win32 extensions in the past when working with the registry. I thought
      perhaps someone had already scripted something to extract this info.

      I'm creating a Python plugin for Bartpe (Windows Pre-Install
      Environment) and it works OK, but to make it work _exactly_ like it does
      on XP (.py and .pyw associate with python and pythonw), I need to
      extract the reg entries so I can recreate them in the WinPE environment.

      Thanks!

      Comment

      • Laszlo Zsolt Nagy

        #4
        Re: extract python install info from registry

        [color=blue]
        >There's more to it than that... isn't there? I've used _winreg and the
        >win32 extensions in the past when working with the registry. I thought
        >perhaps someone had already scripted something to extract this info.
        >
        >[/color]
        Ok, if you need to get all changes in the registry, you can use regdiff.



        Take a snapshot before and after installing Python. However, this is not
        a wise approach.
        For example:

        1. One can have a system drive 'C:\' others 'G:\'
        2. One can have Windows installed in \Windows others in \WinNT and
        others in \MyWinNT
        3. For many registry values, you cannot really tell if you need to
        correct a value or not.

        As a result, I believe you will only be able to use the 'regdiff' only
        on the same type of computer, with the same system drive, same system
        directory, same windows version etc. For other computers, there is no
        guarantee for that it will work.

        Les

        Comment

        • gene tani

          #5
          Re: extract python install info from registry

          [color=blue]
          >
          > There's more to it than that... isn't there? I've used _winreg and the
          > win32 extensions in the past when working with the registry. I thought
          > perhaps someone had already scripted something to extract this info.
          >[/color]

          Yes, a small firm named Microsoft has done this (but not tested w/2.4):

          http://www.microsoft.com/technet/scr.../osrgpy01.mspx

          Comment

          • rbt

            #6
            Re: extract python install info from registry

            gene tani wrote:[color=blue][color=green]
            >> There's more to it than that... isn't there? I've used _winreg and the
            >> win32 extensions in the past when working with the registry. I thought
            >> perhaps someone had already scripted something to extract this info.
            >>[/color]
            >
            > Yes, a small firm named Microsoft has done this (but not tested w/2.4):
            >
            > http://www.microsoft.com/technet/scr.../osrgpy01.mspx
            >[/color]

            That tells me this:

            Caption: Registry
            Current Size: 2
            Description: Registry
            Install Date: 20051125152108. 000000-300
            Maximum Size: 54
            Name: Microsoft Windows XP
            Professional|C: \WINDOWS|\Devic e\Harddisk0\Par tition1
            Proposed Size: 54
            Status: OK

            Comment

            • Roger Upole

              #7
              Re: extract python install info from registry

              "rbt" <rbt@athop1.ath .vt.edu> wrote:[color=blue]
              > On windows xp, is there an easy way to extract the information that Python added to the registry as it was installed?[/color]

              You should be able to find all the entries in msi.py that's used to build the
              installer.

              Roger




              ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
              http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
              ---= East/West-Coast Server Farms - Total Privacy via Encryption =---

              Comment

              • Trent Mick

                #8
                Re: extract python install info from registry

                [Laszlo Zsolt Nagy wrote][color=blue]
                > rbt wrote:
                >[color=green]
                > >On windows xp, is there an easy way to extract the information that
                > >Python added to the registry as it was installed?
                > >
                > >[/color]
                > Using regedit.exe, look at the registry keys and values under
                >
                > HKEY_LOCAL_MACH INE\Software\Py thon
                >
                > If you need to know how to read the registry from Python: please install
                > the python win32 extensions (or use ActivePython).[/color]

                Actually you don't need the PyWin32 extensions to read the Windows
                registry since the _winreg module was added to the Python core.

                Trent

                --
                Trent Mick
                TrentM@ActiveSt ate.com

                Comment

                • Peter Hansen

                  #9
                  Re: extract python install info from registry

                  rbt wrote:[color=blue]
                  > I'm creating a Python plugin for Bartpe (Windows Pre-Install
                  > Environment) and it works OK, but to make it work _exactly_ like it does
                  > on XP (.py and .pyw associate with python and pythonw), I need to
                  > extract the reg entries so I can recreate them in the WinPE environment.[/color]

                  If it's just a matter of creating those associations, I believe you can
                  do that equally well using the "ftype" and "assoc" console commands, via
                  os.system() or something similar.

                  -Peter

                  Comment

                  Working...