[Klone-users] Windows service : change and know the execution
path
Mickael Auger
mickael.auger at gmail.com
Thu Nov 26 03:30:13 EST 2009
Hi,
thank you for your patch.
Hovewer, in Windows service mode I will search the
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\kloned\ImagePath" key in
Windows registry to know the kloned.exe installation directory and call
SetCurrentDirectory to it in "server_init" hook.
So, I would like know the kloned execution mode (application or service).
Have you a solution to distinct this execution mode (kloned launched with
WinMain() or ServiceMain() functions in entry.c) ?
Bye.
2009/11/25 Steven Dorigotti <dorigotti at koanlogic.com>
> Hi!
>
> Ok, your problem is more clear to us now.
>
> Please try the attached patch (using KLONE_TARGET_PATCH_FILE for
> local build or KLONE_HOST_PATCH_FILE for cross-compilation) and setup
> your base path in the kloned configuration file as follows:
>
> chroot c:/your/base/dir
>
> The server will then do the SetCurrentDirectory() on MinGW as you
> suggested.
>
> cheers,
> sd
>
>
> 2009/11/25 Mickael Auger <mickael.auger at gmail.com>:
> > 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
> >
> >
> > _______________________________________________
> > 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/20091126/224ac7cf/attachment.htm
More information about the klone-users
mailing list