Finding out the version number from a window setup file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
netplay
Forum Newbie
Posts: 6
Joined: Mon May 19, 2008 4:45 am

Finding out the version number from a window setup file

Post by netplay »

Hi There,

On a windows machine, if you right click on a setup file and choose properties, you get the version number of the setup file, on the resulting popup.

How can I access this version number in PHP running on linux machine, if the setup file is present on the web server.

Any pointers on how this can be done will be much appreciated.

Thanks
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Finding out the version number from a window setup file

Post by requinix »

Just pointers?
Version number is stored in the file. Somewhere. Probably as numbers, not as text. All you have to do is figure out where to find it.
netplay
Forum Newbie
Posts: 6
Joined: Mon May 19, 2008 4:45 am

Re: Finding out the version number from a window setup file

Post by netplay »

If I open the file in notepad, the version number is visible. But it's mixed with a lot a other characters. I need a way to read just the version numbers automatically using PHP. There's is definately a way, since windows does it. But I'm not sure how we can do it in PHP.
User avatar
Syntac
Forum Contributor
Posts: 327
Joined: Sun Sep 14, 2008 7:59 pm

Re: Finding out the version number from a window setup file

Post by Syntac »

If you're talking about getting the version of the web server's PHP installation, phpinfo() should do the trick.
netplay
Forum Newbie
Posts: 6
Joined: Mon May 19, 2008 4:45 am

Re: Finding out the version number from a window setup file

Post by netplay »

No.... I want to read the version number of a windows setup file that would be placed on the webserver using PHP just as windows does.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Finding out the version number from a window setup file

Post by requinix »

If you can see the number then PHP can see it too.

Open the file with fopen, fseek to the right position, and fread the number.
When that works with one file and not with another, you'll see the difficulty.
netplay
Forum Newbie
Posts: 6
Joined: Mon May 19, 2008 4:45 am

Re: Finding out the version number from a window setup file

Post by netplay »

I could do that based on an assumption that the version number would always be present at a particular position in the setup file. I suspect it would not be the case. None the less, l will try that out.

Does anyone know if there are any rules on where to find the version number in a windows setup file. Is it just based on a position in the file or are there some rules for it. Just something to ponder. We could use this information if the above approach fails.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Finding out the version number from a window setup file

Post by requinix »

netplay wrote:Does anyone know if there are any rules on where to find the version number in a windows setup file. Is it just based on a position in the file or are there some rules for it. Just something to ponder. We could use this information if the above approach fails.
I'm having a hard time finding it consistently. Most of the results I get use Perl modules or .NET libraries.

I thought it was in the PE header but I can't find it there. If it is, the beginning of that section varies so it's not just a matter of fseeking to the right spot.
Post Reply