Downloading Files Used in Download

Entmv1.bat Entmv2B.bat
Copy files
to 'B' versions:
Create directories.
Set Archive attrib
on all files,
then remove it from:
if only archived
files downloaded


bit set
on any of above

Because a file that is in use (.exe or .bat being executed, or .ocx loaded via an HTML file OBJECT element) cannot be overwritten, those files that must be in use during the download (arbitrarily called 'system files') are copied and renamed before being downloaded.
If any of these are updated during the download, then the download of any further non-system files is stopped, and at the end of the download (with none of the original 'system files' running) the updated files are copied over the originals.
The whole download process is then repeated (this time with probably no 'system' file updates, since they will all have been updated unless a further coincidental change is made at the Centre).


  1. Why not avoid copying 'System' files at the Centre, and just have the Terminal divert them to Temp/Download?
    The target directory, or at least a flag indicating the target is Temp/Download, would have to be sent to the Centre in request 0xE8 for the file data, and returned in the 0xE8 response.
    - This is possible, but there is little gain for the extra complication.

  2. Is SxqPipeI.exe included in the batch files for the Minimal Terminal?
    Yes. But this is just to reduce the number of batch files. SxqPipeI.exe is not included in MintCheck3.xml and is therefore not downloaded for the Minimal Terminal.
    The batch file InstallSysFile.bat just exits if the %1 file is not in Temp/Download.

  3. Why is Pipe16.ocx a 'System File' - the pipe is not used during download?
    Because SxqPipe.exe uses it after the downloading is done, and so the Pipe16 interface stub (Pipe16X.cpp) is included in the Sxqpipe compilation. This drags in Pipe16.ocx whenever SxqPipe is run, which prevents it being changed when SxqPipe does the download.

  4. Why was Pipe16.ocx not included in the previous list of 'System Files'?
    It should have been.

  5. Why are 'System Files' no longer identified using the Archive attribute?
    a)Because it is easy to set and clear archive attributes from batch files, e.g.
    attrib +A *.* /S
    attrib -A LegacyT\SxqPipe\Release\SxqPipe.exe
    but more difficult from JavaScript or C++.
    b)Setting the attribute bit on all the files (before clearing it for the system files) is slow.
    - It takes no time to test for the 'System' type during a download, though the Minimal Terminal has to test for changed system files by comparing the files in Temp/Download with the originals, which takes slightly longer than the 'xcopy /A ...' method used for testing attributes.
    c)Reliance on the archive bit is one more tie to Microsoft. There is no guarantee that other operating systems will set it in the same way, or even support it at all. Using the directory name is more definite.

  6. Why is there a delay at the start of InstallSysFiles.bat?
    To allow time for the HTML window to close, and the 'in use' flags to be cleared from the 'System' files.

  7. Is the order of files in TermCheck3.xml important?
    Yes. EntmvA.bat should be near the start, so any new directories will be set up before attempting to download to them.
    (Downloading a 'system' file will inhibit the download of non-system files till after the restart).