a mega cool windows xp app

Disable CRC check in NSIS installer for cross-platform compatibility

dunkirk.sh b4f372f9 01e3f443

verified
+2
CRUSH.md
···
## Build & Development Commands
- **Build**: `nix build`
- Compiles Shortwave Radio application
+
- **Build Installer**: `nix build .#installer` or `build-installer`
+
- Creates Windows installer (ShortwaveRadioInstaller.exe)
- **Dev Setup**: `setup-dev`
- Generates `compile_commands.json`
- **Deploy**: `deploy-to-xp`
+65 -6
flake.nix
···
'';
};
+
installer = pkgs.stdenv.mkDerivation {
+
name = "shortwave-installer";
+
version = "1.0.0";
+
src = ./.;
+
+
nativeBuildInputs = with pkgs; [
+
nsis
+
];
+
+
buildInputs = [ self'.packages.shortwave ];
+
buildPhase = ''
+
# Create staging directory
+
mkdir -p staging
+
+
# Copy executable and DLLs
+
cp ${self'.packages.shortwave}/bin/Shortwave.exe staging/
+
+
cp libs/bass.dll staging/
+
+
cp shortwave.ico staging/
+
+
# Copy documentation
+
cp LICENSE.md staging/
+
cp README.md staging/
+
+
# Build installer
+
cd staging
+
makensis -NOCD ../installer.nsi
+
+
# Rename output to expected installer name
+
if [ -f ShortwaveRadioInstaller.exe ]; then
+
mv ShortwaveRadioInstaller.exe ../
+
else
+
echo "✗ Installer was not created by makensis"
+
exit 1
+
fi
+
cd ..
+
ls
+
'';
+
+
installPhase = ''
+
mkdir -p $out/bin
+
cp ShortwaveRadioInstaller.exe $out/bin/
+
'';
+
};
+
deploy-to-xp = pkgs.writeShellScriptBin "deploy-to-xp" ''
echo "rebuilding program"
-
if ! nix build --rebuild; then
-
echo "Rebuild failed, attempting normal build..."
-
nix build
-
fi
+
nix build
XP_DIR="$HOME/Documents/xp-drive"
mkdir -p "$XP_DIR"
···
ls -la "$XP_DIR"/*.{exe,dll} 2>/dev/null || echo "No files found"
'';
+
build-installer = pkgs.writeShellScriptBin "build-installer" ''
+
echo "Building Shortwave Radio installer..."
+
nix build .#installer
+
+
if [ -f result/bin/ShortwaveRadioInstaller.exe ]; then
+
echo "✓ Installer built successfully: result/bin/ShortwaveRadioInstaller.exe"
+
ls -la result/bin/ShortwaveRadioInstaller.exe
+
else
+
echo "✗ Installer build failed"
+
exit 1
+
fi
+
'';
+
default = self'.packages.shortwave;
};
···
cmake
pkgsCross.mingw32.buildPackages.gcc
self'.packages.deploy-to-xp
+
self'.packages.build-installer
];
shellHook = ''
echo "Shortwave Radio development environment loaded"
echo "Available commands:"
-
echo " nix build - Build the Shortwave Radio application"
-
echo " deploy-to-xp - Deploy to XP VM folder"
+
echo " nix build - Build the Shortwave Radio application"
+
echo " nix build .#installer - Build Windows installer"
+
echo " build-installer - Build installer (shortcut)"
+
echo " deploy-to-xp - Deploy to XP VM folder"
echo ""
echo "Setting up development environment..."
icon.aseprite

This is a binary file and will not be displayed.

+114
installer.nsi
···
+
; Shortwave Radio Installer
+
; Compatible with Windows XP and later
+
+
!define APPNAME "Shortwave Radio"
+
!define COMPANYNAME "Kieran Klukas"
+
!define DESCRIPTION "Vintage Shortwave Radio Tuner with Internet Streaming"
+
!define VERSIONMAJOR 1
+
!define VERSIONMINOR 0
+
!define VERSIONBUILD 0
+
!define HELPURL "https://github.com/taciturnaxolotl/shortwave"
+
!define UPDATEURL "https://github.com/taciturnaxolotl/shortwave/releases"
+
!define ABOUTURL "https://github.com/taciturnaxolotl/shortwave"
+
!define INSTALLSIZE 2048
+
+
; Disable CRC check to avoid cross-platform issues
+
CRCCheck off
+
; Use solid compression
+
SetCompressor /SOLID lzma
+
+
RequestExecutionLevel admin
+
InstallDir "$PROGRAMFILES\${APPNAME}"
+
Name "${APPNAME}"
+
outFile "ShortwaveRadioInstaller.exe"
+
+
!include LogicLib.nsh
+
+
page directory
+
page instfiles
+
+
!macro VerifyUserIsAdmin
+
UserInfo::GetAccountType
+
pop $0
+
${If} $0 != "admin"
+
messageBox mb_iconstop "Administrator rights required!"
+
setErrorLevel 740
+
quit
+
${EndIf}
+
!macroend
+
+
function .onInit
+
setShellVarContext all
+
!insertmacro VerifyUserIsAdmin
+
functionEnd
+
+
section "install"
+
setOutPath $INSTDIR
+
+
; Main executable
+
file "Shortwave.exe"
+
+
; BASS audio library
+
file "bass.dll"
+
+
; License and documentation
+
file "LICENSE.md"
+
file "README.md"
+
+
; Create uninstaller
+
writeUninstaller "$INSTDIR\uninstall.exe"
+
+
; Start menu shortcuts
+
createDirectory "$SMPROGRAMS\${APPNAME}"
+
createShortCut "$SMPROGRAMS\${APPNAME}\${APPNAME}.lnk" "$INSTDIR\Shortwave.exe"
+
createShortCut "$SMPROGRAMS\${APPNAME}\Uninstall.lnk" "$INSTDIR\uninstall.exe"
+
+
; Desktop shortcut
+
createShortCut "$DESKTOP\${APPNAME}.lnk" "$INSTDIR\Shortwave.exe"
+
+
; Registry entries for Add/Remove Programs
+
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME} - ${DESCRIPTION}"
+
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
+
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
+
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "InstallLocation" "$\"$INSTDIR$\""
+
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayIcon" "$\"$INSTDIR\Shortwave.exe$\""
+
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "Publisher" "${COMPANYNAME}"
+
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "HelpLink" "${HELPURL}"
+
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "URLUpdateInfo" "${UPDATEURL}"
+
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "URLInfoAbout" "${ABOUTURL}"
+
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayVersion" "${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}"
+
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "VersionMajor" ${VERSIONMAJOR}
+
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "VersionMinor" ${VERSIONMINOR}
+
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "NoModify" 1
+
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "NoRepair" 1
+
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "EstimatedSize" ${INSTALLSIZE}
+
sectionEnd
+
+
function un.onInit
+
SetShellVarContext all
+
MessageBox MB_OKCANCEL "Remove ${APPNAME}?" IDOK next
+
Abort
+
next:
+
!insertmacro VerifyUserIsAdmin
+
functionEnd
+
+
section "uninstall"
+
; Remove files
+
delete "$INSTDIR\Shortwave.exe"
+
delete "$INSTDIR\bass.dll"
+
delete "$INSTDIR\LICENSE.md"
+
delete "$INSTDIR\README.md"
+
delete "$INSTDIR\uninstall.exe"
+
+
; Remove shortcuts
+
delete "$SMPROGRAMS\${APPNAME}\${APPNAME}.lnk"
+
delete "$SMPROGRAMS\${APPNAME}\Uninstall.lnk"
+
rmDir "$SMPROGRAMS\${APPNAME}"
+
delete "$DESKTOP\${APPNAME}.lnk"
+
+
; Remove registry entries
+
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
+
+
; Remove installation directory
+
rmDir "$INSTDIR"
+
sectionEnd
shortwave.ico

This is a binary file and will not be displayed.