Install service application using boxedApp?

Questions, Support, etc.

Install service application using boxedApp?

Postby iPath on Wed Aug 12, 2009 2:27 pm

I'm wondering if it's possible to install service application in the virtual registry?
In one of my apps I'm using DB engine which runas normally as a service. My app uses boxedApp functions and the only one nonvirtual thing is the DB engine. I must tell the user to install it or to install it from code.
The better way would be to embed the DB, extract it as a virtual file, install it in the virtual registry and start it :)
I think I can "pseudo" install the service in the virtual registry by creating needed keys and data in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services. But will the SCM (Service Control Manager) be aware of my newly installed "virtual" service? I think not? I would attach the boxedApp to the process of SCM, but the process has PID of?
"The service control manager (SCM) is started at system boot" taken from: http://msdn.microsoft.com/en-us/library/ms685150(VS.85).aspx

Any ideas?


Thanks :)
Petar
iPath
 
Posts: 13
Joined: Wed Aug 12, 2009 2:10 pm

Re: Install service application using boxedApp?

Postby Artem A. Razin on Wed Aug 12, 2009 6:00 pm

Thank you for your question.

One question from me: how does your application use this DB engine / service? (my idea is to use the engine avoiding SCM...)

Thank you.
Artem A. Razin
Site Admin
 
Posts: 746
Joined: Mon Jul 28, 2008 5:04 pm
Location: St.Petersburg, Russia

Re: Install service application using boxedApp?

Postby iPath on Wed Aug 12, 2009 8:48 pm

The DB engine is installed as a service. It is the server part. My App is the client. The communication is over TCP.

Thanks,
Petar
iPath
 
Posts: 13
Joined: Wed Aug 12, 2009 2:10 pm

Re: Install service application using boxedApp?

Postby Artem A. Razin on Thu Aug 13, 2009 7:38 pm

OK, I see.

Anyway, I would not recommend to inject boxedapp runtime into SCM (services.exe).

Thank you.
Artem A. Razin
Site Admin
 
Posts: 746
Joined: Mon Jul 28, 2008 5:04 pm
Location: St.Petersburg, Russia

Re: Install service application using boxedApp?

Postby iPath on Fri Aug 14, 2009 10:03 am

Services.exe - the missing part of the puzzle :)
I'll try it and I'll write about the results.

Thanks!
Petar
iPath
 
Posts: 13
Joined: Wed Aug 12, 2009 2:10 pm

Re: Install service application using boxedApp?

Postby iPath on Sun Aug 16, 2009 11:47 am

Hi,
The thing I was missing: SCM has it's own database. So installing a service is'nt only a change to registry :)
It seems the only way is to use SC.exe or services APIs to install it i.e. to update services' database.
Anyway, the results of my tests:
1. I embedded the DB engine as a resource.
2. when the program starts I extract it under virtual file name: z:\myDbService.exe (BoxedAppSDK_CreateVirtualFile)
3. I install it, using SC.EXE (SC.EXE does not need the actual .exe to be available)
4. I attach boxedApp SDK to Services.exe (BoxedAppSDK_AttachToProcess) so the SCM to be aware of where my z:\myDbService.exe is when giving it a start control
5. I start the service: net start, sc start or services API

Works nice :)

The only problem is being sure the user has enough priviledges to install a service. I suppose in Vista/7 UAC it will be nightmere :)

BUT, working on this solution I came across other thing. MySQL! Usually it runs as a service. But it may run as ordinary process! That's cool :) I'm going to migrate my App to use MySql instead :)

Thanks again!
Petar
iPath
 
Posts: 13
Joined: Wed Aug 12, 2009 2:10 pm

Re: Install service application using boxedApp?

Postby iPath on Sun Aug 16, 2009 11:50 am

Artem A. Razin wrote:OK, I see.

Anyway, I would not recommend to inject boxedapp runtime into SCM (services.exe).

Thank you.



Oops...I've read this as "I would recomend" :roll:
Anyway - MySQL will be the choice, not needing to attach boxedApp SDK to services.exe

:)
Regards,
Petar
iPath
 
Posts: 13
Joined: Wed Aug 12, 2009 2:10 pm

Re: Install service application using boxedApp?

Postby Artem A. Razin on Sun Aug 16, 2009 2:34 pm

Good news.

Anyway, I hope that you will find BoxedApp SDK useful for some of your projects!

Thank you.
Artem A. Razin
Site Admin
 
Posts: 746
Joined: Mon Jul 28, 2008 5:04 pm
Location: St.Petersburg, Russia


Return to BoxedApp SDK

cron