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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file version upgrade

Status
Not open for further replies.

coachbills6442

Programmer
Mar 31, 2006
4
0
0
US
Hi
I'm new to this VFP9 and am trying to write a program that will check the file version on one workstation with the version in our distribution drive. I use the target in the properties window of the desktop shortcut to call the version check program before the execution of the shortcut program. If the versions differ I need to update the EXE program. My problem is I keep getting the version on the workstation and not the distribution drive. The program works in the development mode but not when I compile it to an EXE.



 
Probably a pathing issue. Can you show us the code you're using to look at the distribution drive?

Tamar
 
The best way to handle this is to have a small program which I call startup. So say I have a program called 'addressbook.exe'. I would have a seperate program called 'startup.exe in the same directory on the network file server. When the user runs 'startup.exe' from the network share, the startup program selects from either a foxpro table or sql server table the 'current exectubable' which I have pushed live. The table would be a simple one with only 1 field caleld 'filename' and 1 record. The nice thing about doing this is if you decide you need to go back a version then you simply change the filename in the table and the next time they launch the 'startup.exe' it runs the previous version. If you program is hardcoded to only find the most current version your flexibiliity is limited. Here is the code I use in one of my more current startup.prg's which is included in a project then compiled into an exe.

** COPY THIS TO FILE CALLED STARTUP.PRG
** ASSUMES YOU HAVE STARTUP.DBF WITH 1 CHAR FIELD CALLED
** progname
** Build in project with table or you can replace the
** fox table with a query to other db using same idea.

SET EXCLUSIVE OFF
SELECT * FROM startup ;
INTO CURSOR Cstartup READWRITE
IF USED('startup')
USE IN startup
ENDIF

** COPIES CURRENT EXE TO LOCAL COMPUTER
EXECSCRIPT("COPY FILE '\\fileserver\program\'+(Cstartup.progname) TO getenv('temp')")
SET SAFETY ON
DO getenv("temp")+"\"+(Cstartup.progname)

Regards,

Rob
 
Thank You
Here is some of the code. Like I said it al works great in development mode but the exe version don't.

DIMENSION AFILEVER[4]
AGETFILEVERSION (AFILEVER, EXENAME+'.EXE')

DIMENSION AODRFILEV[4] && ARRAY OF O-DRIVE FILE VERSION = AODRFILEV
AGETFILEVERSION (AODRFILEV, 'O:\DISTRIBUTE\'+EXENAME+'.EXE')
IF AODRFILEV[4] # AFILEVER[4] THEN
COPY FILE "O:\DISTRIBUTE\"+EXENAME+".EXE" TO EXENAME+".EXE"
ENDIF
 
Rob thanks for your help.

The default path is set to c:\program files\programname

it's almost like it's a VFP bug.
 

Coachbills,

Sorry if this is stating the obvious, but are you sure the version information is actually present in the EXE? It will only be available if the developer explictly puts it there when building the EXE.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike
Yes all the info is there. The tesing I did with the same files worked just fine. The differences were the program was not compiled and was not called from the shortcut menu of the program.

Coach
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top