#!/usr/bin/env python3 """Generate DOS 5 compatible launchers for original NetWare client media.""" from pathlib import Path import zipfile,hashlib,json root=Path(__file__).resolve().parents[1];out=root/'releases/dos';out.mkdir(parents=True,exist_ok=True) oses={'ms5':'MS-DOS 5.x','ms6':'MS-DOS 6.x / 6.22','ms7':'MS-DOS 7.x standalone','pc':'IBM PC DOS 5-7 / 2000','dr':'DR DOS / Novell DOS 6-7','free':'FreeDOS 1.x'} clients={'netx':'NETX','vlm':'VLM','client32':'Novell Client32 (386 or later)'} installer='''@echo off rem Run from the local package directory. No Windows CMD extensions. echo NetWare client setup helper - read README.TXT first. echo Original client installation media must be extracted in MEDIA. echo Select the NIC/ODI driver and IPX frame type in the vendor setup. echo Existing configuration is managed by the ORIGINAL installer. echo This helper does not modify AUTOEXEC.BAT or CONFIG.SYS. if exist MEDIA\\INSTALL.EXE goto install if exist MEDIA\\SETUP.EXE goto setup if exist MEDIA\\INSTALL.BAT goto batch echo ERROR: Original installer missing. No client has been installed. echo Copy your complete client media into MEDIA, then run again. goto end :install pause cd MEDIA INSTALL.EXE goto finished :setup pause cd MEDIA SETUP.EXE goto finished :batch pause cd MEDIA call INSTALL.BAT :finished cd .. echo Check the original installer result. Reboot if requested. echo After the client has loaded, read CONNECT.TXT for login and mapping. :end ''' connect='''After vendor installation/reboot, check that the selected NetWare client and the network adapter driver have loaded. Use the client's original LOGIN and MAP utilities. Example commands (replace SERVER and USER): LOGIN SERVER/USER MAP ROOT T:=SERVER/SYS:PUBLIC Never put a password into batch files. The login program prompts for it. Use only a free drive letter; do not replace an existing mapping accidentally. The server and client must use the same IPX frame type and network. This helper does not add LFN support. Shared live DOS aliases are not yet implemented by the MARS package. Read-only snapshots are a separate feature. ''' manifest={} for os,label in oses.items(): for client,title in clients.items(): name=os+'-'+client+'.zip' readme=f'''DOS CLIENT INSTALLATION HELPER\r\nSystem profile: {label}\r\nClient profile: {title}\r\n\r\nThis is NOT a complete NetWare client distribution. No NETX/VLM/Client32\r\nbinaries or NIC drivers are included. Obtain the original client media\r\nand a suitable ODI driver for your network adapter. Check the vendor's\r\nDOS-version and CPU requirements; the profile is not a compatibility guarantee.\r\nClient32 does not run on 8086/286 machines.\r\n\r\n1. Back up AUTOEXEC.BAT, CONFIG.SYS and existing client configuration.\r\n2. Extract this ZIP to a short local path, e.g. C:\\NWSETUP.\r\n3. Extract the original client installation disks into MEDIA, retaining\r\n their directory structure. Do not copy only a single installer EXE.\r\n4. Change to C:\\NWSETUP and run INSTALL.BAT.\r\n5. The ORIGINAL installer performs hardware setup and configuration.\r\n For releases without INSTALL.EXE/SETUP.EXE/INSTALL.BAT, follow their\r\n original installation instructions instead.\r\n6. Reboot if requested, then follow CONNECT.TXT.\r\n\r\nStatus: archive and batch structure checked; not run on real DOS.\r\n''' files={'INSTALL.BAT':installer.replace('\n','\r\n').encode('ascii'),'README.TXT':readme.encode('ascii'),'CONNECT.TXT':connect.replace('\n','\r\n').encode('ascii'),'MEDIA/README.TXT':b'Place COMPLETE original client installation media here.\r\n'} with zipfile.ZipFile(out/name,'w',zipfile.ZIP_DEFLATED) as z: for fn,data in files.items(): info=zipfile.ZipInfo(fn,(2026,11,28,0,0,0));info.compress_type=zipfile.ZIP_DEFLATED;z.writestr(info,data) manifest[name]=hashlib.sha256((out/name).read_bytes()).hexdigest() (out/'SHA256SUMS').write_text(''.join(v+' '+k+'\n' for k,v in manifest.items())) (out/'manifest.json').write_text(json.dumps(manifest,indent=2)+'\n') print('Generated 18 DOS installation helper packages (original media required)')