From 1b69b22b798a8e7395c109a85011f9d78adcc478 Mon Sep 17 00:00:00 2001 From: Gregory Gauthier Date: Wed, 4 Feb 2026 17:07:55 +0000 Subject: [PATCH 1/7] first attempt at install batch --- INSTALL.BAT | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 INSTALL.BAT diff --git a/INSTALL.BAT b/INSTALL.BAT new file mode 100644 index 0000000..4f14438 --- /dev/null +++ b/INSTALL.BAT @@ -0,0 +1,86 @@ +@echo off +REM ================================================================ +REM INSTALL.BAT - cnotes v0.1.1 DOS Installer +REM ================================================================ +REM Simple installer for Turbo C++ 3.0 built cnotes tools +REM Places everything in C:\CNOTES by default +REM ================================================================ + +cls +echo. +echo cnotes v0.1.1 - DOS Installation +echo ================================= +echo. +echo This will install the cnotes commands (cnadd, cndump, etc.) +echo to C:\CNOTES +echo. +echo You can change the destination by editing this file. +echo. + +set TARGET=C:\CNOTES + +echo Target directory: %TARGET% +echo. + +if exist %TARGET%\nul goto exists +echo Creating directory %TARGET%... +md %TARGET% +if errorlevel 1 goto fail + +:exists +echo Copying files... +copy cnadd.exe %TARGET%\cnadd.exe >nul +copy cndump.exe %TARGET%\cndump.exe >nul +copy cncount.exe %TARGET%\cncount.exe >nul +copy cndel.exe %TARGET%\cndel.exe >nul +copy cnfind.exe %TARGET%\cnfind.exe >nul +copy cnhelp.exe %TARGET%\cnhelp.exe >nul + +if errorlevel 1 goto copyfail + +echo. +echo Add C:\CNOTES to PATH permanently? (Y/N) +choice /c:yn +if errorlevel 2 goto noautoexec + +echo SET PATH=%%PATH%%;C:\CNOTES >> C:\AUTOEXEC.BAT +echo Added to AUTOEXEC.BAT (will take effect after reboot) +goto endauto + +:noautoexec +echo Skipped AUTOEXEC.BAT modification. +echo To use cnotes: +echo 1. Add the directory to your PATH (recommended): +echo. +echo SET PATH=%%PATH%%;%TARGET% +echo. +echo (add this line to AUTOEXEC.BAT for permanent effect) +echo. +echo 2. Or run commands directly: +echo %TARGET%\cnadd "Your first note" +echo. +echo Type CNHELP for command overview. +echo. +:endauto + +echo. +echo Installation complete! +echo. +goto end + +:copyfail +echo. +echo ERROR: Could not copy one or more files. +echo Make sure all .EXE files are in the current directory. +echo Check disk space and write permissions. +goto end + +:fail +echo. +echo ERROR: Could not create directory %TARGET% +echo Check drive letter, disk space, or path. +goto end + +:end +echo. +pause \ No newline at end of file -- 2.39.5 From 946c10e83d7093934426071f5b4710ed9c38cd84 Mon Sep 17 00:00:00 2001 From: Gregory Gauthier Date: Wed, 4 Feb 2026 17:14:27 +0000 Subject: [PATCH 2/7] batch tweaks from grok --- INSTALL.BAT | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/INSTALL.BAT b/INSTALL.BAT index 4f14438..07819d6 100644 --- a/INSTALL.BAT +++ b/INSTALL.BAT @@ -17,7 +17,8 @@ echo. echo You can change the destination by editing this file. echo. -set TARGET=C:\CNOTES +if "%CNOTES_HOME%"=="" set TARGET=C:\CNOTES +if not "%CNOTES_HOME%"=="" set TARGET=%CNOTES_HOME% echo Target directory: %TARGET% echo. @@ -49,6 +50,7 @@ goto endauto :noautoexec echo Skipped AUTOEXEC.BAT modification. +echo. echo To use cnotes: echo 1. Add the directory to your PATH (recommended): echo. @@ -61,8 +63,9 @@ echo %TARGET%\cnadd "Your first note" echo. echo Type CNHELP for command overview. echo. -:endauto +goto endauto +:endauto echo. echo Installation complete! echo. -- 2.39.5 From 04611b6b9d2826b5f785196cf87b530a26de70d3 Mon Sep 17 00:00:00 2001 From: Greg Gauthier Date: Wed, 4 Feb 2026 18:43:36 +0000 Subject: [PATCH 3/7] add customizations for dos release and install --- .gitignore | 1 + MAKEFILE.TC | 26 +++++++++++-- READ-DOS.TXT | 54 +++++++++++++++++++++++++++ make-dos-zip.sh | 97 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 174 insertions(+), 4 deletions(-) create mode 100644 READ-DOS.TXT create mode 100644 make-dos-zip.sh diff --git a/.gitignore b/.gitignore index 48900b0..63ee468 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ .vscode/ .DS_Store build/ +dist-dos/ diff --git a/MAKEFILE.TC b/MAKEFILE.TC index 62ccd43..5646ba8 100644 --- a/MAKEFILE.TC +++ b/MAKEFILE.TC @@ -19,11 +19,21 @@ CFLAGS = -A -w -ml -I.\include SRCDIR = src INCDIR = include BUILDDIR = build +INSTALL_FILE = INSTALL.BAT +README_DOS = READ-DOS.TXT .c.obj: $(CC) $(CFLAGS) -c -o$*.obj $< -all: $(BUILDDIR) $(BUILDDIR)\cnadd.exe $(BUILDDIR)\cndump.exe $(BUILDDIR)\cncount.exe $(BUILDDIR)\cndel.exe $(BUILDDIR)\cnfind.exe $(BUILDDIR)\cnhelp.exe +all: $(BUILDDIR) + $(BUILDDIR)\cnadd.exe \ + $(BUILDDIR)\cndump.exe \ + $(BUILDDIR)\cncount.exe \ + $(BUILDDIR)\cndel.exe \ + $(BUILDDIR)\cnfind.exe \ + $(BUILDDIR)\cnhelp.exe \ + $(BUILDDIR)\$(INSTALL_FILE) \ + $(BUILDDIR)\$(README_DOS) $(BUILDDIR): if not exist $(BUILDDIR) mkdir $(BUILDDIR) @@ -46,7 +56,15 @@ $(BUILDDIR)\cnfind.exe: $(SRCDIR)\cnfind.c $(INCDIR)\platform.h $(INCDIR)\config $(BUILDDIR)\cnhelp.exe: $(SRCDIR)\cnhelp.c $(CC) $(CFLAGS) -e$(BUILDDIR)\cnhelp.exe $(SRCDIR)\cnhelp.c +$(BUILDDIR)\$(INSTALL_FILE): $(INSTALL_FILE) + copy $(INSTALL_FILE) $(BUILDDIR)\$(INSTALL_FILE) + +$(BUILDDIR)\$(README_DOS): $(README_DOS) + copy $(README_DOS) $(BUILDDIR)\$(README_DOS) + clean: - if exist $(BUILDDIR)\*.exe del $(BUILDDIR)\*.exe - if exist $(BUILDDIR)\*.obj del $(BUILDDIR)\*.obj - if exist $(BUILDDIR) rmdir $(BUILDDIR) + if exist $(BUILDDIR)\*.exe del $(BUILDDIR)\*.exe + if exist $(BUILDDIR)\*.obj del $(BUILDDIR)\*.obj + if exist $(BUILDDIR)\$(INSTALL_FILE) del $(BUILDDIR)\$(INSTALL_FILE) + if exist $(BUILDDIR)\$(README_DOS) del $(BUILDDIR)\$(README_DOS) + if exist $(BUILDDIR) rmdir $(BUILDDIR) diff --git a/READ-DOS.TXT b/READ-DOS.TXT new file mode 100644 index 0000000..7ba0c0b --- /dev/null +++ b/READ-DOS.TXT @@ -0,0 +1,54 @@ +cnotes v0.1.1 for DOS +===================== + +A simple command-line note-taking system +Built with Turbo C++ 3.0 (large memory model) + +WHAT IS THIS? +------------ +cnotes lets you quickly add, view, search, count, and archive short notes +from the DOS prompt. Notes are saved in plain cnotes.csv in your notes +directory (usually current directory on DOS). + +COMMANDS INCLUDED +----------------- +CNADD - Add a new note +CNDUMP - Show all notes in a table +CNCOUNT - Show statistics (total, by category, by date) +CNDEL - Archive (move) notes to cnotes.arc +CNFIND - Search notes by text/category/date +CNHELP - Show this help overview + +INSTALLATION +------------ +1. Unzip all files to any directory (e.g. C:\TEMP) +2. Run INSTALL.BAT from that directory +3. Follow the on-screen prompts + +After installation: +- Best: add C:\CNOTES to your PATH + SET PATH=%PATH%;C:\CNOTES + (put this line in C:\AUTOEXEC.BAT to make it permanent) +- Or run commands with full path: C:\CNOTES\CNADD "Test note" + +QUICK START +----------- +CNADD "Remember to call Bob" +CNADD -c Work "Meeting 3pm tomorrow" + +CNDUMP - view all notes +CNHELP - full command help +CNHELP cnadd - help for one command + +NOTES LOCATION +-------------- +By default: current directory (cnotes.csv and cnotes.arc) +Override with environment variable: + SET CNOTES_PATH=C:\MYNOTES + +Have fun logging notes the retro way! + +Questions or bugs? See the project at: +https://repos.gmgauthier.com/gmgauthier/cnotes + +Greg Gauthier - February 2026 \ No newline at end of file diff --git a/make-dos-zip.sh b/make-dos-zip.sh new file mode 100644 index 0000000..5dbbd2c --- /dev/null +++ b/make-dos-zip.sh @@ -0,0 +1,97 @@ +#!/usr/bin/env bash +# +# make-dos-zip.sh +# ================ +# Packages already-built DOS cnotes binaries into a release zip. +# +# Assumes: +# - You have already run make -f makefile.tc in DOSBox +# - All .exe files + INSTALL.BAT are in the 'build/' directory +# +# Usage: +# ./make-dos-zip.sh [version] +# +# Examples: +# ./make-dos-zip.sh 0.1.1 → creates cnotes-v0.1.1-dos.zip +# ./make-dos-zip.sh → uses date as version (YYYYMMDD) +# + +set -euo pipefail + +VERSION="${1:-$(date +%Y%m%d)}" +ZIP_NAME="cnotes-v${VERSION}-dos.zip" +BUILD_DIR="build" +DIST_DIR="dist-dos" + +# Colors +GREEN='\033[0;32m' +RED='\033[0;31m' +NC='\033[0m' + +echo -e "${GREEN}Packaging DOS release: ${ZIP_NAME}${NC}" + +# 1. Check required files exist in build/ +REQUIRED_FILES=( + "cnadd.exe" + "cndump.exe" + "cncount.exe" + "cndel.exe" + "cnfind.exe" + "cnhelp.exe" + "INSTALL.BAT" + "READ-DOS.TXT" +) + +missing=0 +for file in "${REQUIRED_FILES[@]}"; do + if [ ! -f "${BUILD_DIR}/${file}" ]; then + echo -e "${RED}Missing required file: ${BUILD_DIR}/${file}${NC}" + missing=1 + fi +done + +if [ $missing -eq 1 ]; then + echo -e "${RED}Aborting: one or more required files are missing.${NC}" + echo "Make sure you have built with 'make -f makefile.tc' in DOSBox" + echo "and that INSTALL.BAT is present." + exit 1 +fi + +# 2. Prepare clean staging directory +rm -rf "${DIST_DIR}" +mkdir -p "${DIST_DIR}" + +# 3. Copy files to staging +echo "Staging files..." +cp "${BUILD_DIR}"/*.exe "${DIST_DIR}"/ +cp "${BUILD_DIR}/INSTALL.BAT" "${DIST_DIR}"/ +cp "$$ {BUILD_DIR}/READ-DOS.TXT" " $${DIST_DIR}"/ 2>/dev/null || { + echo -e "$$ {RED}Warning: READ-DOS.TXT not found in build/ (optional but recommended) $${NC}" +} + +# Optional extras (uncomment/add if you have them) +# cp README-DOS.TXT "${DIST_DIR}"/ 2>/dev/null || true +# cp LICENSE "${DIST_DIR}"/ 2>/dev/null || true + +# 4. Create zip +echo "Creating zip archive..." +cd "${DIST_DIR}" +zip -r -9 "../${ZIP_NAME}" . >/dev/null +cd .. + +# 5. Optional SHA256 +if command -v sha256sum >/dev/null 2>&1; then + sha256sum "${ZIP_NAME}" > "${ZIP_NAME}.sha256" + echo "Checksum: ${ZIP_NAME}.sha256" +elif command -v shasum >/dev/null 2>&1; then + shasum -a 256 "${ZIP_NAME}" > "${ZIP_NAME}.sha256" + echo "Checksum: ${ZIP_NAME}.sha256" +fi + +# 6. Show result +echo -e "${GREEN}Done! Zip created:${NC}" +ls -lh "${ZIP_NAME}"* +echo "" +echo "Next steps:" +echo " 1. Upload ${ZIP_NAME} (and .sha256 if created) to Gitea release" +echo " 2. Optionally delete staging dir: rm -rf ${DIST_DIR}" \ No newline at end of file -- 2.39.5 From da2ec0b2a2f21dfee0e717253dbad186517471d2 Mon Sep 17 00:00:00 2001 From: Greg Gauthier Date: Wed, 4 Feb 2026 18:56:10 +0000 Subject: [PATCH 4/7] fix borland make error --- .gitignore | 5 +++++ MAKEFILE.TC | 25 ++++++++++++++++--------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 63ee468..2779cd5 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,8 @@ .DS_Store build/ dist-dos/ +*.obj +*.OBJ +*.log +*.LOG + diff --git a/MAKEFILE.TC b/MAKEFILE.TC index 5646ba8..823cbd1 100644 --- a/MAKEFILE.TC +++ b/MAKEFILE.TC @@ -25,19 +25,26 @@ README_DOS = READ-DOS.TXT .c.obj: $(CC) $(CFLAGS) -c -o$*.obj $< -all: $(BUILDDIR) - $(BUILDDIR)\cnadd.exe \ - $(BUILDDIR)\cndump.exe \ - $(BUILDDIR)\cncount.exe \ - $(BUILDDIR)\cndel.exe \ - $(BUILDDIR)\cnfind.exe \ - $(BUILDDIR)\cnhelp.exe \ - $(BUILDDIR)\$(INSTALL_FILE) \ - $(BUILDDIR)\$(README_DOS) +# ──────────────────────────────────────────────── +# Main targets – split to avoid long command lines +# ──────────────────────────────────────────────── + +all: build-exes build-support-files + +build-exes: $(BUILDDIR)\cnadd.exe \ + $(BUILDDIR)\cndump.exe \ + $(BUILDDIR)\cncount.exe \ + $(BUILDDIR)\cndel.exe \ + $(BUILDDIR)\cnfind.exe \ + $(BUILDDIR)\cnhelp.exe + +build-support-files: $(BUILDDIR)\$(INSTALL_FILE) \ + $(BUILDDIR)\$(README_DOS) $(BUILDDIR): if not exist $(BUILDDIR) mkdir $(BUILDDIR) +# Individual exe rules (unchanged) $(BUILDDIR)\cnadd.exe: $(SRCDIR)\cnadd.c $(INCDIR)\platform.h $(INCDIR)\config.h $(CC) $(CFLAGS) -e$(BUILDDIR)\cnadd.exe $(SRCDIR)\cnadd.c -- 2.39.5 From 9b238d2f8e7dbfe148f73eb88f2b602321e99d7d Mon Sep 17 00:00:00 2001 From: Greg Gauthier Date: Wed, 4 Feb 2026 18:58:36 +0000 Subject: [PATCH 5/7] ignore BUILD --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2779cd5..3646060 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ .vscode/ .DS_Store build/ +BUILD/ dist-dos/ *.obj *.OBJ -- 2.39.5 From 144f7bb6444da41ca608305f75a4c896066eca2f Mon Sep 17 00:00:00 2001 From: Greg Gauthier Date: Wed, 4 Feb 2026 19:06:21 +0000 Subject: [PATCH 6/7] CAPITAL LETTERS --- make-dos-zip.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) mode change 100644 => 100755 make-dos-zip.sh diff --git a/make-dos-zip.sh b/make-dos-zip.sh old mode 100644 new mode 100755 index 5dbbd2c..5cbf732 --- a/make-dos-zip.sh +++ b/make-dos-zip.sh @@ -20,7 +20,7 @@ set -euo pipefail VERSION="${1:-$(date +%Y%m%d)}" ZIP_NAME="cnotes-v${VERSION}-dos.zip" -BUILD_DIR="build" +BUILD_DIR="BUILD" DIST_DIR="dist-dos" # Colors @@ -32,12 +32,12 @@ echo -e "${GREEN}Packaging DOS release: ${ZIP_NAME}${NC}" # 1. Check required files exist in build/ REQUIRED_FILES=( - "cnadd.exe" - "cndump.exe" - "cncount.exe" - "cndel.exe" - "cnfind.exe" - "cnhelp.exe" + "CNADD.EXE" + "CNDUMP.EXE" + "CNCOUNT.EXE" + "CNDEL.EXE" + "CNFIND.EXE" + "CNHELP.EXE" "INSTALL.BAT" "READ-DOS.TXT" ) @@ -63,7 +63,7 @@ mkdir -p "${DIST_DIR}" # 3. Copy files to staging echo "Staging files..." -cp "${BUILD_DIR}"/*.exe "${DIST_DIR}"/ +cp "${BUILD_DIR}"/*.EXE "${DIST_DIR}"/ cp "${BUILD_DIR}/INSTALL.BAT" "${DIST_DIR}"/ cp "$$ {BUILD_DIR}/READ-DOS.TXT" " $${DIST_DIR}"/ 2>/dev/null || { echo -e "$$ {RED}Warning: READ-DOS.TXT not found in build/ (optional but recommended) $${NC}" -- 2.39.5 From f6116fbc93a0ad861c97f790d24a7a39a56973d5 Mon Sep 17 00:00:00 2001 From: Greg Gauthier Date: Wed, 4 Feb 2026 19:28:58 +0000 Subject: [PATCH 7/7] Do whatever it takes to make sure the build directory is there --- MAKEFILE.TC | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/MAKEFILE.TC b/MAKEFILE.TC index 823cbd1..5678de1 100644 --- a/MAKEFILE.TC +++ b/MAKEFILE.TC @@ -18,7 +18,7 @@ CFLAGS = -A -w -ml -I.\include SRCDIR = src INCDIR = include -BUILDDIR = build +BUILDDIR = BUILD INSTALL_FILE = INSTALL.BAT README_DOS = READ-DOS.TXT @@ -46,32 +46,40 @@ $(BUILDDIR): # Individual exe rules (unchanged) $(BUILDDIR)\cnadd.exe: $(SRCDIR)\cnadd.c $(INCDIR)\platform.h $(INCDIR)\config.h + if not exist $(BUILDDIR) mkdir $(BUILDDIR) $(CC) $(CFLAGS) -e$(BUILDDIR)\cnadd.exe $(SRCDIR)\cnadd.c $(BUILDDIR)\cndump.exe: $(SRCDIR)\cndump.c $(INCDIR)\platform.h $(INCDIR)\config.h + if not exist $(BUILDDIR) mkdir $(BUILDDIR) $(CC) $(CFLAGS) -e$(BUILDDIR)\cndump.exe $(SRCDIR)\cndump.c $(BUILDDIR)\cncount.exe: $(SRCDIR)\cncount.c $(INCDIR)\platform.h $(INCDIR)\config.h + if not exist $(BUILDDIR) mkdir $(BUILDDIR) $(CC) $(CFLAGS) -e$(BUILDDIR)\cncount.exe $(SRCDIR)\cncount.c $(BUILDDIR)\cndel.exe: $(SRCDIR)\cndel.c $(INCDIR)\platform.h $(INCDIR)\config.h + if not exist $(BUILDDIR) mkdir $(BUILDDIR) $(CC) $(CFLAGS) -e$(BUILDDIR)\cndel.exe $(SRCDIR)\cndel.c $(BUILDDIR)\cnfind.exe: $(SRCDIR)\cnfind.c $(INCDIR)\platform.h $(INCDIR)\config.h + if not exist $(BUILDDIR) mkdir $(BUILDDIR) $(CC) $(CFLAGS) -e$(BUILDDIR)\cnfind.exe $(SRCDIR)\cnfind.c $(BUILDDIR)\cnhelp.exe: $(SRCDIR)\cnhelp.c + if not exist $(BUILDDIR) mkdir $(BUILDDIR) $(CC) $(CFLAGS) -e$(BUILDDIR)\cnhelp.exe $(SRCDIR)\cnhelp.c $(BUILDDIR)\$(INSTALL_FILE): $(INSTALL_FILE) + if not exist $(BUILDDIR) mkdir $(BUILDDIR) copy $(INSTALL_FILE) $(BUILDDIR)\$(INSTALL_FILE) $(BUILDDIR)\$(README_DOS): $(README_DOS) - copy $(README_DOS) $(BUILDDIR)\$(README_DOS) + if not exist $(BUILDDIR) mkdir $(BUILDDIR) + copy $(README_DOS) $(BUILDDIR)\$(README_DOS) clean: - if exist $(BUILDDIR)\*.exe del $(BUILDDIR)\*.exe - if exist $(BUILDDIR)\*.obj del $(BUILDDIR)\*.obj - if exist $(BUILDDIR)\$(INSTALL_FILE) del $(BUILDDIR)\$(INSTALL_FILE) - if exist $(BUILDDIR)\$(README_DOS) del $(BUILDDIR)\$(README_DOS) - if exist $(BUILDDIR) rmdir $(BUILDDIR) + if exist $(BUILDDIR)\*.exe del $(BUILDDIR)\*.exe + if exist $(BUILDDIR)\*.obj del $(BUILDDIR)\*.obj + if exist $(BUILDDIR)\$(INSTALL_FILE) del $(BUILDDIR)\$(INSTALL_FILE) + if exist $(BUILDDIR)\$(README_DOS) del $(BUILDDIR)\$(README_DOS) + if exist $(BUILDDIR) rmdir $(BUILDDIR) -- 2.39.5