[IronPython] Detecting IronPython Installation Directory

Jeff Hardy jdhardy at gmail.com
Tue Dec 23 20:40:51 CET 2008


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



More information about the Ironpython-users mailing list