General Category > Feature Request
Version Labels for both AdvancedHMI Build and Current publish revision
Etten:
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:
--- Quote from: 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!
--- End quote ---
By default, doesn't the title of the main window show the version? Or is this something different you are asking for?
Etten:
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:
You can try the following code after you add 2 standard labels and name them "lblAHMIVersion" and "lblPublishedVersion":
--- Code: --- 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
--- End code ---
You can omit either of the labels and remove corresponding code.
Etten:
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!
Navigation
[0] Message Index
[#] Next page
Go to full version