AdvancedHMI Software

General Category => Feature Request => Topic started by: Etten on July 29, 2022, 10:57:20 PM

Title: Version Labels for both AdvancedHMI Build and Current publish revision
Post by: Etten on July 29, 2022, 10:57:20 PM
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!
Title: Re: Version Labels for both AdvancedHMI Build and Current publish revision
Post by: dmroeder on July 30, 2022, 03:34:50 PM
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?
Title: Re: Version Labels for both AdvancedHMI Build and Current publish revision
Post by: Etten on July 31, 2022, 10:32:16 AM
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
Title: Re: Version Labels for both AdvancedHMI Build and Current publish revision
Post by: Godra on July 31, 2022, 02:47:54 PM
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.
Title: Re: Version Labels for both AdvancedHMI Build and Current publish revision
Post by: Etten on August 01, 2022, 10:30:14 AM
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!
Title: Re: Version Labels for both AdvancedHMI Build and Current publish revision
Post by: Etten on August 01, 2022, 10:52:45 AM
Godra,
The AdvancedHMI Version # Comes Back and works great BTW
Title: Re: Version Labels for both AdvancedHMI Build and Current publish revision
Post by: dmroeder on August 01, 2022, 11:32:25 AM
I think publishing is not a recommended way to deploy.

https://www.advancedhmi.com/forum/index.php?topic=2818.msg16762#msg16762
Title: Re: Version Labels for both AdvancedHMI Build and Current publish revision
Post by: pal on August 01, 2022, 03:13:32 PM
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
Title: Re: Version Labels for both AdvancedHMI Build and Current publish revision
Post by: Godra on August 01, 2022, 03:53:23 PM
Check this article to see if that might help:

  https://social.msdn.microsoft.com/Forums/vstudio/en-US/8f5b66b5-d52c-48bc-aa1c-1c212fd74463/cant-map-systemdeploymentapplication?forum=wpf

Title: Re: Version Labels for both AdvancedHMI Build and Current publish revision
Post by: Etten on August 01, 2022, 05:32:48 PM
Godra,
Thank you so much that worked!!! I should've thought about that in the first place, VS is not my strong point.