Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Building a software install agent in C#

Posted on 2011-02-22
4
Medium Priority
?
577 Views
Last Modified: 2013-12-17
Hello,
I am building a software install agent which will be broken down into the following sequence...

1. Agent receives software request

The agent (which is a WCF service [WPF front-end]) receives a request which specifies the package ID, package name, source files location and silent install script (this part has already been taken care of).

2. Request is added to download queue

The request is added to a queue where each application that becomes first in line is downloaded from the source files location into a cached location on the local machine

3. Downloaded completes

Once the download is complete, the download is removed from the queue and the agent running in the system-tray presents a balloon asking if the user wants to begin the install (this is in case the user is about to shut-down their machine in which case the install will fail). If the user does not wish to install the software at that moment, the install is pending on the agent.

4. Check existing installs

Scan processes to make sure msiexec is not running. If it is running, the install becomes pending on the agent.

5. Initiate install

Install begins using the silent install script. Other installs may try to launch whilst one is running however it will be made pending on the agent as Step 4 outlines.

6. Install completes

Once msiexec is no longer detected as running, package is removed from installs pending and the cache is deletedMy question is, how would I cache the status of these pending downloads/installs which the agent would read from? Obviously if a user logs off or shuts down their machine, a record of the downloads to be resumed upon next startup needs to be restored as well as the pending installs.

The only way I can think of doing it is to write download requests (Step1/2) to an xml file.. after the download is complete (Step 3), remove the download request from the xml file.. add the pending install (Step 3) to another xml file containing all installs.. after the install is complete (Step 6), remove the install from the xml file.

This seems like a pretty clunky way of doing it though.. anyone got a better idea?
0
Comment
Question by:AdamBock
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
John Claes earned 1500 total points
ID: 34959287
why don't you keep it all in the same Xml ?
I would propose 1 xml Document

This document can be loaded in the startup of your Agent.

The document is kept in memory in the Agent and changed only in memory

This document is saved upon Disk at Stop or End of the agent
0
 

Author Comment

by:AdamBock
ID: 34959987
The document is kept in memory in the Agent and changed only in memory
This document is saved upon Disk at Stop or End of the agent

problem with that is if a system logoff/shutdown isn't executed properly (eg. power failure), the xml will not be saved.

Is there a more efficient way of doing it rather than reading/writing from an xml? whre do programs like uTorrent pull info from in order to load up the previously loaded torrents?
0
 
LVL 33

Expert Comment

by:Todd Gerbert
ID: 34960831
I would create classes to represent download packages and installations; keep a collection or two to represent pending/queued installs/downloads, XML serialization would make reading/writing that information to an XML file trivial.  You'll just need to write to the XML file on disk each time the collection changes.
0
 

Author Closing Comment

by:AdamBock
ID: 35134980
a
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question