aboutsummaryrefslogtreecommitdiffstats
path: root/translate/mcode/windows/windows_default_path.adb
diff options
context:
space:
mode:
authorgingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7>2006-03-10 02:15:29 +0000
committergingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7>2006-03-10 02:15:29 +0000
commit402c0b3ca702f0e6c3e1e5589c98f01a21d6d6f0 (patch)
treeeccb325bd340a7fb2265810fe0be11a9b74b41dc /translate/mcode/windows/windows_default_path.adb
parentd969ae0b7b1872c931f0da6736e459b6ce6fc981 (diff)
downloadghdl-402c0b3ca702f0e6c3e1e5589c98f01a21d6d6f0.tar.gz
ghdl-402c0b3ca702f0e6c3e1e5589c98f01a21d6d6f0.tar.bz2
ghdl-402c0b3ca702f0e6c3e1e5589c98f01a21d6d6f0.zip
windows distribution based on mcode
Diffstat (limited to 'translate/mcode/windows/windows_default_path.adb')
-rw-r--r--translate/mcode/windows/windows_default_path.adb19
1 files changed, 19 insertions, 0 deletions
diff --git a/translate/mcode/windows/windows_default_path.adb b/translate/mcode/windows/windows_default_path.adb
new file mode 100644
index 000000000..8ad27ed85
--- /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;