From 402c0b3ca702f0e6c3e1e5589c98f01a21d6d6f0 Mon Sep 17 00:00:00 2001 From: gingold Date: Fri, 10 Mar 2006 02:15:29 +0000 Subject: windows distribution based on mcode --- translate/mcode/windows/windows_default_path.adb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 translate/mcode/windows/windows_default_path.adb (limited to 'translate/mcode/windows/windows_default_path.adb') diff --git a/translate/mcode/windows/windows_default_path.adb b/translate/mcode/windows/windows_default_path.adb new file mode 100644 index 0000000..8ad27ed --- /dev/null +++ b/translate/mcode/windows/windows_default_path.adb @@ -0,0 +1,19 @@ +with GNAT.Registry; use GNAT.Registry; + +package body Windows_Default_Path is + function Get_Windows_Default_Path return String + is + Key : HKEY; + begin + Key := Open_Key (HKEY_LOCAL_MACHINE, "Software\Ghdl"); + declare + Res : String := Query_Value (Key, "Install_Dir"); + begin + return Res & "\lib\"; + end; + exception + when Registry_Error => + -- Do not write an error message, but return a useful default path. + return "{missing HKLM\Software\Ghdl\Install_Dir key}\lib\"; + end Get_Windows_Default_Path; +end Windows_Default_Path; -- cgit