?
Solved

Check desktop for updates for an application in Visual Studio

Posted on 2009-04-28
6
Medium Priority
?
198 Views
Last Modified: 2013-11-26
Hi,

I'm building an application in Visual Studio 2008  VB.Net    (   .Net 3.5  )

I want to get my application to check for updates from a folder on the desktop.

It will be installed on many different machines so I need the folder reference to be generic i.e. applicable on all machines.

I've got an example of some code I've used before to make a generic destination folder. I'm presuming I need something similar for the update checks.


How do I get the application to check a generic desktop locations for application updates?


Thanks
'Creates the desktop as a folder location
        Dim strDesktopFolder As String = Environment.ExpandEnvironmentVariables("%userprofile%") & _
        "\Desktop\DASdataFiles"

Open in new window

0
Comment
Question by:davecocks
  • 3
  • 3
6 Comments
 
LVL 12

Expert Comment

by:GuitarRich
ID: 24250046
Once you have that path you can use the FileSystemWatcher to check the folder for updates.
http://articles.techrepublic.com.com/5100-10878_11-6165137.html
http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx
 
0
 
LVL 1

Author Comment

by:davecocks
ID: 24250130
Just to confirm I'm hoping for updates for the actual application / software.

Not necessarily for files in the folder.


0
 
LVL 12

Expert Comment

by:GuitarRich
ID: 24250207
So this would update the application when the update file appeared in the folder? Is the update file going to have a standard name each time? how does it get to the users folder?
For updating all machines it might be better to have a file on a central server rather than each persons desktop, in that scenario someone will have to put the file on each persons machine.
The file could contain the latest version number of the application which could then be checked against the current version.
Or for a more simple approach have you looked into the Click-Once installer for .net - it makes updating an application from a central place very easy although it does have its own issues.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Author Comment

by:davecocks
ID: 24250584
I was hoping non-expert users would be able to place the update in a folder on the desktop. It would have a different version number.

The machines do not have internet access so require manually updating.

Visual Studio does have a publish wizard which asks for a update location. My concern is that this will be unquie to my machine. To get round this I was hoping that during run time / after the install I could input a similar code

Environment.ExpandEnvironmentVariables("%userprofile%") & _
        "\Desktop\DASdataFiles"

into the update location in the application, that way it resolves all issues. It maybe possible to put this into the update check location before publishing but I'm uncertain how to do this.

Thanks for your patience.
0
 
LVL 12

Accepted Solution

by:
GuitarRich earned 2000 total points
ID: 24250721
How would the users get the folder? Using the click-once the update location can be either a website, intranet site, server folder or even a CD.
Do all the users have access to a central server? if so that could be the update location you would just need to specify the UNC path (like \\Server1\SoftwareUpdate) and then publish it to there.
Alternatively you could do the updates yourself as you have suggested. Just check the version number of the update against the program version. I think you would need a launching program to do this tho. Create a new windows app that checks the version number against an internally stored one, it could even check the file version of the main program exe against the version in the update file. Then if they are the same just run the main program exe. If not copy across all updated files and then once it has finished run the main exe. I don't think you could do the update from within the main program tho as it would require you to overwrite the exe file you are currently running.
0
 
LVL 1

Author Closing Comment

by:davecocks
ID: 31575399
Appologies for the long time I've taken to clean up this question.  The closest thing I found to what I needed was this.

http://www.codeproject.com/KB/install/DDayUpdate_Part1.aspx

I haven't yet tried it yet, but I think it fits in with GuitarRich's suggestion about the 'lauching program'

Cheers
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

578 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