Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File Version in VFP8
Message
 
 
To
07/07/2003 08:14:05
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00807392
Message ID:
00808731
Views:
15
Hi Mark,

You can modify the forth part of the version in the AfterBuild Event of the projecthook. Here's sample code that can do that. Keep in mind that it doesn't include any error checks and wasn't tested extensivly.
* EXE name
lcExeName = "..."
* New value for Version Part member
lnVersonPart = 2345
* Version info signatures
lcSig1 = "VS_VERSION_INFO"
lcSig2 = CHR(0xBD) + CHR(0x04) + CHR(0xEF) + CHR(0xFE)
* Signature 1 is stored in Unicode
lcSig1W = STRCONV(lcSig1,5)
* Open EXE low-level
lnFH = FOPEN(lcExeName,12)
lcBuffer = FREAD(lnFH, 2^16-1)
lnPos1 = AT(lcSig1W, lcBuffer)
* The second signature should follow the first one
lcBuffer2 = SUBSTR(lcBuffer, lnPos1)
lnPos2 = AT(lcSig2, lcBuffer2)
* Position of Version Part member in the file
lnVersonPartPos = lnPos1 + lnPos2 + 12 - 1
* Set file pointer to the Version Part member
= FSEEK(lnFH, lnVersonPartPos-1)
* Write new value
= FWRITE(lnFH, CHR(lnVersonPart % 256) + ;
				CHR(lnVersonPart / 256 ))
= FCLOSE(lnFH)
>I am are currently involved in a project that requires VFP executables to contain a file version with four separate sections such as 4.2.1.1
>
>1.) Major (4)
>2.) Minor (2)
>3.) Class I Major (1)
>4.) Class II Minor (4).
>
>Our client uses this file version structure as part of there own change control and configuration management. As you know VFP only allows three numbers to be used when compiling the executable. When the properties for the compiled file are shown in XP the last digit is shown as ‘0’. Is there a way of configuration this last number? I can use a HEX editor, but I don’t want to have to use this every time I compile the project.
>
>Mark
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform