Reading SharpCap version number

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

Reading SharpCap version number

Post by 1CM69 » Tue Aug 28, 2018 1:56 am

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

Cheers

Kirk

User avatar
admin
Site Admin
Posts: 3094
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Reading SharpCap version number

Post by admin » 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

User avatar
1CM69
Posts: 62
Joined: Tue Nov 14, 2017 9:49 pm

Re: Reading SharpCap version number

Post by 1CM69 » Tue Aug 28, 2018 7:13 am

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

User avatar
1CM69
Posts: 62
Joined: Tue Nov 14, 2017 9:49 pm

Re: Reading SharpCap version number

Post by 1CM69 » Thu Aug 30, 2018 9:58 am

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

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests