diff options
Diffstat (limited to 'ide')
| -rw-r--r-- | ide/coqide_main.ml4 | 9 | ||||
| -rw-r--r-- | ide/minilib.ml | 8 | ||||
| -rw-r--r-- | ide/utils/configwin_messages.ml | 4 |
3 files changed, 17 insertions, 4 deletions
diff --git a/ide/coqide_main.ml4 b/ide/coqide_main.ml4 index 9fc0f72b71..7c0f231706 100644 --- a/ide/coqide_main.ml4 +++ b/ide/coqide_main.ml4 @@ -18,7 +18,16 @@ let initmac () = IFDEF MacInt THEN gtk_mac_init Coqide.do_load Coqide.forbid_qui let macready () = IFDEF MacInt THEN gtk_mac_ready () ELSE () END +(* On win32, we add the directory of coqide to the PATH at launch-time + (this used to be done in a .bat script). *) + +let winpath () = + if Coq_config.arch = "win32" then + Unix.putenv "PATH" (Filename.dirname Sys.executable_name ^ ";" ^ + (try Sys.getenv "PATH" with _ -> "")) + let () = + winpath (); let argl = Array.to_list Sys.argv in let argl = Coqide.set_coqtop_path argl in let files = Coqide.process_argv argl in diff --git a/ide/minilib.ml b/ide/minilib.ml index 9833fbd6bc..f072ff9fa2 100644 --- a/ide/minilib.ml +++ b/ide/minilib.ml @@ -58,7 +58,13 @@ let list_filter_i p = let subst_command_placeholder s t = Str.global_replace (Str.regexp_string "%s") s t -let home = try Sys.getenv "HOME" with Not_found -> "." +(* On win32, the home directory is probably not in $HOME, but in + some other environment variable *) + +let home = + try Sys.getenv "HOME" with Not_found -> + try (Sys.getenv "HOMEDRIVE")^(Sys.getenv "HOMEPATH") with Not_found -> + try Sys.getenv "USERPROFILE" with Not_found -> "." let coqlib = ref "" let coqtop_path = ref "" diff --git a/ide/utils/configwin_messages.ml b/ide/utils/configwin_messages.ml index f89844627e..de29243182 100644 --- a/ide/utils/configwin_messages.ml +++ b/ide/utils/configwin_messages.ml @@ -30,9 +30,7 @@ let version = "1.2";; let html_config = "Configwin bindings configurator for html parameters" -let home = - try Sys.getenv "HOME" - with Not_found -> "" +let home = Minilib.home let mCapture = "Capture";; let mType_key = "Type key" ;; |
