Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
I never do this. The EXE, the runtimes, and the data are on the server. The user just has a shortcut on their desktop to a Launcher.EXE program on the server (the user never runs the actual program directly). Launcher just runs the latest version of the program (also on the server, as mentioned). If the program is called MyProgram, I'd put in MyProgram001.EXE when first installed. If I modify the program, I just drop in MyProgram002.EXE. Launcher just looks for the latest version of MyProgramNNN.EXE (using the number, not EXE date/time) and runs that. So to run the latest version, the user simply needs to exit the program and restart it (immediately, in the case of important fixes, or at their leisure when the update is not critical). If I need to do a data structure update, I have a way of forcing the users out and keeping them out until I'm done.Hi Guys,
I know this has been discussed. I would just like to get your various methodologies in doing EXE updates across multiple workstations using the app so I can decide on which to adopt.
Thanks in advance.
I have a way of forcing folks out. They are notified and can save their data (or not). If the elapsed period of time expires before forced shutdown, any changes are reverted and the program shuts down. It's not perfect - I probably need to do some refinement - but generally works well.A little thing about letting 10 users run an executable from the network at the same time... you have to get all 10 to exit the application
in order to update it. Try that a 2pm on a Friday before a public holiday...
dylim,
to summarize, there are many aspects you need to think about which makes updating seem like an impossible task, but you could easily start with something that's working based on only comparing a local version.txt file with version.txt in an update directory and when the update version.txt value is pointing out a later version execute an update.cmd batch file that does the necessary steps to update. That's perhaps the simplest way to handle updates which also automatically does nothing, once the update has updated the local version.txt to contain the same version number as in the update directory. And think about cases like users keeping an EXE running or other special cases later.
Hi,
I'm using a VBS-Script starting my EXE. The script ist comparing the file-date of the exe-file (new and existing) and (depending on the date comparison) copiing the new exe-version and starting or just starting the existing exe.
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")
datei_netz = "S:\xxx\yyy\planung.exe"
datei_loc = "C:\aaa\bbb\planung.exe"
Set oFile_Net = oFSO.getfile(datei_netz)
Set oFile_Loc = oFSO.getfile(datei_loc)
'DateCreated?
Date_Net = cdate(oFile_Net.DateLastModified)
Date_Loc = cdate(oFile_Loc.DateLastModified)
if datediff("n",Date_Net ,Date_Loc) < 0 then
' msgbox("Daten ungleich")
ofso.copyfile datei_netz, datei_loc
else
' msgbox("Daten gleich")
' ofso.copyfile datei_netz, datei_loc
end if
WshShell.CurrentDirectory = "C:\aaa\bbb\"
WshShell.Run("C:\aaa\bbb\planung.exe")
Christoph
Hi Dylim,
The script shown is running as a VBS-file (e. g. Start_planning.vbs) outside of the Vfp-Exe.
All users have this Script on their PC. I only copy a new version in the network-folder and the Script is doing copying and starting the exe.
There's a very simple rule why people here talked about a separate loader.exe or a cmd batchfile or a vbs script file doing the actual EXE updating: When an EXE runs Windows protects the file and does not allow overwriting it, so an update always has to happen in separate code, be it another EXE or a command file. There's little concern about performance, this is the major reason.
You can try yourself, with an even simpler test of trying to BUILD an EXE from your VFP project while the EXE from a previous build runs, the final step to overwrite the EXE will then fail.
So you always need something separate. A vbs script or batch file has the simplicity to be adaptable variing situations not only by you but by network admins, anybody else from the customers (or your own companies) IT department or devops knowing enough about Windows shell commands.
Hello Chriss,
exactly this is the (will known) reason why...
Explanation from Chriss (very good):
<<There's a very simple rule why people here talked about a separate loader.exe or a cmd batchfile or a vbs script file doing the actual EXE updating: When an EXE runs Windows protects the file and does not allow overwriting it, so an update always has to happen in separate code, be it another EXE or a command file. There's little concern about performance, this is the major reason.>>
Best regards
Whoever said loaders need to be updated? I just said you can't integrate the update process into the applicaition exe itself, that needs to be done separetely, i.e. therefore there's a loader or update exe or script.
And here's a situation you might come across: The server fails and is replaced. Share names change, mapped drive letters change or anything changes. Then a loader vbs or cmd can easily be amended, even if paths are hardcoded as in Christophs example vbs script. If a loader get's the path to files to compare and update from meta data files, these can be changed, true, but if that meta data is local you don't have a simple way of changing that confuguration meta data for all clients without the need to go to each clients. If that configuration meta data instead s located centrally on the server that's a problem as it's not available under the same name anymore.
You can point out as you like that the new server should be confiugured to get the old server name, have same share names and and/or be mapped with the same drive letter to not need a loader change. But reality most of the time will differ from ideals. For example another server is used instead of a replacement server, therefore it's name and shares name are bound to other rules. Therefore and because the xcopy deployment name derived from using that simple shell command for the loader, a script file is always simpler to amend to such cases than a loader.exe. Nowadays you can also use robocopy or vbs or powershell scripts, etc. and if you fear of mongering with such files by users, well, they only need execute permissions, not read and even less so write permissions.