Create a windows service that updates my software ?

foozoor

Newbie
Joined
Nov 16, 2014
Messages
12
Reaction score
0
Is it possible to create a windows service with C# that downloads executables inside tempdir and install them silently each month to keep my software updated ?


I need to create a service that runs only after clicking shutdown (each month) and like Windows Update does, writes something like "1/6 updates applied, don't power off you computer" before power off.

I just need to know if it's possible and if it is, some resources about it.


Thanks in advance.
 
Is it possible to create a windows service with C# that downloads executables inside tempdir and install them silently each month to keep my software updated ?


I need to create a service that runs only after clicking shutdown (each month) and like Windows Update does, writes something like "1/6 updates applied, don't power off you computer" before power off.

I just need to know if it's possible and if it is, some resources about it.


Thanks in advance.


Short answer Yes.

Now fun part, is your software escalated a privileges to run in lower ring ? As we know for updates on software's it's essential for administrator passwords if your software is doing any changes on OS, it will be essential.

Download from to temp dir is easy, and for update part use WUA API :) but remember
1. Updates have to be enabled else you have to code some backend trojan to enable them *sigh
2. WUA API allow you to "add stuff" and it could be your updates to software...

tho I really don't know what your making out of it it seems a) wrong b)malicious there are more easy ways to go when you need updates on software.. direct download and update silently ? no good ?


More easy, less coding and don't have to worry about AV's etc.
 
Short answer Yes.

Now fun part, is your software escalated a privileges to run in lower ring ? As we know for updates on software's it's essential for administrator passwords if your software is doing any changes on OS, it will be essential.

Download from to temp dir is easy, and for update part use WUA API :) but remember
1. Updates have to be enabled else you have to code some backend trojan to enable them *sigh
2. WUA API allow you to "add stuff" and it could be your updates to software...

tho I really don't know what your making out of it it seems a) wrong b)malicious there are more easy ways to go when you need updates on software.. direct download and update silently ? no good ?


More easy, less coding and don't have to worry about AV's etc.

I tried to have something like apt-get upgrade on Ubuntu.
I already created methods that scrape and download latest version of all software I use everyday.
I know about security issues, but even when I download and install my software manually I don't check them really well like infosec engineers with their top decompiler and skills. ;)

As I understand, it's not a good idea to use a service for that.
I created a command line application that I run as a scheduled task and it works pretty well like that.
 
don't write from scratch, use from one of already exsting Release Management APIs. Deploy your software on them. who'll do the coding, qa, alm if you'll start afresh, it will be a waste of resources and reinventing the wheel.
 
Chrome and Firefox browsers use windows services to automatically update themselves. Good way to avoid annoying UAC messages. Even if service is registered under system account, it has access to registry and Program Files
 
Check out Chrome's updater service and the philosophy behind it: google for omaha project :)
 
I have another idea that you can use, create a service or an updater exe file.

Attached to that file the 7zip exe file (as a resource) - 7zip is free.

Your updater exe will have to download a zip file that contain the software files, in its folders architecture (bin, doc, data, template or whatever).

Using your updater, download this file to the temp folder and run CreateProcess API (c++) with the following parameters:
The path to the 7zip exe file.
The path to the downloaded zip file (your zip file, look down for example...).

This will update the files in your software folder.

You need to be able to stop/kill your running software if you want to change it too.
You can delete the zip file and the 7zip exe file when done.
Just do not forget to attached the 7zip exe file as a resource to your updater exe file or as a standalone to your software, and for legal you need to add a 7zip GNU to your software :)

The updater can be used as a service or as an updater tool....

Example:
x - extract files.
-y - yes to all
-o - the software folder.

<path>\7z.exe x -y <your zip file> -o"<your software folder>"

Hope it helps.
 
Last edited:
You need the services of professional experts.Visit the MarketPlace and try to get tools of this type from any professional who can create for you.I hope you'll get good results.
 
Back
Top