Retreive the version of a True Type Font?

Started by jtrask, December 16, 2013, 02:06:55 PM

Previous topic - Next topic

jtrask

How can I retrieve the version of a TTF file on my users computers?

I've already discovered that FileVerInfo won't work.   So far, the only thing I've found is a suggestions to compare hashes to known version of the file.  I'm hoping for something a little easier.

Deana

This sounds like a job for the Property Store extender: http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/tsleft.web+WIL~Extenders/_Third~Party~Extenders/Property~Store~Utility+Property~Store~Extender.txt

Code (winbatch) Select

ttffile = 'C:\Program Files\DVD Maker\bod_r.TTF'
AddExtender("WWPSU45Ix86.dll") ; 32-bit extender
nPSIndex = psuOpenPS(ttffile, 0)
fileversion = psuGetPropertyValue(nPSIndex, "System.FileVersion", 0)
Message("File version:", fileversion)
psuClosePS(nPSIndex)
Exit
Deana F.
Technical Support
Wilson WindowWare Inc.

jtrask

Deana, that was JUST what I needed.

When I first tried it, the psuOpen was failing with "Directory Services object could not be found".  I remembered that if I used Explorer to navigate to C:\Windows\Fonts, the fonts don't get treated as files.  I had to navigate to \\Localhost\C$\Windows\Fonts to be able to right-click and get the file details.  Once I did the same thing with my script, psuOpen worked like it should.

Thank you for your help.  I'm sure I'll be using this extender again soon.

Deana

Quote from: jtrask on December 17, 2013, 06:22:45 AM
Deana, that was JUST what I needed.

When I first tried it, the psuOpen was failing with "Directory Services object could not be found".  I remembered that if I used Explorer to navigate to C:\Windows\Fonts, the fonts don't get treated as files.  I had to navigate to \\Localhost\C$\Windows\Fonts to be able to right-click and get the file details.  Once I did the same thing with my script, psuOpen worked like it should.

Thank you for your help.  I'm sure I'll be using this extender again soon.

Interesting. I wouldn't have considered that referencing the administrative share (\\Localhost\C$\Windows\Fonts). Thanks for sharing your solution.
Deana F.
Technical Support
Wilson WindowWare Inc.