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.
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.
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