29 |
let bin_dir = Filename.dirname Sys.argv.(0) |
let bin_dir = Filename.dirname Sys.argv.(0) |
30 |
|
|
31 |
let hidden_dir_prefix = |
let hidden_dir_prefix = |
32 |
if Autoconf.system = "windows" then "" else "." |
if Autoconf.windows then "" else "." |
33 |
|
|
34 |
let config_dir_basename = hidden_dir_prefix ^ "mldonkey" |
let config_dir_basename = hidden_dir_prefix ^ "mldonkey" |
35 |
|
|
36 |
let home_dir = |
let home_dir = |
37 |
match Autoconf.system with |
match Autoconf.system with |
38 |
| "windows" -> "." |
| "cygwin" |
39 |
|
| "mingw" -> "." |
40 |
| _ -> Filename.concat (try Sys.getenv "HOME" with _ -> ".") config_dir_basename |
| _ -> Filename.concat (try Sys.getenv "HOME" with _ -> ".") config_dir_basename |
41 |
|
|
42 |
let installer_ini = create_options_file (Filename.concat home_dir |
let installer_ini = create_options_file (Filename.concat home_dir |
86 |
if Sys.file_exists (Filename.concat (Sys.getcwd ()) "downloads.ini") then |
if Sys.file_exists (Filename.concat (Sys.getcwd ()) "downloads.ini") then |
87 |
"." |
"." |
88 |
else |
else |
89 |
if Autoconf.system = "windows" && file_basedir_pre <> home_dir then |
if Autoconf.windows && file_basedir_pre <> home_dir then |
90 |
match String2.split file_basedir_pre ':' with |
match String2.split file_basedir_pre ':' with |
91 |
| drive :: directory :: _ -> |
| drive :: directory :: _ -> |
92 |
Unix.chdir (drive ^ ":\\"); |
Unix.chdir (drive ^ ":\\"); |
1470 |
end; |
end; |
1471 |
let oc = open_out_gen [Open_creat; Open_wronly; Open_append] 0o644 !!log_file in |
let oc = open_out_gen [Open_creat; Open_wronly; Open_append] 0o644 !!log_file in |
1472 |
lprintf_to_file := true; |
lprintf_to_file := true; |
1473 |
if Autoconf.system = "windows" then lprintf "%s" win_message; |
if Autoconf.system = "cygwin" then lprintf "%s" win_message; |
1474 |
lprintf_nl "Logging in %s" ( Filename.concat file_basedir !!log_file); |
lprintf_nl "Logging in %s" ( Filename.concat file_basedir !!log_file); |
1475 |
log_to_file oc; |
log_to_file oc; |
1476 |
lprintf_nl "Started logging..." |
lprintf_nl "Started logging..." |