Version Number of my application

  • Thread starter Thread starter Chubbly Geezer
  • Start date Start date
C

Chubbly Geezer

Hi

I want to check that users have the latest version of an app by checking
it's version number against that held on the server. Would anyone know how
to access this via code.

Thanks
 
Application.ProductVersion is what you are looking for?

Hi

I want to check that users have the latest version of an app by checking
it's version number against that held on the server. Would anyone know how
to access this via code.

Thanks
 
OK thanks. that's almost what I need.

However, if I check the values returned from 2 different files (both exactly
the same but in 2 locations) they are always different because the file
location is also returned. What I really need is to just pull back the
version number and not all the other info.

Thanks

Chubbly
 
Yes it is thanks. Can I direct that to a file held on a server to compare
versions?

Chubbly
 
Chubbly Geezer said:
However, if I check the values returned from 2 different files (both
exactly the same but in 2 locations) they are always different because the
file location is also returned. What I really need is to just pull back
the version number and not all the other info.

Take a look at the members of 'FileVersionInfo' ('FileBuildPart',
'FileMinorPart', 'FileMajorPart', 'FileVersion', 'ProductBuildPart',
'ProductMinorPart', 'ProductMajorPart').
 
Try

Dim myFileVersionInfo As FileVersionInfo =
FileVersionInfo.GetVersionInfo("E:\Subscriptions\NEW - Subs Reporting
Install\SubsReporting.exe")

If myFileVersionInfo.ProductVersion <> Application.ProductVersion Then

If MessageBox.Show("This product has been updated and you are running an
older version." & vbCrLf & vbCrLf & "Do you wish to get the latest
updates.?", "SUBS REPORTING : WARNING !", MessageBoxButtons.YesNo,
MessageBoxIcon.Question) = DialogResult.Yes Then

Call Shell("C:\Program Files\WARC\Subs Reporting\SubsReportingUpdater.exe",
AppWinStyle.NormalNoFocus)

Application.Exit()

Else

Application.Exit()

End If

End If

myFileVersionInfo = Nothing

Catch objE As Exception

MessageBox.Show(obje.Message, "Error encountered ==> frmMenu_Load")

End Try
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top