Page 1 of 1

Reading SharpCap version number

Posted: Tue Aug 28, 2018 1:56 am
by 1CM69
Is there anyway to read SharpCap’s version number via scripting?

Cheers

Kirk

Re: Reading SharpCap version number

Posted: Tue Aug 28, 2018 6:50 am
by admin
A bit hacky, but

Code: Select all

SharpCap.GetType().Assembly.GetName().Version.ToString()
does the trick.

cheers,

Robin

Re: Reading SharpCap version number

Posted: Tue Aug 28, 2018 7:13 am
by 1CM69
admin wrote: Tue Aug 28, 2018 6:50 am A bit hacky, but

Code: Select all

SharpCap.GetType().Assembly.GetName().Version.ToString()
does the trick.

cheers,

Robin
Thanks Robin, just need it to put a condition in my script for pre & post v3.2

Cheers

Kirk

Re: Reading SharpCap version number

Posted: Thu Aug 30, 2018 9:58 am
by 1CM69
Hi,

purely to let my script function with SharpCap pre & post v3.2 where the the property 'CaptureLimitValue' has been superseded in v3.2, see: viewtopic.php?f=14&t=1055

There are two options that I am considering and these could also be used for any future changes, each with a draw back:

OPTION 1:
here I need to keep an eye on the changing future versions & alter the slice point if the Major build becomes more than a single digit as well as changing the figure after the operator.

Code: Select all

if float(SharpCap.GetType().Assembly.GetName().Version.ToString()[:3]) < 3.2:
	SharpCap.ShowNotification('Below v3.2')
else:
	SharpCap.ShowNotification('v3.2 & Above')


OPTION 2:
this option is not reliant on changes to the Major build but I would still need to alter the figure after the operator.

Code: Select all

if float(SharpCap.GetType().Assembly.GetName().Version.Major.ToString() + '.' + SharpCap.GetType().Assembly.GetName().Version.Minor.ToString()) < 3.2:
	SharpCap.ShowNotification('Below v3.2')
else:
	SharpCap.ShowNotification('v3.2 & Above')
Just putting this up in case anyone else needs the info.

Regards..,

Kirk