473,545 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

auto update feature vb.net

I want to implement into my application a mechanism to retrieve the
"latest updates" to my app. I'm looking for various ways to accomplish
this and how to get around the fact that you are running the app and
when you download/copy a new version, the app is in use.

How do you get version info of the new one (without running it) to even
determine if a new one needs to be retreived ?

Should I: (once I have determined a new one is needed)
1) download the new one
2) create a batch file to copy
3) shell out to the batch file
4) close down the app so when the batch runs, the app will be down and
the copy can be done.

Just looking to see how others have done this.

Thanks,
Marc

Nov 21 '05 #1
5 7569
I should add to this that this is on a Intranet, so a shared folder is
acceptable. It can't be run from the shared drive though because of
firewall issues. It has to be run on a persons desktop. It is not a
big download/copy, just a simple .exe and the pdb. It does not need to
be a complicated process. I looked briefly at the .net application
blocks for updaters and it looks like overkill for what I need. This
is just to prevent me from having to send out emails when I update this
app.

Thanks.
ma*****@yahoo.c om wrote:
I want to implement into my application a mechanism to retrieve the
"latest updates" to my app. I'm looking for various ways to accomplish this and how to get around the fact that you are running the app and
when you download/copy a new version, the app is in use.

How do you get version info of the new one (without running it) to even determine if a new one needs to be retreived ?

Should I: (once I have determined a new one is needed)
1) download the new one
2) create a batch file to copy
3) shell out to the batch file
4) close down the app so when the batch runs, the app will be down and the copy can be done.

Just looking to see how others have done this.

Thanks,
Marc


Nov 21 '05 #2
Hi,

If you want to get the version info, you could get the metadata of your
EXE. Since an EXE is still just an assembly, you can do something like this:

---
Dim assNewExe as Assembly
assNewExe = Assembly.LoadFr om("\\Path\To\Y our\Drive\App.e xe")

Dim verAttrib as AssemblyVersion Attribute
verAttrib =
CType(assNewExe .GetCustomAttri butes(GetType(A ssemblyVersionA ttribute),
False), AssemblyVersion Attribute())(0)

' verAttrib.Versi on contains the string representation of the assembly ---

Then you compare it with the version of user's copy of the application.

The only drawback to this method is that it requires you to load all of
the types defined in that assembly in order to read it's version
attribute. That chews up copious amounts of memory that your application
never makes use of. And that really sucks. Perhaps there's a better way
I dont know of ;)

The solution to that problem is to load the assembly in a 2nd AppDomain
and then unload that AppDomain when you're done checking the version
data. This way you free all of the memory that was claimed by loading
that assembly to check it's version.

As for the problem of updating the executable, I have no experience with
that. Sorry :)

Regards,
-Adam.

ma*****@yahoo.c om wrote:
I want to implement into my application a mechanism to retrieve the
"latest updates" to my app. I'm looking for various ways to accomplish
this and how to get around the fact that you are running the app and
when you download/copy a new version, the app is in use.

How do you get version info of the new one (without running it) to even
determine if a new one needs to be retreived ?

Should I: (once I have determined a new one is needed)
1) download the new one
2) create a batch file to copy
3) shell out to the batch file
4) close down the app so when the batch runs, the app will be down and
the copy can be done.

Just looking to see how others have done this.

Thanks,
Marc

Nov 21 '05 #3
Mafi,

My prefered way.

Start a seperated program and close your main program
Use a windowservice in that seperated program to determ what are the newest
assemblies
Download the newest ones just with a command as downloadclient( url,path)
(with not running names)
Rename your older programs to dummy names
Rename your new programs to the actual
Delete your older programs with the dummy names.

(When you have to update the update program you have to create an special
routine by downloading that and creating a very small commandline program
that after the update program has had enough time to close, renames the old
one, renames the new one, deletest the old one and start the new one)

In the next version of VBNet this kind of procedure will be implemented as
"click once update",

However the above just as idea

Cor
Nov 21 '05 #4
<ma*****@yahoo. com> schrieb:
I want to implement into my application a mechanism to retrieve the
"latest updates" to my app.
[...]
Should I: (once I have determined a new one is needed)
1) download the new one
2) create a batch file to copy
3) shell out to the batch file
4) close down the app so when the batch runs, the app will be down and
the copy can be done.


<URL:http://www.google.com/search?q=applic ation+updater+b lock>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #5
I got this all working except now I realize why I need to load the
"checking" version into a 2nd domain, but I'm having problems getting
it to work. I'm using Load from the new domain object, but it gives me
a filenotfound exception, yets its there. if I just change it back to
using assembly.loadfr om (file), it works fine.

Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1380
by: Fred | last post by:
Hi, I'm currently checking out what's available to add an auto-update feature à la Yahoo/MSN to our Windows applications written in VB. Those that I checked so far require generating a list of files along with a copy (full, or just a patched version) of each file, upload the stuff to a www server, and have the client app download the...
2
2361
by: Rene Aguirre | last post by:
Hello everybody, Recently I made a 'improvement' from an 'old' system we used for i2c bus testing as I had no access to the source code, I started from scratch on Python/wxPython. The idea just came from a Python/wxPython trial in my spare time, then suddently I realized that the system was already a working prototype, at least the main...
18
2193
by: nenad | last post by:
Wouldn't it be nice if we could do something like this: class Funky{ public: auto virtual void doStuff(){ // dostuff } };
11
1949
by: UJ | last post by:
Has anybody had any experience writing an auto update program that will check the internet to see if there is a newer version of the code out there and download it? It doesn't seem that complicated but I just wanted to hear from people who have done it if there are any gotchas I should watch out for. TIA - Jeffrey.
1
3040
by: news.microsoft.com | last post by:
Hello When we build a setup project. As long as we use the same setup.msi, it will give you the option of repair & remove. However, if I send them an update, it tells you have an instance of the program installed, remove it by going to add / remove.
9
24138
by: junlia | last post by:
Does anyone how how can we disable the auto-postback feature in asp.net page? I have to use a server side control in the page, but the auto post back feature in it causes problems for me. Please help! Thanks much, Junlia
15
5787
by: Neo | last post by:
Hello All, I found that ASP.net website only accepts code withing site directory. This creates big hurdle in shairng code. How to share code between two websites, like the way share between two non-website code? -Pravin
1
1457
by: glasssd | last post by:
Hi, I was hoping someone might have some ideas on how I can hack around a problem I'm having with the auto-complete feature of the ComboBox. I have a data entry application that uses a pair of ComboBoxes on the main entry screen. These are configured to use the Suggest Append auto-complete feature with the List Items as the data source. ...
1
19798
DebadattaMishra
by: DebadattaMishra | last post by:
Introduction In case of rich applications, you must have observed that a text field behaves like a dynamic combo box. When the user enters some characters in the text field, a popup will come up with a list of values as suggestions to the user. This feature is called auto completion. In case of Eclipse editor, you must have seen while writing...
0
7499
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7432
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7689
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7943
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7456
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6022
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5359
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3470
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1919
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.