[Klone-users] Windows service : change and know the execution path

Mickael Auger mickael.auger at gmail.com
Wed Nov 25 09:15:02 EST 2009


Hi Steven,

thank you for response but it's my question (sorry :(  ).
For example, I have an installation folder "C:\ProgramFiles\KLoneApp" what
contains :
- kloned.exe
- config.ini (this file will be modify by another application)

If I launch "kloned.exe" as standard application in MS-DOS console, the
execution folder is "C:\ProgramFiles\KLoneApp".
But if I install kloned as a Windows service and I launch "kloned.exe" with
"net start kloned" command line, the execution folder is
"C:\windows\system32".

To read my "config.ini" file, I have this index.klx.

================================
<html>
<body>
<%
FILE *file;
file = fopen("config.ini","r); //local file in "C:\ProgramFiles\KLoneApp"
if(file)
{
  ...
  fclose(file);
}
%>
</body>
</html>
================================

I would be known this installation directory which contains "kloned.exe" to
change the execution path by calling SetCurrentDirectory() Windows function.
This installation directory is stored in Windows registry (in ImagePath
key).

This way, my KLone application could be execute regardless of standard
application or service mode.

Can you have a function (or a solution) to know this installation directory,
please ?

2009/11/25 Steven Dorigotti <dorigotti at koanlogic.com>

> Hi Mickaël,
>
>  so you managed to cross-compile or in this case did you also compile on
> win?
>
>  The win service should point to the directory from which you ran
> "kloned -i", so that should be your reference executable.
>
>  In order to access content on your local file system you need to
> make sure the sup fs was setup correcly upon build, so:
>
> KLONE_CONF_ARGS += --enable_fs
>
>  and make sure the document root is setup correctly in your configuration
> file:
>
> dir_root        /path/to/dir/www
>
>  where the path should be relative to the msys installation  (in this
> case for example c:\msys\1.0\path\to\dir\www)
>
>  Have you already done these steps and still have trouble?
>
> bye,
> Steven
>
>
> 2009/11/24 Mickael Auger <mickael.auger at gmail.com>:
> > Hi,
> >
> > I compile and execute KLone as a Windows service, but I need to two
> > informations.
> >
> > How can I know and / or change the run directory of kloned ?
> >
> > How can I know the folder containing the kloned binary ?
> >
> > Know this folders could me to manage a lot of personal file provided with
> > kloned binary (in the install folder).
> >
> > Bye.
> > --
> > Mickaël AUGER
> >
> >
> > _______________________________________________
> > Klone-users mailing list
> > Klone-users at koanlogic.com
> > http://koanlogic.com/cgi-bin/mailman/listinfo/klone-users
> >
> >
>
> _______________________________________________
> Klone-users mailing list
> Klone-users at koanlogic.com
> http://koanlogic.com/cgi-bin/mailman/listinfo/klone-users
>



-- 
Mickaël AUGER
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://koanlogic.com/pipermail/klone-users/attachments/20091125/6e706353/attachment.htm


More information about the klone-users mailing list