Community
Showing results for 
Search instead for 
Do you mean 
Reply

How to tell which version of Act a plugin is hosted by?

Tuned Listener
Posts: 35
Country: Australia

How to tell which version of Act a plugin is hosted by?

Is this the easiest way to discover the version of Act?

 

void ACTAPP_AfterLogon(object sender, EventArgs e) {

 

   string s = System.Reflection.Assembly.GetEntryAssembly().GetName().ToString();

 

   int p = s.IndexOf("Version="); p += 8; int p2 = s.IndexOf(",", p);

   Debug.WriteLine(String.Format("Version = " + s.Substring(p, p2 - p)));

Reece harper

Act! Certified Consultant Australia
http://www.databasepartners.com.au
Bronze Super Contributor
Posts: 1,231
Country: USA

Re: How to tell which version of Act a plugin is hosted by?

I do it one of two ways..

 

Using the assemble

Public ReadOnly Property ACTVersion() As Version Get Dim ParentAssembly As System.Reflection.Assembly = Nothing If System.Reflection.Assembly.GetEntryAssembly Is Nothing Then ParentAssembly = System.Reflection.Assembly.GetCallingAssembly Else ParentAssembly = System.Reflection.Assembly.GetEntryAssembly End If Return ParentAssembly.GetName().Version() End Get End Property

 

or from ActApplication but that returns it as a string. Smiley Sad

 

ACTAPP.ProductVersion if ACTAPP.ProductVersion.Substring(0, 3) = "9.0" ' Using ACT 9.0 endif

 

-- jim durkin