[IronPython] Detecting IronPython Installation Directory

Oleg Tkachenko olegtk at microsoft.com
Tue Dec 23 19:17:58 CET 2008


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

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher
Sent: Tuesday, December 23, 2008 9:28 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Detecting IronPython Installation Directory

Looking at the WiX source (is that included in the source distribution?), it doesn't appear that we're deliberately writing this information into the registry.  But the MsiProductInfo function should be able to retrieve it from the sekrit Windows Installer stash.

http://www.pinvoke.net/default.aspx/msi/MsiGetProductInfo.html

Alas, I don't imagine this can be easily accessed from within IronPython itself, but as Michael suggests, there are simpler ways of doing that :).
On Mon, Dec 22, 2008 at 6:10 PM, Jeff Hardy <jdhardy at gmail.com<mailto:jdhardy at gmail.com>> wrote:
Hi,
Does the IronPython 2.0 installer write the installation directory to
a registry key (besides the WIndows Installer keys)? If not, could
that be added to a future release? Or, is there another way to get the
installation directory?

-Jeff
_______________________________________________
Users mailing list
Users at lists.ironpython.com<mailto: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/7b3f38ff/attachment.html>


More information about the Ironpython-users mailing list