Subject: RE: [SWIPL] fail to consult if I click on the file.

From: "Douglas R. Miles" <[email-masked]>
Date: Sat, 29 Sep 2001 11:50:45 -0700

When Installing things on windows 2000 I use these rules (even when they are
not apparently necessary)

On windows 2000 server/advanced server/datacenter:
Before I run an installer i go to the run dialog box and type:

change user /install <press enter or click ok> (the logged in user does not
mater) This gives persistance

On windows 2000 professional:

I log off my administrator 'user' I normally am, and log into the machines
'Administrator'

Next stage after installing SWI-Prolog:

I open regedit:

[HKEY_LOCAL_MACHINE\SOFTWARE\SWI\Prolog]
home="C:\\Program Files\\pl"
fileExtension="P"
cwd="t:\\opt\\pl\\work"

I have learned regardless of shell extensions SWI seems to not auto open any
file except for the one in fileExtension registry key.

In my case I need to ensure the .P file extension is registered to SWI:

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.P]
(default)="prolog.type"

Addtionally (sometimes):

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.swi]
(default)="prolog.type"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.pl]
(default)="prolog.type"

Then for the 

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\prolog.type]
(default)="Prolog Source"
EditFlags=hex:00,00,01,00
BrowserFlags=dword:00000008
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\prolog.type\shell]
(default)=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\prolog.type\shell\consult]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\prolog.type\shell\consult\command]
(default)="C:\\Program Files\\pl\\bin\\plwin.exe"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\prolog.type\shell\consult\ddeexec]
(default)="consult('%1')"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\prolog.type\shell\consult\ddeexec\Appli
cation]
(default)="prolog"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\prolog.type\shell\consult\ddeexec\ifexe
c]
(default)=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\prolog.type\shell\consult\ddeexec\topic
]
(default)="control"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\prolog.type\shell\edit]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\prolog.type\shell\edit\command]
(default)="C:\\Program Files\\pl\\bin\\plwin.exe"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\prolog.type\shell\edit\ddeexec]
(default)="edit('%1')"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\prolog.type\shell\edit\ddeexec\Applicat
ion]
(default)="prolog"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\prolog.type\shell\edit\ddeexec\ifexec]
(default)=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\prolog.type\shell\edit\ddeexec\topic]
(default)="control"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\prolog.type\shell\open]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\prolog.type\shell\open\command]
(default)="\"C:\\Program Files\\pl\\bin\\plwin.exe" -f %1"

-Douglas

> -----Original Message-----
> From: Armando Stellato [mailto:[email-masked]]
> Sent: Saturday, September 29, 2001 2:20 AM
> To: Jonathan D Johnston
> Cc: [email-masked]
> Subject: Re: [SWIPL] fail to consult if I click on the file.
> 
> 
> Thank to you, however I reinstalled SWI-prolog for the third 
> time and it 
> did function! (while the second installation i made some days ago 
> reported the same problem...)
> Better not to investigate in such misteries....
> Thank you anyway, i'll copy the code, may be it'll be useful in the 
> future...
> Armando
> 
> Jonathan D Johnston wrote:
> 
> > Hi, Armando & Jan. May I offer another diagnosis?
> > 
> > [Earlier e-mails reordered]
> > [Armando Stellato]
> > 
> >>Hi, I've installed SWI Prolog on Win 98SE and Win2000.
> >>On the first one, it automatically consults the files that I click 
> >>with the mouse.
> >>On win2000, it fails to consult saying: 'Impossible to find file
> >>"<PATH>\file" or one of its components, verify correctness of path 
> >>and availability of libraries'.
> >>
> > 
> > I get a very similar error message on Win98se if I try to execute a
> > DDE command and there is no DDE server for that command.
> > 
> > [Armando Stellato]
> > 
> >>This is the configuration associated to the pl files (for the
> >>operation consult):
> >>
> > [snip] 
> > 
> >>use DDE (checked)
> >>
> > [snip]
> >  
> > [Jan Wielemaker]
> > 
> >>Was the installation fine? I.e. did the installation error described
> >>here recently trick you?  If installation was fine, what exactly is
> >>registered with the filetype "Prolog Source", associated with .PL
> >>(or whatever you choose)?
> >>
> > 
> > As of SWI-Prolog 4.0.1 (couldn't say as far as the newer versions),
> > plwin does *not* automatically register itself as a DDE server.  In
> > order to use the context menu commands (consult & edit), plwin must
> > have been previously started & code executed to register itself as a
> > DDE server.  Therefore, I have the following code in my pl.ini: 
> > 
> > <Code>
> > :- dde_register_service(prolog(control, Message), do_msg(Message)).
> > 
> > do_msg(Msg) :- back_to_fwd(Msg,Msg1), 
> atom_to_term(Msg1,T,_), call(T).
> > 
> > % Substitute a forward slash (/) for each backslash (\).
> > % Makes the path easier to work with within SWI-Prolog.
> > back_to_fwd([],[]).
> > back_to_fwd(Ain, Aout) :-
> >     sub_atom(Ain, Start, 1, Len, '\\'),
> >     sub_atom(Ain, 0, Start, _, Aleft),
> >     Rem is Start+1,
> >     sub_atom(Ain, Rem, Len, _, ArightIn),
> >     back_to_fwd(ArightIn, ArightOut),
> >     concat_atom([Aleft, ArightOut], '/', Aout).
> > back_to_fwd(A, A).
> > </Code>
> > 
> > Not the prettiest Prolog code, but it does the job.  With this in
> > place, it's easy to select multiple .pl files in Windows Explorer to
> > be used with one plwin listener.  Double-click on the first file,
> > which launches plwin, implicitly consults pl.ini (which registers
> > plwin as a DDE server), & consults the selected file (No 
> DDE needed).
> > For any other .pl files, simply right-click on each & 
> select 'consult'
> > from the context menu.
> > 
> > HTH,
> > Jonathan D Johnston
> > ________________________________________________________________
> > GET INTERNET ACCESS FROM JUNO!
> > Juno offers FREE or PREMIUM Internet access for less!
> > Join Juno today!  For your FREE software, visit:
> > http://dl.www.juno.com/get/web/.
> > 
> > 
> > ----------------
> > * To UNSUBSCRIBE, please use the HTML form at
> > 
> >     
> http://www.swi.psy.uva.nl/projects/SWI-Prolog/index.html#mailinglist
> > 
> > or send mail to [email-masked] using the 
> Subject: "unsubscribe"
> > (without the quotes) and *no* message body.
> > 
> > ** An ARCHIVE of this list is maintained at
> > 
> >     
> http://www.swi.psy.uva.nl/projects/SWI-Prolog/mailinglist/archive/
> > 
> > 
> > 
> 
> 
> 
>