[IronPython] Detecting IronPython Installation Directory

Curt Hagenlocher curt at hagenlocher.org
Tue Dec 23 20:53:42 CET 2008


Given that there are clean APIs for pulling the data out, what are your
objections to using the installer data?
On Tue, Dec 23, 2008 at 11:40 AM, Jeff Hardy <jdhardy at gmail.com> wrote:

> Hi,
> Thanks for the tips! To add a little bit more info, I'm working in
> Powershell for various reasons, so P/Invoke is out of the question.
> Using WMI is easy enough, but I'd prefer not to be mucking around
> inside Windows Installer if I can help it.
>
> Is there any reason to not include an entry (e.g.
> HKLM:\SOFTWARE\Microsoft\IronPython\InstallPath) that stores the
> installation path?. It's easy enough to do with WiX.
>
> - Jeff
>
> On Tue, Dec 23, 2008 at 11:21 AM, Curt Hagenlocher <curt at hagenlocher.org>
> wrote:
> > I think that's just the WMI way of doing an MsiProductInfo call :).
>  Though
> > it sure is a lot more managed- and Python- friendly than having to do a
> > P/Invoke.
> >
> > On Tue, Dec 23, 2008 at 10:17 AM, Oleg Tkachenko <olegtk at microsoft.com>
> > wrote:
> >>
> >> Actually we do store install location in the registry. It can be found
> >> somewhere deep in
> HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer
> >> subtree.
> >>
> >> It also can be queried using System.Management.Instrumentation:
> >>
> >>
> >>
> >>             ManagementObjectSearcher query1 = new
> >> ManagementObjectSearcher(
> >>
> >>                 "SELECT * FROM Win32_Product where InstallState = 5 and
> >> Caption = 'IronPython 2.0'");
> >>
> >>             ManagementObjectCollection queryCollection1 = query1.Get();
> >>
> >>
> >>
> >>             foreach (ManagementObject mo in queryCollection1) {
> >>
> >>                 Console.WriteLine(mo["InstallLocation"]);
> >>
> >>             }
> >>
> >>
> >>
> >> --
> >>
> >> Oleg
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20081223/5698dfe8/attachment.html>


More information about the Ironpython-users mailing list