Hi all,
Is anyone aware of a way / plugin to get the version out of an application (GetFileVersionInfo() api call)?
Thanks!
It is currently September 16th, 2024, 10:57 am
plugin to get version info from application
-
- Posts: 1
- Joined: November 4th, 2014, 10:02 pm
-
- Developer
- Posts: 22745
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: plugin to get version info from application
There isn't a plugin for that, but you can use the little sigcheck.exe utility from Microsoft and the RunCommand plugin for Rainmeter to get that info:
sigcheck.exe from Microsoft
Note that you need to run sigcheck.exe one time manually, to agree to the licence terms.
Everything you need is included in the .rmskin. Just install it.
sigcheck.exe output will be:
sigcheck.exe from Microsoft
Note that you need to run sigcheck.exe one time manually, to agree to the licence terms.
Everything you need is included in the .rmskin. Just install it.
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
OnRefreshAction=[!CommandMeasure GetProgramInfo "Run"]
[GetProgramInfo]
Measure=Plugin
Plugin=RunCommand
Program=""#@#Addons\sigcheck.exe" "C:\Program Files\Rainmeter\Rainmeter.exe""
State=Hide
OutputType=ANSI
FinishAction=[!ShowMeter MeterProductVersion]
[GetProgramName]
Measure=String
String=[GetProgramInfo]
DynamicVariables=1
RegExpSubstitute=1
Substitute="(?siU)^.*Product:\t(.*)\n.*$":"\1","#CRLF#":""
[GetProgramVersion]
Measure=String
String=[GetProgramInfo]
DynamicVariables=1
RegExpSubstitute=1
Substitute="(?siU)^.*Prod version:\t(.*)\n.*$":"\1","#CRLF#":""
[MeterProductVersion]
Meter=String
FontSize=13
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Program Name: [GetProgramName]#CRLF#Version: [GetProgramVersion]
Hidden=1
DynamicVariables=1
Code: Select all
Sigcheck v2.1 - File version and signature viewer
Copyright (C) 2004-2014 Mark Russinovich
Sysinternals - www.sysinternals.com
c:\program files\rainmeter\Rainmeter.exe:
Verified: Signed
Signing date: 12:04 PM 11/21/2014
Publisher: Open Source Developer
Description: n/a
Product: Rainmeter
Prod version: 3.2.0.2343 (64-bit)
File version: 3.2.0.2343
MachineType: 64-bit
You do not have the required permissions to view the files attached to this post.
-
- Rainmeter Sage
- Posts: 276
- Joined: February 17th, 2014, 12:39 pm
- Location: Hungary
Re: plugin to get version info from application
Hi!
Is there a way to Substitute the version, to get only the numbers, like:
"3202343"
instead of
"3.2.0.2343 (64-bit)"
I am working on a small version checker and notify skin, and i can only check numbers only in calc measure.
Is there a way to Substitute the version, to get only the numbers, like:
"3202343"
instead of
"3.2.0.2343 (64-bit)"
I am working on a small version checker and notify skin, and i can only check numbers only in calc measure.
-
- Developer
- Posts: 22745
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: plugin to get version info from application
rbriddickk84 wrote:Hi!
Is there a way to Substitute the version, to get only the numbers, like:
"3202343"
instead of
"3.2.0.2343 (64-bit)"
I am working on a small version checker and notify skin, and i can only check numbers only in calc measure.
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[MeasureString]
Measure=String
String=3.2.0.2343 (64-bit)
RegExpSubstitute=1
Substitute="^(\d).(\d).(\d).(\d\d\d\d).*$":"\1\2\3\4"
[MeasureCalc]
Measure=Calc
Formula=[MeasureString]
DynamicVariables=1
[MeterString]
Meter=String
MeasureName=MeasureCalc
FontSize=11
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
-
- Rainmeter Sage
- Posts: 276
- Joined: February 17th, 2014, 12:39 pm
- Location: Hungary
Re: plugin to get version info from application
Wow, thank you very much!
Uhm, can i ask one more thing, about that Substitution. I tried to figure it out, how those parts works, it seems a totally different substitution form. Is there any documentation about that i missed?
Uhm, can i ask one more thing, about that Substitution. I tried to figure it out, how those parts works, it seems a totally different substitution form. Is there any documentation about that i missed?
-
- Developer
- Posts: 22745
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: plugin to get version info from application
https://docs.rainmeter.net/manual-beta/measures/general-options/substitute/#RegExpSubstituterbriddickk84 wrote:Wow, thank you very much!
Uhm, can i ask one more thing, about that Substitution. I tried to figure it out, how those parts works, it seems a totally different substitution form. Is there any documentation about that i missed?
https://docs.rainmeter.net/manual-beta/skins/option-types/#RegExp
P.S. That one I used is pretty "future resistant" as we are not likely to have more digits in any of the version, sub version, minor version or build values anytime in the next few years, but to be "future proof" you might use:
Substitute="^([\d]{1,4}).([\d]{1,4}).([\d]{1,4}).([\d]{4,8}).*$":"\1\2\3\4"
Doubt we are ever going to get to version 10000 of Rainmeter... Unless my great, great grandchildren create one for the computer they have implanted in their retinas. Hard to say what version numbers will look like in the Galactic Common Language anyway...
-
- Rainmeter Sage
- Posts: 276
- Joined: February 17th, 2014, 12:39 pm
- Location: Hungary
Re: plugin to get version info from application
jsmorley wrote:Doubt we are ever going to get to version 10000 of Rainmeter... Unless my grandchildren create one for the computer they have implanted in their retinas.
You never know
Million thanks for your helps Sir!
-
- Developer
- Posts: 22745
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: plugin to get version info from application
I am a leaf on the wind...rbriddickk84 wrote:
You never know
Million thanks for your helps Sir!
-
- Rainmeter Sage
- Posts: 276
- Joined: February 17th, 2014, 12:39 pm
- Location: Hungary
Re: plugin to get version info from application
Oh my God, this RegExp and it's Substitution are a nightmare
Probably i will learn Chinese sooner than that
I made a possibly working version update notifier skin, is that worth sharing, or someone else already made one here?
Probably i will learn Chinese sooner than that
I made a possibly working version update notifier skin, is that worth sharing, or someone else already made one here?
-
- Developer
- Posts: 22745
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: plugin to get version info from application
It's simple!!!
String:
3.2.0.2343 (64-bit)
Regular Expression:
^([\d]{1,4}).([\d]{1,4}).([\d]{1,4}).([\d]{4,8}).*$
What the expression does:
Result:
https://regex101.com/
Ok, maybe not "simple"...
String:
3.2.0.2343 (64-bit)
Regular Expression:
^([\d]{1,4}).([\d]{1,4}).([\d]{1,4}).([\d]{4,8}).*$
What the expression does:
Code: Select all
^ asserts position at start of the string
1st Capturing Group ([\d]{1,4})
Match a single character present in the list below [\d]{1,4}
{1,4} Quantifier — Matches between 1 and 4 times, as many times as possible, giving back as needed (greedy)
\d matches a digit (equal to [0-9])
. matches any character (except for line terminators)
2nd Capturing Group ([\d]{1,4})
Match a single character present in the list below [\d]{1,4}
{1,4} Quantifier — Matches between 1 and 4 times, as many times as possible, giving back as needed (greedy)
\d matches a digit (equal to [0-9])
. matches any character (except for line terminators)
3rd Capturing Group ([\d]{1,4})
Match a single character present in the list below [\d]{1,4}
{1,4} Quantifier — Matches between 1 and 4 times, as many times as possible, giving back as needed (greedy)
\d matches a digit (equal to [0-9])
. matches any character (except for line terminators)
4th Capturing Group ([\d]{4,8})
Match a single character present in the list below [\d]{4,8}
.* matches any character (except for line terminators)
* Quantifier — Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy)
$ asserts position at the end of the string, or before the line terminator right at the end of the string (if any)
Code: Select all
Full match 0-19 `3.2.0.2343 (64-bit)`
Group 1. 0-1 `3`
Group 2. 2-3 `2`
Group 3. 4-5 `0`
Group 4. 6-10 `2343`
https://regex101.com/
Ok, maybe not "simple"...