+2
CRUSH.md
+2
CRUSH.md
···
8
8
## Build & Development Commands
9
9
- **Build**: `nix build`
10
10
- Compiles Shortwave Radio application
11
+
- **Build Installer**: `nix build .#installer` or `build-installer`
12
+
- Creates Windows installer (ShortwaveRadioInstaller.exe)
11
13
- **Dev Setup**: `setup-dev`
12
14
- Generates `compile_commands.json`
13
15
- **Deploy**: `deploy-to-xp`
+65
-6
flake.nix
+65
-6
flake.nix
···
65
65
'';
66
66
};
67
67
68
+
installer = pkgs.stdenv.mkDerivation {
69
+
name = "shortwave-installer";
70
+
version = "1.0.0";
71
+
src = ./.;
72
+
73
+
nativeBuildInputs = with pkgs; [
74
+
nsis
75
+
];
76
+
77
+
buildInputs = [ self'.packages.shortwave ];
78
+
buildPhase = ''
79
+
# Create staging directory
80
+
mkdir -p staging
81
+
82
+
# Copy executable and DLLs
83
+
cp ${self'.packages.shortwave}/bin/Shortwave.exe staging/
84
+
85
+
cp libs/bass.dll staging/
86
+
87
+
cp shortwave.ico staging/
88
+
89
+
# Copy documentation
90
+
cp LICENSE.md staging/
91
+
cp README.md staging/
92
+
93
+
# Build installer
94
+
cd staging
95
+
makensis -NOCD ../installer.nsi
96
+
97
+
# Rename output to expected installer name
98
+
if [ -f ShortwaveRadioInstaller.exe ]; then
99
+
mv ShortwaveRadioInstaller.exe ../
100
+
else
101
+
echo "✗ Installer was not created by makensis"
102
+
exit 1
103
+
fi
104
+
cd ..
105
+
ls
106
+
'';
107
+
108
+
installPhase = ''
109
+
mkdir -p $out/bin
110
+
cp ShortwaveRadioInstaller.exe $out/bin/
111
+
'';
112
+
};
113
+
68
114
deploy-to-xp = pkgs.writeShellScriptBin "deploy-to-xp" ''
69
115
echo "rebuilding program"
70
-
if ! nix build --rebuild; then
71
-
echo "Rebuild failed, attempting normal build..."
72
-
nix build
73
-
fi
116
+
nix build
74
117
75
118
XP_DIR="$HOME/Documents/xp-drive"
76
119
mkdir -p "$XP_DIR"
···
102
145
ls -la "$XP_DIR"/*.{exe,dll} 2>/dev/null || echo "No files found"
103
146
'';
104
147
148
+
build-installer = pkgs.writeShellScriptBin "build-installer" ''
149
+
echo "Building Shortwave Radio installer..."
150
+
nix build .#installer
151
+
152
+
if [ -f result/bin/ShortwaveRadioInstaller.exe ]; then
153
+
echo "✓ Installer built successfully: result/bin/ShortwaveRadioInstaller.exe"
154
+
ls -la result/bin/ShortwaveRadioInstaller.exe
155
+
else
156
+
echo "✗ Installer build failed"
157
+
exit 1
158
+
fi
159
+
'';
160
+
105
161
default = self'.packages.shortwave;
106
162
};
107
163
···
111
167
cmake
112
168
pkgsCross.mingw32.buildPackages.gcc
113
169
self'.packages.deploy-to-xp
170
+
self'.packages.build-installer
114
171
];
115
172
116
173
shellHook = ''
117
174
echo "Shortwave Radio development environment loaded"
118
175
echo "Available commands:"
119
-
echo " nix build - Build the Shortwave Radio application"
120
-
echo " deploy-to-xp - Deploy to XP VM folder"
176
+
echo " nix build - Build the Shortwave Radio application"
177
+
echo " nix build .#installer - Build Windows installer"
178
+
echo " build-installer - Build installer (shortcut)"
179
+
echo " deploy-to-xp - Deploy to XP VM folder"
121
180
echo ""
122
181
echo "Setting up development environment..."
123
182
icon.aseprite
icon.aseprite
This is a binary file and will not be displayed.
+114
installer.nsi
+114
installer.nsi
···
1
+
; Shortwave Radio Installer
2
+
; Compatible with Windows XP and later
3
+
4
+
!define APPNAME "Shortwave Radio"
5
+
!define COMPANYNAME "Kieran Klukas"
6
+
!define DESCRIPTION "Vintage Shortwave Radio Tuner with Internet Streaming"
7
+
!define VERSIONMAJOR 1
8
+
!define VERSIONMINOR 0
9
+
!define VERSIONBUILD 0
10
+
!define HELPURL "https://github.com/taciturnaxolotl/shortwave"
11
+
!define UPDATEURL "https://github.com/taciturnaxolotl/shortwave/releases"
12
+
!define ABOUTURL "https://github.com/taciturnaxolotl/shortwave"
13
+
!define INSTALLSIZE 2048
14
+
15
+
; Disable CRC check to avoid cross-platform issues
16
+
CRCCheck off
17
+
; Use solid compression
18
+
SetCompressor /SOLID lzma
19
+
20
+
RequestExecutionLevel admin
21
+
InstallDir "$PROGRAMFILES\${APPNAME}"
22
+
Name "${APPNAME}"
23
+
outFile "ShortwaveRadioInstaller.exe"
24
+
25
+
!include LogicLib.nsh
26
+
27
+
page directory
28
+
page instfiles
29
+
30
+
!macro VerifyUserIsAdmin
31
+
UserInfo::GetAccountType
32
+
pop $0
33
+
${If} $0 != "admin"
34
+
messageBox mb_iconstop "Administrator rights required!"
35
+
setErrorLevel 740
36
+
quit
37
+
${EndIf}
38
+
!macroend
39
+
40
+
function .onInit
41
+
setShellVarContext all
42
+
!insertmacro VerifyUserIsAdmin
43
+
functionEnd
44
+
45
+
section "install"
46
+
setOutPath $INSTDIR
47
+
48
+
; Main executable
49
+
file "Shortwave.exe"
50
+
51
+
; BASS audio library
52
+
file "bass.dll"
53
+
54
+
; License and documentation
55
+
file "LICENSE.md"
56
+
file "README.md"
57
+
58
+
; Create uninstaller
59
+
writeUninstaller "$INSTDIR\uninstall.exe"
60
+
61
+
; Start menu shortcuts
62
+
createDirectory "$SMPROGRAMS\${APPNAME}"
63
+
createShortCut "$SMPROGRAMS\${APPNAME}\${APPNAME}.lnk" "$INSTDIR\Shortwave.exe"
64
+
createShortCut "$SMPROGRAMS\${APPNAME}\Uninstall.lnk" "$INSTDIR\uninstall.exe"
65
+
66
+
; Desktop shortcut
67
+
createShortCut "$DESKTOP\${APPNAME}.lnk" "$INSTDIR\Shortwave.exe"
68
+
69
+
; Registry entries for Add/Remove Programs
70
+
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME} - ${DESCRIPTION}"
71
+
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
72
+
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
73
+
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "InstallLocation" "$\"$INSTDIR$\""
74
+
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayIcon" "$\"$INSTDIR\Shortwave.exe$\""
75
+
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "Publisher" "${COMPANYNAME}"
76
+
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "HelpLink" "${HELPURL}"
77
+
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "URLUpdateInfo" "${UPDATEURL}"
78
+
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "URLInfoAbout" "${ABOUTURL}"
79
+
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayVersion" "${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}"
80
+
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "VersionMajor" ${VERSIONMAJOR}
81
+
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "VersionMinor" ${VERSIONMINOR}
82
+
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "NoModify" 1
83
+
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "NoRepair" 1
84
+
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "EstimatedSize" ${INSTALLSIZE}
85
+
sectionEnd
86
+
87
+
function un.onInit
88
+
SetShellVarContext all
89
+
MessageBox MB_OKCANCEL "Remove ${APPNAME}?" IDOK next
90
+
Abort
91
+
next:
92
+
!insertmacro VerifyUserIsAdmin
93
+
functionEnd
94
+
95
+
section "uninstall"
96
+
; Remove files
97
+
delete "$INSTDIR\Shortwave.exe"
98
+
delete "$INSTDIR\bass.dll"
99
+
delete "$INSTDIR\LICENSE.md"
100
+
delete "$INSTDIR\README.md"
101
+
delete "$INSTDIR\uninstall.exe"
102
+
103
+
; Remove shortcuts
104
+
delete "$SMPROGRAMS\${APPNAME}\${APPNAME}.lnk"
105
+
delete "$SMPROGRAMS\${APPNAME}\Uninstall.lnk"
106
+
rmDir "$SMPROGRAMS\${APPNAME}"
107
+
delete "$DESKTOP\${APPNAME}.lnk"
108
+
109
+
; Remove registry entries
110
+
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
111
+
112
+
; Remove installation directory
113
+
rmDir "$INSTDIR"
114
+
sectionEnd
shortwave.ico
shortwave.ico
This is a binary file and will not be displayed.