Get the installed add-in version number

Add-in Express™ Support Service
That's what is more important than anything else

Get the installed add-in version number
 
Edouard Sioufi




Posts: 2
Joined: 2016-10-08
Hello,

I'm looking for a way to access the currently installed version of the add-in in C#. The add-in is deployed using ClickOnce.

For future reference, it'd also be helpful to get the equivalent method for MSI deployment using ClickTwice.

Thanks!
Posted 05 Jan, 2017 08:40:49 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Edouard,

Could you please specify what do you mean by "version of the add-in"? Is it a value of the AssemblyVersion or AssemblyFileVersion attributes?
Posted 05 Jan, 2017 08:53:02 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello Edouard,

To let you find a solution for this problem, we've extended your subscription for another 10 days.


we're looking for the value of the AssemblyVersion (e.g. 1.0.0.0) in the AssemblyInfo.cs file. We'd like to get the value on a specific machine after the add-in is installed or updated using ClickOnce


You can create a Ribbon button. Clicking the button could display a message box showing this value: System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString().

If you need to retrieve this info from the code running outside of the add-in, you can load the add-in assembly:

private void button1_Click(object sender, EventArgs e) {
    string fullFileName = @"C:Users...ddinAssembly.dll";
    System.Reflection.Assembly asm = System.Reflection.Assembly.ReflectionOnlyLoadFrom(fullFileName);
    MessageBox.Show(asm.GetName().Version.ToString());
}



Andrei Smolin
Add-in Express Team Leader
Posted 10 Jan, 2017 07:22:00 Top
Edouard Sioufi




Posts: 2
Joined: 2016-10-08
Hello Andrei,

Add-In Express's support is the best! Thank you so much for your responsiveness and understanding.

Best,
Edouard
Posted 10 Jan, 2017 07:36:39 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
You are welcome!


Andrei Smolin
Add-in Express Team Leader
Posted 10 Jan, 2017 08:13:36 Top