Author Topic: Version Labels for both AdvancedHMI Build and Current publish revision  (Read 5549 times)

Etten

  • Newbie
  • *
  • Posts: 10
    • View Profile
Has anyone made a label that would display the version information? I know VS auto increments the publish version and I would like this to automatically update on each publish so i know what version the customer is on just by asking and not make them exit the application to find the folder that has the info. I think it would be a nice addition and help with troubleshooting. Thanks for any help!

dmroeder

  • Administrator
  • Full Member
  • *****
  • Posts: 212
    • View Profile
Has anyone made a label that would display the version information? I know VS auto increments the publish version and I would like this to automatically update on each publish so i know what version the customer is on just by asking and not make them exit the application to find the folder that has the info. I think it would be a nice addition and help with troubleshooting. Thanks for any help!
  By default, doesn't the title of the main window show the version?  Or is this something different you are asking for?

Etten

  • Newbie
  • *
  • Posts: 10
    • View Profile
under project then advanced hmi properties there is this publish properties the part in red is what i would like to display as a label i cant figure out how to. I found a website that shows how to do it but my code never works, I'm not very good with VS.

Here is the site https://www.codeproject.com/Tips/445830/Automatically-display-your-application-version

and screenshot below

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
You can try the following code after you add 2 standard labels and name them "lblAHMIVersion" and "lblPublishedVersion":

Code: [Select]
    Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        'set AHMI version info
        lblAHMIVersion.Text = "v" & System.Reflection.Assembly.GetExecutingAssembly.GetName.Version.ToString()

        'set published version info
        If System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed Then
            lblPublishedVersion.Text = "v" & System.Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString()
        End If
    End Sub

You can omit either of the labels and remove corresponding code.

Etten

  • Newbie
  • *
  • Posts: 10
    • View Profile
Godra,
I copied your code in and got this error back.
BC30456   'Application' is not a member of 'System.Deployment'.   AdvancedHMI   C:\Users\User\Documents\Test Hmi\AdvancedHMI\MainForm.vb   40   Active

thank you for your help!

Etten

  • Newbie
  • *
  • Posts: 10
    • View Profile
Godra,
The AdvancedHMI Version # Comes Back and works great BTW

dmroeder

  • Administrator
  • Full Member
  • *****
  • Posts: 212
    • View Profile
I think publishing is not a recommended way to deploy.

https://www.advancedhmi.com/forum/index.php?topic=2818.msg16762#msg16762

pal

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
As an alternative ,  I place a small AHMI logo at hte bottom left of the main screen with the AHMI Website address below and a label above with the date that the last change was made . I also change the properties of the mani form title to the AHMI version for example : - AHMI_V399x Turret lathe V4.7

Pal


Etten

  • Newbie
  • *
  • Posts: 10
    • View Profile
Godra,
Thank you so much that worked!!! I should've thought about that in the first place, VS is not my strong point.