1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Create a windows service that updates my software ?

Discussion in 'C, C++, C#' started by foozoor, Dec 30, 2014.

  1. foozoor

    foozoor Newbie

    Joined:
    Nov 16, 2014
    Messages:
    11
    Likes Received:
    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.
     
  2. TrafficWizard

    TrafficWizard Junior Member

    Joined:
    Aug 22, 2014
    Messages:
    161
    Likes Received:
    28
    Home Page:

    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.
     
  3. bobbysaran

    bobbysaran Newbie

    Joined:
    Jan 7, 2015
    Messages:
    9
    Likes Received:
    0
    Great thread man :p
     
  4. DFWi Reaper

    DFWi Reaper Regular Member

    Joined:
    Nov 10, 2014
    Messages:
    267
    Likes Received:
    162
    Gender:
    Male
    Occupation:
    Forex Trader
    Location:
    Texas
    So are you running a net or something else? lol
     
  5. foozoor

    foozoor Newbie

    Joined:
    Nov 16, 2014
    Messages:
    11
    Likes Received:
    0
    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.
     
  6. businessoppor

    businessoppor Newbie

    Joined:
    Jan 21, 2015
    Messages:
    11
    Likes Received:
    1
    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.
     
  7. iDeveloper

    iDeveloper Newbie

    Joined:
    Sep 4, 2015
    Messages:
    14
    Likes Received:
    2
    Occupation:
    IM, Software Development
    Location:
    So Cal
    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
     
  8. bretonel

    bretonel Junior Member

    Joined:
    Jun 27, 2015
    Messages:
    125
    Likes Received:
    15
    Occupation:
    programmer
    Location:
    the inter nets
    Home Page:
    Check out Chrome's updater service and the philosophy behind it: google for omaha project :)
     
  9. darklich

    darklich Junior Member

    Joined:
    Feb 27, 2010
    Messages:
    100
    Likes Received:
    32
    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: Apr 4, 2016
  10. living2xl

    living2xl Jr. VIP Jr. VIP

    Joined:
    Dec 9, 2011
    Messages:
    1,733
    Likes Received:
    415
    Occupation:
    Sippin dat juice - Shout it louder!
    Location:
    Not sleeping!
    Home Page:
    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.