TITLE=DOSINST ROUTE=/dos/dosinst LOCALE=en MODIFIED=1792417593 URL=https://wiki.teletypegames.org/dos/dosinst L=1 #18 L=2 https://git.teletypegames.org/dos/dosinst L=3 #50 L=4 https://git.teletypegames.org/dos/dosinst/releases/download/v0.6.0/DOSINST-v0.6.0.zip L=5 https://git.teletypegames.org/dos/dosinst/releases/download/v0.6.0/DOSINSTW-v0.6.0.zip L=6 https://git.teletypegames.org/dos/dosinst/releases/download/v0.6.0/DOSINST.EXE L=7 https://git.teletypegames.org/dos/dosinst/releases/download/v0.6.0/DOSINSTW.EXE L=8 https://git.teletypegames.org/dos/dosinst/releases L=9 https://github.com/open-watcom/open-watcom-v2 L=10 #17 L=11 http://www.brutman.com/mTCP/ q│ DOSINST is a DOS program (C++, Open Watcom, 8086 code) that installs, q│ updates and removes programs from an FTP server. Every folder on the server q│ is one program with an cINFO.INIq; DOSINST lists them with the server's and q│ the installed version, and copies the folder you pick to the local disk. Our q│ store is cftp://ftp.teletypegames.orgq; 1GMENU is published there on every q│ release. q│ q│ The same source also builds cDOSINSTW.EXEq for Windows 95 and later (Winsock, q│ in a console window), with the same screen and commands — for Windows q│ machines, where a DOS program does not reach the network. • bRepository:0 2git.teletypegames.org/dos/dosinst • bStore:0 cftp://ftp.teletypegames.org/APPS0 (anonymous, read-only, on the 3FTP 3server) • bDownload v0.6.0:0 DOS: 4DOSINST-v0.6.0.zip · Windows 95 and later: 5DOSINSTW-v0.6.0.zip · the executables alone: 6DOSINST.EXE, 7DOSINSTW.EXE • bReleases:0 8git.teletypegames.org/dos/dosinst/releases — once installed, DOSINST updates itself from the store i[Image: DOSINST program list] r────────────────────────────────────────────────────────────────────────────── 1What it does 1════════════ • bLists0 the program folders of the server with name, version, the installed version and a status: cnew0, cinstalled0, cUPDATE0 (the versions differ) or clocal conly0 (installed, but no longer on the server). • bInstalls0 a program (Enter): downloads its folder with the subfolders to a temporary folder, checks every file (CRC32 and size), and only then moves them to cC:\APPS\FOLDER0, cINFO.INI0 last. A broken or interrupted download leaves the installed program as it was. • bUpdates0 it (Enter again): replaces its files and deletes the ones the new version no longer has (cINSTALL.LST0 lists what DOSINST installed). Files that exist only locally — saves, settings, GMENU's favorites — stay. • bUpdates itself0: DOSINST is in the store too (cDOSINST0 for DOS, cDOSINSTW0 for Windows). Its update goes into the folder of its own executable, and cDOSINST.CFG0 is kept. • bRemoves0 it (Del, asks first): deletes cC:\APPS\FOLDER0. • Also from the command line, for batch files: p DOSINST menu p DOSINST LIST list the programs p DOSINST INSTALL GMENU install or update a program p DOSINST REMOVE GMENU remove an installed program 1The store 1═════════ p / p GMENU/ p INFO.INI p FILES.LST <- CRC32 and size of every file p GMENUPRG.COM p ... p HELLO/ p INFO.INI p HELLO.BAT p DATA/README.TXT <- subfolders are copied too p [program] p name=Hello World p description=The description, in one line. p version=1.0 p platform=DOS • Folders without an cINFO.INI0 are skipped. • cplatform0 is optional, cDOS0 or cWIN320. The DOS build does not list cWIN32 programs; DOSINSTW lists both, since Windows runs DOS programs too. DOSINST's own store folders are cDOSINST0 (DOS) and cDOSINSTW0 (Win32): each build updates itself from its own and does not list the other. • File and folder names must be DOS 8.3 names; DOSINST stops with an error on any other name. • The installed version is read from the copied cINFO.INI0, so there is no separate database on the DOS machine. • cFILES.LST0 (ccrc32 size path0 per line) is optional; cserver/mkfiles.sh FOLDER writes it. Without it DOSINST checks only the size, which it asks the server for. bPublishing0 a program means copying its folder to c/srv/stacks/ftp-server/root/APPS/0 on the server and running cserver/mkfiles.sh on it; no restart is needed. The Woodpecker pipelines of DOSINST, GMENU, BMAGIC and TTGWIKI do this on every cvX.Y.Z0 tag (the cstore0 step): it sends the folders as a tar over SSH to the server's cdeploy0 user, whose key is bound to one fixed command, cci-deploy0 (cinfra/host-config0); that unpacks the upload unprivileged, accepts only the program's own folders with regular files, and swaps them into cAPPS0. No trusted volumes are needed. 1Setup 1═════ DOSINST needs a packet driver and mTCP (its cDHCP.EXE0 fills in the network settings). The settings are in cDOSINST.CFG0 next to cDOSINST.EXE0: p SERVER=ftp.teletypegames.org p PORT=21 p PATH=/APPS p DEST=C:\APPS bDOSBox Staging0 — the NE2000 emulation plus the Crynwr cNE2000.COM0 packet driver (mTCP and the driver in cC:\MTCP0): p [ethernet] p ne2000 = on p p [autoexec] p C:\MTCP\NE2000.COM 0x60 3 0x300 > NUL p SET MTCPCFG=C:\MTCP\MTCP.CFG p C:\MTCP\DHCP.EXE p PATH Z:\;C:\WINDOWS;C:\APPS\GMENU;C:\DOSINST In DOSBox every cPATH0 line replaces the previous one, so all folders go into a single line, starting with cZ:\0 (DOSBox's own commands, like cMOUNT0). For a silent start, set cstartup_verbosity = quiet0 in c[dosbox]0, put c@echo off0 first in c[autoexec]0 and send the output of the programs to cNUL0 (cC:\MTCP\DHCP.EXE > cNUL0). bA real machine0 needs the packet driver of its own network card instead of cNE2000.COM0. DOSINST.EXE does not work in a DOS window of Windows 95/98, because Windows owns the network card there: use cDOSINSTW.EXE0 there, which needs nothing but Windows' own TCP/IP. Windows does not let a running program be overwritten, so DOSINSTW's own update is finished right after it exits. 1The server 1══════════ The store is the cAPPS0 folder of the Teletype Games 3FTP server (cinfra/ftp-server0): anonymous and read-only, passive mode only, ports 21 and 30000–30019. DOSINST connects to the data port on the server's own address, so it also works behind NAT. The root has only cAPPS0 and cWIKI0: a DOSINST older than 0.6.0 has cPATH=/0 in its cDOSINST.CFG0 (an update never changes it) and finds no program there, so set cPATH=/APPS0 in it by hand. 1Building and tests 1══════════════════ The build needs 9Open Watcom v2 (the snapshot release has macOS and Linux binaries): p SOURCE/build.sh The source is in layers, each using only the ones below it through their interfaces (the rules are on the 10DOSLIB page): cmodel0 (programs, FILES.LST, INSTALL.LST, the configuration), crepository0 (the store over FTP, the installed programs, the staging folder of an install), cservice0 (the program list, install, remove), ccontroller0 and cview0 (menu and command line), capp0 (puts them together); the DOS and the Windows build only differ in cmain_dos.cpp0 / cmain_win32.cpp0 and cplatform/0. cSOURCE/lib0 is DOSLIB. The unit tests run on the host without DOSBox, on a fake store and an in-memory disk (a bad checksum, an update that deletes the stale files, a self update, the menu with scripted keys); they check the layers first: p SOURCE/test/unit/run.sh cSOURCE/test/run.sh0 starts the FTP server on the host and runs DOSINST in a headless DOSBox Staging: it lists, installs, updates and removes programs from the command line and from the menu, and compares the copied files byte by byte. The menu is driven by a test build that reads its keys from cTESTKEYS0 and saves the screen. 1License 1═══════ DOSINST uses the 11mTCP TCP/IP library by Michael B. Brutman, which is GPLv3, so DOSINST is GPLv3 too.