Discussions on extending SharpCap using the built in Python scripting functionality
1CM69
Posts: 63
Joined: Tue Nov 14, 2017 9:49 pm

Is there anyway to read SharpCap’s version number via scripting?

Cheers

Kirk

Posts: 4051
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

### Re: Reading SharpCap version number

A bit hacky, but

Code: Select all

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

cheers,

Robin

1CM69
Posts: 63
Joined: Tue Nov 14, 2017 9:49 pm

### Re: Reading SharpCap version number

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

1CM69
Posts: 63
Joined: Tue Nov 14, 2017 9:49 pm

### Re: Reading SharpCap version number

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:
else:


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: