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
Finding out the version number from a window setup file
Moderator: General Moderators
Re: Finding out the version number from a window setup file
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.
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.
Re: Finding out the version number from a window setup file
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.
Re: Finding out the version number from a window setup file
If you're talking about getting the version of the web server's PHP installation, phpinfo() should do the trick.
Re: Finding out the version number from a window setup file
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.
Re: Finding out the version number from a window setup file
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.
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.
Re: Finding out the version number from a window setup file
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.
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.
Re: Finding out the version number from a window setup file
I'm having a hard time finding it consistently. Most of the results I get use Perl modules or .NET libraries.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 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.