Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to get version no 1

Status
Not open for further replies.

channelmaster

Technical User
Dec 9, 2001
52
PH
Hello! How can I get the version no of my .exe application?
I am using VFP 5.0, I tried to follow the examples of VFP 5 using getfileversion(), it works in the first place but when i build my exe, an error occurs " getfileversion" with an extension of ".prg" cannot be found. I tried to set library to foxtools but the error still persist. Can you help me with this? Thanks in advance.

Rene
 
AGETFILEVERSION(ArrayName,'myexe.exe')

this is the info that is input from the build -> version infomation box.

click on build exe, then select the verson button. the items enterd there is what is retrived with this function.

Attitude is Everything
 
Rene,
Since AGETFILEVERSION() wasn't available till VFP 6.0, I used the following successfully in my VFP 5.0 apps. Make sure you include FoxTools.FLL with your Application in the Install / Setup procedure (It can't simply be included in the Project!).

Code:
* GET_CODEVER.PRG
PARAMETERS p_cFoxToolsDir, p_cCodefile

DIMENSION l_aReturn[12]
LOCAL l_nReturn, l_laddedFT, l_cFTLibLoc, l_cVersion
l_laddedFT = .F.

l_cVersion =""
DO WHILE .T.  && dummy loop for EZ exit
   IF !("FOXTOOLS" $ SET("LIBRARY"))
      l_cFTLibLoc = FoxTools+"FOXTOOLS.FLL"
      IF !GOTFILE(l_cFTLibLoc)
         IF version(2) <> 0 && not Runtime, assume Dev test environment reset
            l_cFTLibLoc = &quot;W:\VFP\FOXTOOLS.FLL&quot; && change as necessary
            IF !FILE(l_cFTLibLoc)
               EXIT   && return nothing in version
            ENDIF
         ELSE
            EXIT      && return nothing in version
         ENDIF
      ENDIF
      SET LIBRARY TO (l_cFTLibLoc) ADDITIVE
      l_laddedFT = .T.
   ENDIF
   l_nReturn = GetFileVersion(p_cCodefile, @l_aReturn)
   IF l_nReturn = 0  && good request
      l_cVersion = l_aReturn[4] && version Info
   ENDIF && l_nReturn = 0  && good request
   EXIT		
ENDDO && .T.

IF l_laddedFT
   RELEASE LIBRARY (l_cFTLibLoc)
ENDIF && l_laddedFT
RELEASE l_aReturn, l_nReturn, l_laddedFT, l_cFTLibLoc

RETURN l_cVersion

*!* EOP: GET_CODEVER.PRG
Rick
 
Dear rgbean,
Thanks for your reply but I still don't understand what you mean by &quot;Make sure you include FoxTools.FLL with your Application in the Install / Setup procedure (It can't simply be included in the Project!)&quot;. When I installed my VFP5 to the full installation. I tried to copy your example codes on my application but &quot;gotfile&quot; cannot be located. Help,thanks in advance.
rene


 
channelmaster

Rick most likely means that you should copy FoxTools.Fll in your application directory.
And when you use the line:
Code:
l_cFTLibLoc = FoxTools+&quot;FOXTOOLS.FLL&quot;
You should specify the path as to where FoxTools.fll is located. Mike Gagnon
 
Mike's hopefully answered your question on FoxTools, and I apologize about GOTFILE() - this is just a wrapper function that works almost the same as the FILE() function. It's just we use this instead, because FILE() has a couple undesirable side effects. (For those that want to know what these are: In some cases it will ignore the full path designated and give a &quot;false&quot; positive 1) it will look inside .APP / .EXE for a file of the same name that was included. 2) It will look in the current FoxPro path for a file of this name - in both cases ignoring the path.)

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top