[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Finding the file version of a win32 dll in Ruby

Jano Svitok

10/3/2006 3:18:00 PM

On 10/3/06, Phil Wilson <canuckdba@gmail.com> wrote:
> Is there a way to determine the file version attribute in win32 using Ruby?
> I would like to report and compare file versions between 2 different windows
> computers using Ruby. I am mainly concerned with dll, ocx and exe file
> types.
>
> Thanks for any help.
> Phil

I use filever.exe (download from [1] and/or win xp sp2 cd) and this:

module Win
class Version
class << self
# returns version as array i.e. [1, 2, 12312, 5] or
# empty array
def get_version_array(path)
(get_version(path) || '').split('.').collect {|i| i.to_i}
end

# return version as string ('1.2.12312.5') or nil
def get_version(path)
ver = short(path)
ver.empty? ? nil : ver[14..30].strip
end

def short(path)
`filever /B /A "#{Path.to_win(path)}" 2>&1`
end

def full(path)
`filever.exe /V "#{Path.to_win(path)}" 2>&1`
end
end
end
end

[1] http://www.microsoft.com/downloads/details.aspx?FamilyId=49AE8576-9BB9-4126-9761-BA8011FABF38&disp...

7 Answers

Jano Svitok

10/3/2006 3:23:00 PM

0

On 10/3/06, Jan Svitok <jan.svitok@gmail.com> wrote:
> On 10/3/06, Phil Wilson <canuckdba@gmail.com> wrote:
> > Is there a way to determine the file version attribute in win32 using Ruby?
> > I would like to report and compare file versions between 2 different windows
> > computers using Ruby. I am mainly concerned with dll, ocx and exe file
> > types.
> >
> > Thanks for any help.
> > Phil

look at this thread as well:
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-t...

this is the WINAPI funciton to call:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/resources/versioninformation/versioninformationreference/versioninformationfunctions/getfileversi...

tankow

10/3/2006 4:20:00 PM

0

Thanks, I'll take a look.


AStext

10/10/2012 4:51:00 AM

0

On Wednesday, October 10, 2012 3:27:54 PM UTC+11, Farm1 wrote:
> "AStext" <astext@gmail.com> wrote in message
>
> > On Wednesday, October 10, 2012 6:41:20 AM UTC+11, Gillard=Dudd in a frock.
>
> > wrote:
>
>
>
> >> Only hours after the Prime Minister voted to keep him in the chair and
>
> a ferocious personal attack on Tony Abbott for misogyny, she
>
> >> sat as a stony witness to Slipper's tearful resignation for the same
>
> >> failing and degradation of women."
>
> >>
>
> >> Stony faced - I love it!
>
> >
>
> > The duplicitous, dishonest, misandrist, backstabbing hypocrite getting
>
> > just what she deserves!
>
>
>
> Tony had his stony faced 15 minutes as Gillard ripped into him for his
>
> misogyny. As a UK observer noted of Gillard's performance:"This is the best
>
> smackdown I've ever seen. Glorious. Advance, Australia Fair"

Top performance by misandrist unindicted criminal Gillard, a tour de force, encore!

Farm1

10/10/2012 7:15:00 AM

0

"AStext" <astext@gmail.com> wrote in message
news:2e653f19-5fc2-42c7-b619-c07e45c3b069@googlegroups.com...
> On Wednesday, October 10, 2012 3:27:54 PM UTC+11, Farm1 wrote:
>> "AStext" <astext@gmail.com> wrote in message
>>
>> > On Wednesday, October 10, 2012 6:41:20 AM UTC+11, Gillard=Dudd in a
>> > frock.
>>
>> > wrote:
>>
>>
>>
>> >> Only hours after the Prime Minister voted to keep him in the chair and
>>
>> a ferocious personal attack on Tony Abbott for misogyny, she
>>
>> >> sat as a stony witness to Slipper's tearful resignation for the same
>>
>> >> failing and degradation of women."
>>
>> >>
>>
>> >> Stony faced - I love it!
>>
>> >
>>
>> > The duplicitous, dishonest, misandrist, backstabbing hypocrite getting
>>
>> > just what she deserves!
>>
>>
>>
>> Tony had his stony faced 15 minutes as Gillard ripped into him for his
>>
>> misogyny. As a UK observer noted of Gillard's performance:"This is the
>> best
>>
>> smackdown I've ever seen. Glorious. Advance, Australia Fair"
>
> Top performance by misandrist unindicted criminal Gillard, a tour de
> force, encore!

But you don't count. You aren't a foreign observer. You are just a sore
loser local whose team isn't parading around with the trophy after a win.


AStext

10/10/2012 11:56:00 PM

0

On Wednesday, October 10, 2012 6:15:08 PM UTC+11, Farm1 wrote:
> "AStext" <astext@gmail.com> wrote in message
>
> news:2e653f19-5fc2-42c7-b619-c07e45c3b069@googlegroups.com...
>
> > On Wednesday, October 10, 2012 3:27:54 PM UTC+11, Farm1 wrote:
>
> >> "AStext" <astext@gmail.com> wrote in message
>
> >>
>
> >> > On Wednesday, October 10, 2012 6:41:20 AM UTC+11, Gillard=Dudd in a
>
> >> > frock.
>
> >>
>
> >> > wrote:
>
> >>
>
> >>
>
> >>
>
> >> >> Only hours after the Prime Minister voted to keep him in the chair and
>
> >>
>
> >> a ferocious personal attack on Tony Abbott for misogyny, she
>
> >>
>
> >> >> sat as a stony witness to Slipper's tearful resignation for the same
>
> >>
>
> >> >> failing and degradation of women."
>
> >>
>
> >> >>
>
> >>
>
> >> >> Stony faced - I love it!
>
> >>
>
> >> >
>
> >>
>
> >> > The duplicitous, dishonest, misandrist, backstabbing hypocrite getting
>
> >>
>
> >> > just what she deserves!
>
> >>
>
> >>
>
> >>
>
> >> Tony had his stony faced 15 minutes as Gillard ripped into him for his
>
> >>
>
> >> misogyny. As a UK observer noted of Gillard's performance:"This is the
>
> >> best
>
> >>
>
> >> smackdown I've ever seen. Glorious. Advance, Australia Fair"
>
> >
>
> > Top performance by misandrist unindicted criminal Gillard, a tour de
>
> > force, encore!
>
>
>
> But you don't count. You aren't a foreign observer. You are just a sore
>
> loser local whose team isn't parading around with the trophy after a win.

All that happened is that the hysterical lying Gillard pulled out the gender card one too many times on the orders of her political Mac'minder.

Gillard has now had her 'jump the shark' moment.

This will become more obvious as the hatred she emanates filters through to more people.

There's been no election yet, so your talk about winners and losers is premature. It indicates an infantile mentality.

Is there anything else about you that is premature?


Farm1

10/11/2012 4:23:00 AM

0

"AStext" <astext@gmail.com> wrote in message
> On Wednesday, October 10, 2012 6:15:08 PM UTC+11, Farm1 wrote:
>> "AStext" <astext@gmail.com> wrote in message
>> > On Wednesday, October 10, 2012 3:27:54 PM UTC+11, Farm1 wrote:
>> >> "AStext" <astext@gmail.com> wrote in message
>> >> > On Wednesday, October 10, 2012 6:41:20 AM UTC+11, Gillard=Dudd in a
>> >> > frock.wrote:

>> >> >> Only hours after the Prime Minister voted to keep him in the chair
>> >> >> and
>> >> a ferocious personal attack on Tony Abbott for misogyny, she
>> >> >> sat as a stony witness to Slipper's tearful resignation for the
>> >> >> same
>> >> >> failing and degradation of women."
>>
>> >> >> Stony faced - I love it!
>>
>> >> > The duplicitous, dishonest, misandrist, backstabbing hypocrite
>> >> > getting
>> >> > just what she deserves!
>>
>>
>> >> Tony had his stony faced 15 minutes as Gillard ripped into him for his
>> >> misogyny. As a UK observer noted of Gillard's performance:"This is
>> >> the
>> >> best
>> >> smackdown I've ever seen. Glorious. Advance, Australia Fair"
>>
>> > Top performance by misandrist unindicted criminal Gillard, a tour de
>> > force, encore!
>>
>> But you don't count. You aren't a foreign observer. You are just a sore
>> loser local whose team isn't parading around with the trophy after a win.
>
> All that happened is that the hysterical lying Gillard pulled out the
> gender card one too many times on the orders of her political Mac'minder.


Do you actually read what you write? 'hysterical lying Gillard', 'gender
card'
'her political Mac'minder'.

> Gillard has now had her 'jump the shark' moment.
>
> This will become more obvious as the hatred she emanates filters through
> to more people.

Your claims about Gillard's 'hatred' has got nothing on the bile and
invective flowing out of your post.

> There's been no election yet, so your talk about winners and losers is
> premature. It indicates an infantile mentality.

Speaking of infantile, I've often wondered why it is that supposedly grown
men lack all ability to be objective when faced with assessing woman in
politics.

> Is there anything else about you that is premature?

Obviously that is your area of expertise.


AStext

10/11/2012 2:54:00 PM

0

On Thursday, October 11, 2012 3:22:44 PM UTC+11, Farm1 wrote:
> "AStext" <astext@gmail.com> wrote in message
>
> > On Wednesday, October 10, 2012 6:15:08 PM UTC+11, Farm1 wrote:
>
> >> "AStext" <astext@gmail.com> wrote in message
>
> >> > On Wednesday, October 10, 2012 3:27:54 PM UTC+11, Farm1 wrote:
>
> >> >> "AStext" <astext@gmail.com> wrote in message
>
> >> >> > On Wednesday, October 10, 2012 6:41:20 AM UTC+11, Gillard=Dudd in a
>
> >> >> > frock.wrote:
>
>
>
> >> >> >> Only hours after the Prime Minister voted to keep him in the chair
>
> >> >> >> and
>
> >> >> a ferocious personal attack on Tony Abbott for misogyny, she
>
> >> >> >> sat as a stony witness to Slipper's tearful resignation for the
>
> >> >> >> same
>
> >> >> >> failing and degradation of women."
>
> >>
>
> >> >> >> Stony faced - I love it!
>
> >>
>
> >> >> > The duplicitous, dishonest, misandrist, backstabbing hypocrite
>
> >> >> > getting
>
> >> >> > just what she deserves!
>
> >>
>
> >>
>
> >> >> Tony had his stony faced 15 minutes as Gillard ripped into him for his
>
> >> >> misogyny. As a UK observer noted of Gillard's performance:"This is
>
> >> >> the
>
> >> >> best
>
> >> >> smackdown I've ever seen. Glorious. Advance, Australia Fair"
>
> >>
>
> >> > Top performance by misandrist unindicted criminal Gillard, a tour de
>
> >> > force, encore!
>
> >>
>
> >> But you don't count. You aren't a foreign observer. You are just a sore
>
> >> loser local whose team isn't parading around with the trophy after a win.
>
> >
>
> > All that happened is that the hysterical lying Gillard pulled out the
>
> > gender card one too many times on the orders of her political Mac'minder.
>
>
>
>
>
> Do you actually read what you write? 'hysterical lying Gillard', 'gender
>
> card'
>
> 'her political Mac'minder'.

Last I looked, this was pretty much plain speak. You seem to have comprehension problems.

>
>
> > Gillard has now had her 'jump the shark' moment.
>
> >
>
> > This will become more obvious as the hatred she emanates filters through
>
> > to more people.
>
>
>
> Your claims about Gillard's 'hatred' has got nothing on the bile and
>
> invective flowing out of your post.

You are a precious flower for someone who has no idea, aren't you? Grow up, meathead.



>
>
> > There's been no election yet, so your talk about winners and losers is
>
> > premature. It indicates an infantile mentality.
>
>
>
> Speaking of infantile, I've often wondered why it is that supposedly grown
>
> men lack all ability to be objective when faced with assessing woman in
>
> politics.

Build a bridge and get over yourself then, since this is some kind of self-delusion on your part.

>
>
> > Is there anything else about you that is premature?
>
>
>
> Obviously that is your area of expertise.