Please, let me just relativize this rant, it's usually addressing a grown situation no single person is responsible for. I removed some parts of the previous post reflecting a bit of bitter experiences, no need to do that here.
And there are still other downsides of the xcopy deployment process, so there is valid criticism, sure, Idially you deploy software the way it's intended. But just a central share is even less ideal. Copying to local, the usual start process becomes giving the users a shortcut to a batchfile making that xcopy/robocopy followed by starting the local exe that may just have been updated, One disadvantage was introduced when Vista allowed to pin an application currently running on the task bar Or in a tile of the start menu in Win8. User do that and (technically) get a shortcut directly to the local EXE, which after that moment now does not update. And I had my pain and learned that the hard way, too.
To overcome that an EXE needs a start code checking it's own version is current. Then starting the EXE directly does not circumvent the update process.
But centralized executable used by many users often mean strange network errors no one can explain, coming from concurrent access the the EXE itself, which VFP never anticipated to be used by multiple users. Concurrent use of the foxuser.dbf intended for use by the one FoxPro user of that executable, and more.
And then you hear them say: "But it works for years". I wonder if they also tell that about their 15 year old car...
OK, so lets reverse this from a rant to constructive advice. Becasue I do think a lot of you already, having managed to follow the steps to create that helper assembly you already proved yourself as "none of them".
You find such deployment scripts here in the FAQ, for example: faq184-4492
That's already more than just an cmd batch file with an xcopy.
I do find robocoy very useful, still:
Code:
c:
cd apps\myapp
IF EXIST myapp.exe ren myapp.exe myapp.ex_
robocopy /MIR \\share\apps\myapp\ c:\apps\myapp
IF EXIST myapp.ex_ ren myapp.ex_ myapp.exe
start /b myapp.exe
This combines the idea of a local apps folder with the idea to let there be no executable file on the share. In this case the EXE file extension is renamed to .EX_ and thus can't be started. The robocopy copies only changed files, so while it runs the EXE has to be named .EX_. After it finishes just rename the local .EX_ to EXE To be able to run it.
But to take the idea to make a version check as start code, I just point out one VFP function: AGETFILEVERSION(). You could compare just a version.txt file that's local to a server share file, but you can do a check that better prevents any cheating when you actually check the version number embedded in your EXE with AGETFILEVERSION(), as this embedded version numbering isn't as easy to manipulate than just a text file.
The concern that this causes a lot of network traffic is not true, the mirror mode means robocopy touches every file, yes, but mainly just its meta data, file size, date, name, to put together a list of files to actually copy. Time to find out nothing changed between central network share and local copy is split seconds, so you get an immediate start.
And then you have all the advantages a local installation has: The only further network load is data access to dbfs, network instabilities won't necessarily affect the local EXE, if you incorporate some behavior how, for example, a POS system stores its receipts local and only commits them at the end of the day, etc. Depends on your needs, of course. Many systems need active central share and won't be of much use in an offline situation, but you're stabilizing that, too.
Bye, Olaf.
Olaf Doschke Software Engineering