PDA

View Full Version : Service



NewsArchive
01-19-2012, 02:26 AM
Friedrich,

Just thinking out loud here. I'd like to do something along this sequence:

1) Make an install that registers an OCX (I know how to do this).
2) When the install runs, installs as a service (2008 Server) and starts it.
3) Check for an update at least once a day and if there, downloads it with no user
interaction. Unconditional.
4) Stops the program, stops the service, removes it.
5) Runs the web update.
6) Checks the OCX version and if newer registers it (think I know how to do this
too <g>).
7) Installs the service and starts it.

So the running service in essence downloads an update, runs the update which stops
and uninstalls the service and then re-install, re-starts. All unattended. Have
any references or examples along these lines?

Russell B. Eggen
www.radfusion.com

NewsArchive
01-19-2012, 02:26 AM
Hi Russ,

1) To install and register the OCX, you can enable the "Register as
OCX/DLL/EXE/TLB" option in the "Install Files" properties.

2) To install a Service, you can use the "Services Visualizer" which lets
you define applications installed as a service. Or use the "Create
Service..." script function. To start the Service, use the "Edit Service
(Start Service)" script function.

3) You can use the "Add/Delete Scheduled Task..." script function that lets
you schedule a program to run. For example, you can run wucheck.exe to
check for updates.

4) To stop and remove a Service, you can use the "Edit Service (Stop
Service)" and "Edit Service (Remove Service)" script functions. BTW, use
"Check Service..." in a LOOP (e.g. 5 times and Sleep for a few seconds to
give the service some time).

5) See 3)

6) You can use the "Get File Info..." script function to retrieve the
version of a file and then use "Compare Version Strings...". To register a
OCX programmatically, you can use "Register File Operation...".

7) See 2)

Friedrich

NewsArchive
01-20-2012, 01:38 AM
Sounds good, thank you.

Russell B. Eggen
www.radfusion.com

NewsArchive
01-20-2012, 01:38 AM
Just a quick thought I had when reading your post:

Installing a service probably require administrator rights.

For a service to be able to start an update that require admin, probably
means that the service will need to run as a user with admin rights - so
be sure to arrange that on first install!

Best regards

Kasper

NewsArchive
01-20-2012, 01:40 AM
It does. I've got batch files for that right now with a message that if not run
with admin rights, it won't work. I like Friedrich's suggestions <g>

Russell B. Eggen
www.radfusion.com