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