fix paths

This commit is contained in:
Vitor Santos Costa 2014-03-11 15:34:26 +00:00
parent d0adb0b910
commit 2c82906714
2 changed files with 11 additions and 15 deletions

View File

@ -146,12 +146,6 @@ absolute_file_name(File,Opts,TrueFileName) :-
% all must try search in path
'$find_in_path'(user,_,user_input, _) :- !.
'$find_in_path'(user_input,_,user_input, _) :- !.
'$find_in_path'(commons(D),_,_, _) :-
% make sure library_directory is open.
\+ clause(user:commons_directory(_),_),
'$system_library_directories'(commons, D),
assert(user:commons_directory(D)),
fail.
'$find_in_path'(S, Opts, NewFile, Call) :-
S =.. [Name,File0],
'$cat_file_name'(File0,File), !,
@ -265,34 +259,33 @@ absolute_file_name(File,Opts,TrueFileName) :-
% windows has stuff installed in the registry
'$system_library_directories'(Library, Dir) :-
'$swi_current_prolog_flag'(windows, true),
once( (
( (
'$swi_current_prolog_flag'(address_bits, 64) ->
( HKEY='HKEY_LOCAL_MACHINE/Software/YAP/Prolog64';
HKEY='HKEY_CURRENT_USER/Software/YAP/Prolog64' )
;
( HKEY='HKEY_LOCAL_MACHINE/Software/YAP/Prolog';
HKEY='HKEY_CURRENT_USER/Software/YAP/Prolog' )
),
), % do not use once/1
% sanity check: are we running the binary mentioned in the registry?
'$system_catch'(win_registry_get_value(HKEY,'bin', Bin), prolog,_,fail) ),
'$system_catch'(win_registry_get_value(HKEY,'bin', Bin), prolog,_,fail) ) -> true,
'$swi_current_prolog_flag'(executable, Bin1),
same_file(Bin, Bin1),
'$system_catch'(win_registry_get_value(HKEY, Library, Dir), prolog,_,fail).
% not installed on registry
'$system_library_directories'(Library, Dir) :-
'$yap_paths'(_DLLs, ODir1, OBinDir ),
'$absolute_file_name'( ODir1, Dir1 ),
'$absolute_file_name'( OBinDir, BinDir ),
% '$absolute_file_name'( OBinDir, BinDir ),
% '$swi_current_prolog_flag'(executable, Bin1),
% prolog_to_os_filename( Bin2, Bin1 ),
% file_directory_name( Bin2, BinDir1 ),
% same_file( BinDir, BinDir1 ),
( Library == library ->
atom_concat( Dir1, '/Yap' , Dir )
atom_concat( ODir1, '/Yap' , ODir )
;
atom_concat( Dir1, '/PrologCommons' , Dir )
atom_concat( ODir1, '/PrologCommons' , ODir )
),
'$absolute_file_name'( ODir, Dir ),
exists_directory( Dir ), !.
% desperation: let's check the executable directory
'$system_library_directories'(Library, Dir) :-

View File

@ -28,6 +28,10 @@ true :- true.
'$init_system'.
'$do_live' :-
'$swi_current_prolog_flag'(file_name_variables, OldF),
'$swi_set_prolog_flag'(file_name_variables, true),
'$init_consult',
'$swi_set_prolog_flag'(file_name_variables, OldF),
'$init_win_graphics',
repeat,
'$current_module'(Module),
@ -92,7 +96,6 @@ true :- true.
'$run_at_thread_start'.
'$init_globals' :-
'$init_consult',
% '$swi_set_prolog_flag'(break_level, 0),
% '$set_read_error_handler'(error), let the user do that
nb_setval('$chr_toplevel_show_store',false).