AdvancedHMI Software
General Category => Feature Request => Topic started 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!
-
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?
-
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
-
You can try the following code after you add 2 standard labels and name them "lblAHMIVersion" and "lblPublishedVersion":
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.
-
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!
-
Godra,
The AdvancedHMI Version # Comes Back and works great BTW
-
I think publishing is not a recommended way to deploy.
https://www.advancedhmi.com/forum/index.php?topic=2818.msg16762#msg16762
-
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
-
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
-
Godra,
Thank you so much that worked!!! I should've thought about that in the first place, VS is not my strong point.