ive created an application which multiple users will be using on an intranet...

now if i had to make changes to the app(fixes/bugs/etc) after deployment....

what would be the way to go without the user clicking a button to update...

the new version would be put on the server, where the app can just check for updates automatically, and then be installed silently...

any suggestions?
thanx

Recommended Answers

All 19 Replies

what i forgot to mention was that this "app" is developed as for an add-on to another application, as well as a stand alone app...

would the one-click work for the add-on app?

Add-on apps are plugins, using interfaces that needs to be loaded on the main application domain. Upon start up and loading of add-ons, there should be a process that checks if the current add-ons are updated or not ( You need to implement your own protocol to determine this, e.g. via web request to a certain web server then issuing a web get if updated version is present ). If it is not then you should silently download your updated add-ons and re-do the re-initialization of add-on modules.

how would i go about getting the version number of the file on the server... at the moment i check if there is a file, and i want to know how to get the version number

this seems to be working fine...

Dim versionInfo As FileVersionInfo
                versionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(path)

but it returns nothing on my *.msi file... other than the properties, is there somewhere else i should set the version?

Go to project properties under assembly information you can set your own version number there.

ive done that but it still returns a null... which is frustrating... :/

Try this one. It might help.

System.Reflection.AssemblyName assemblyName = System.Reflection.AssemblyName.GetAssemblyName(System.Reflection.Assembly.GetExecutingAssembly().Location);
string version = assemblyName.Version.ToString();

that code gives an error... says

Error	1	'AssemblyName' is a type in 'Reflection' and cannot be used as an expression.

and that code looks like C# and not VB....

so VB it looks like this

Dim assemblyname As System.Reflection.AssemblyName = System.Reflection.AssemblyName.GetAssemblyName(System.Reflection.Assembly.GetExecutingAssembly().Location)
                Dim version As String = assemblyname.Version.ToString()

it returns 1.0.3771.183987

which i have no idea where it gets it from

I forgot you're reading a DLL version number? The code I provided reads the current version of your main application.

This is how I read the version number of my pluggable modules since I created it as a DLL and is dynamically loaded to other application

System.Reflection.Assembly pluginDLL = System.Reflection.Assembly.LoadFile(System.IO.Directory.GetCurrentDirectory() + dllPath + dllName);
                        object pluginModule = pluginDLL.CreateInstance(name, true, System.Reflection.BindingFlags.CreateInstance, null, constructorArgs, System.Globalization.CultureInfo.CurrentCulture, null);

string version = pluginDLL.GetName().Version.ToString();

By the way this is in C# but you can actually convert it to VB.net with no hassle.

ill have a look at this now... my add on has completely stopped working and dont know why...sigh

ok fixed again ( got to love source safe), anyway... the above code doesnt give errors, but it also doesnt allow my add-in to work....

so that doesnt work...?

lets go back a few steps... the things ill need to get to know if i must update

is one, the version of the installed add-on... and 2ndly the version on the server, to know if it must update or not..?

to gt this? id be doing what?

like you mentioned on the first post of this page, it gets the version of the current application.... which is fine for the one side...

Dim assemblyname As System.Reflection.AssemblyName = System.Reflection.AssemblyName.GetAssemblyName(System.Reflection.Assembly.GetExecutingAssembly().Location)
            Dim version As String = assemblyname.Version.ToString()

now i need to get the version from the setup file on the server

hmm we have different ways of loading plugins. Debug on the part of loading your application module then used reflections on that object just like what I did that will solved your problem.

Debug on the part of loading your application module then used reflections on that object just like what I did that will solved your problem.

im not to sure what you mean by this... elaborate please
thanx

This is how i get my version info in to a string variable

Dim myversion As String = System.String.Format(My.Application.Info.Title & " - v{0}.{1:00}", My.Application.Info.Version.Major, My.Application.Info.Version.Minor)

I then pass this to the form text using

Me.Text = myversion

This version info is set in visual studio under My Project
click the Assembly Information button found under the Application tab and edit the Assembly Version to increment it.
it's the same place you set Title, description Copyright etc...

i already get the version of the application running, how would i get the version of the .msi file sitting on the server?

how are you creating this msi?
msi's usually don't have a version tab that you can interrogate the file for.
depending on how you make your msi you might be able to create a custom property you can look up but the simplest ways I've found to do this is to ether have the version in the filename.
eg myapp_2-14.msi
where the 2-14 is the minor and major versions of the file.
or to have a txt file with the msi and read the info and file name from that.

the .msi is automatically created with VS2008

but i think i might just add it in the name...


sounds like a good idea

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.