A reusable template for creating Chocolatey packages that preserve historical DOS software with DOSBox-X integration.
This template provides a standardized structure for packaging DOS software as Chocolatey packages. It includes:
- Automatic DOSBox-X detection from multiple installation sources
- Configurable launcher with proper directory mounting
- Demo mode for testing the package structure
- Complete installation and uninstallation scripts
Template License: CC BY-NC-SA 4.0 Maintainer: Foadsf Repository: https://github.com/Foadsf/dos-chocolatey-template
The template is a valid, installable Chocolatey package that demonstrates the structure:
choco pack
choco install dos-software-template -s "." -y
dos-software-templateThis will launch DOSBox-X with a demonstration screen showing how the final package will work.
-
Copy the template to a new directory:
cp -r dos-chocolatey-template my-software-chocolatey cd my-software-chocolatey
-
Update these files with your software details:
software-name.nuspec→ rename and update all fieldssoftware-name-launcher.bat→ rename and customize DOSBox-X parameterstools/chocolateyinstall.ps1→ update download URL, checksums, pathstools/chocolateyuninstall.ps1→ update cleanup pathstools/VERIFICATION.txt→ document your software's verificationREADME.md→ describe your specific software
-
Set template mode to false in
tools/chocolateyinstall.ps1:$isTemplate = $false # Change from $true
-
Upload your software to GitHub releases and update the download URL
-
Calculate and update SHA256 hash:
Get-FileHash -Algorithm SHA256 your-software.zip
-
Test and build:
choco pack choco install your-package-id -s "." -y
dos-chocolatey-template/
├── .gitignore
├── software-name-launcher.bat # DOSBox-X launcher (rename this)
├── software-name.nuspec # Package manifest (rename this)
├── README.md # Documentation (update this)
├── test-detection.ps1 # Test DOSBox-X detection
├── test-launcher.bat # Test launcher detection
└── tools/
├── chocolateyinstall.ps1 # Installation script
├── chocolateyuninstall.ps1 # Uninstallation script
├── demo.bat # Demo script (replace with your software)
└── VERIFICATION.txt # Verification documentation
Search and replace these throughout all files:
| Placeholder | Description | Example |
|---|---|---|
[SOFTWARE-NAME] |
Full display name | "DOS Navigator" |
[package-id] |
Chocolatey package ID | dn-dosnav |
[command-name] |
CLI command name | dn |
dos-software-template |
Template package ID | Your package ID |
software-name-launcher.bat |
Launcher filename | dn-launcher.bat |
0.0.1 |
Template version | 1.51.0 |
[username] |
GitHub username | Foadsf |
[repository-name] |
GitHub repo name | dn-dosnav-chocolatey |
[AUTHOR-NAME] |
Original software author | RITLabs |
[YEAR] |
Year of creation | 1995 |
[SHA256-HASH-HERE] |
File checksums | Get with Get-FileHash |
[MAIN.EXE] or [MAIN-COMMAND] |
Main executable | DN.COM |
Edit software-name-launcher.bat to configure DOSBox-X for your software:
"%_DBX%" ^
-set "output=opengl" ^ # Text mode (use openglnb for graphics)
-c "mount c \"%CD%\"" ^ # Mount current directory as C:
-c "mount d \"%_DOS_DIR%\"" ^ # Mount software directory as D:
-c "c:" ^
-c "d:" ^
-c "YOUR-PROGRAM.EXE" # Your software's main executableCommon DOSBox-X configurations:
- Text mode:
-set "output=opengl" - Graphics mode:
-set "output=openglnb" - Sound Blaster:
-c "mixer sb 100" - Memory:
-c "mem /c 64"
Before building, verify DOSBox-X detection works:
.\test-detection.ps1 # PowerShell test
.\test-launcher.bat # Batch file testchoco pack
choco install your-package-id -s "." -yFor safe testing without modifying your system:
# Start sandboxed PowerShell
"C:\Program Files\Sandboxie-Plus\Start.exe" /box:TestBox powershell.exe
# Inside sandbox
cd C:\path\to\package
choco pack
choco install your-package-id -s "." -y
your-commandImportant: Clear the cache between tests:
# On host machine
Remove-Item -Recurse -Force "C:\Sandbox\[User]\[BoxName]\user\all\chocolatey\lib\your-package-id" -ErrorAction SilentlyContinue
# Inside sandbox
choco uninstall your-package-id -y
choco pack
choco install your-package-id -s "." -y --forceCreate test-install.ps1 for faster iteration:
# Clean up completely
choco uninstall your-package-id -y 2>$null
Remove-Item -Recurse -Force "$env:ChocolateyInstall\lib\your-package-id" -ErrorAction SilentlyContinue
# Build fresh package
choco pack
# Install from local source
choco install your-package-id -s "." -y --forceAlways verify your software archive:
Get-FileHash -Algorithm SHA256 your-software.zipUpdate the hash in:
tools/chocolateyinstall.ps1(Checksum parameter)tools/VERIFICATION.txt(documentation)
- Replace all
[placeholders]with actual values - Rename
software-name-launcher.batandsoftware-name.nuspec - Set
$isTemplate = $falsein chocolateyinstall.ps1 - Upload software binary to GitHub releases
- Calculate SHA256 hash and update scripts
- Update VERIFICATION.txt with actual hashes
- Test detection scripts work
- Test installation in Sandboxie-Plus
- Verify uninstallation cleans up properly
- Update README.md with software description
- Add icon to
images/icon.png(optional) - Commit and push to GitHub
- Submit to Chocolatey Community Repository
This template has been used to create packages for:
- Kalanjar - Persian chatbot from 1992
- DOS Navigator - Dual-pane file manager
Improvements to the template are welcome! Please open an issue or pull request.
- Template Author: Foadsf
- License: CC BY-NC-SA 4.0
- Purpose: Historical DOS software preservation