; Tobys Pink Matrix Installer - MIT, Toby 2026
FailAt 10
If NOT EXISTS Personal:
 Echo "Personal: is missing. No changes made."
 Wait 8
 Quit 20
EndIf
If EXISTS SYS:Prefs/TobysPinkMatrix-backup
 Echo "A backup already exists. Do not reinstall over it."
 Echo "Use Uninstall first, or inspect the existing installation."
 Wait 10
 Quit 20
EndIf
If EXISTS SYS:WBStartup/TobysPinkMatrix
 Echo "TobysPinkMatrix is already installed. No changes made."
 Wait 8
 Quit 20
EndIf
If EXISTS SYS:WBStartup/TobysPinkMatrix.info
 Echo "An existing startup icon needs checking. No changes made."
 Wait 8
 Quit 20
EndIf
If NOT EXISTS Personal:Applications
 MakeDir Personal:Applications
EndIf
If NOT EXISTS Personal:Applications/TobysPinkMatrix_Screensaver
 MakeDir Personal:Applications/TobysPinkMatrix_Screensaver
EndIf
If EXISTS Personal:Applications/TobysPinkMatrix_Screensaver/1.0
 Echo "The application folder already exists. It was not overwritten."
 Echo "For another OS, use the existing application as described in README."
 Wait 10
 Quit 20
EndIf
MakeDir Personal:Applications/TobysPinkMatrix_Screensaver/1.0
Copy Files/#? Personal:Applications/TobysPinkMatrix_Screensaver/1.0/ ALL
MakeDir SYS:Prefs/TobysPinkMatrix-backup
If EXISTS SYS:WBStartup/Matrix
 Copy SYS:WBStartup/Matrix SYS:Prefs/TobysPinkMatrix-backup/Matrix
EndIf
If EXISTS SYS:WBStartup/Matrix.info
 Copy SYS:WBStartup/Matrix.info SYS:Prefs/TobysPinkMatrix-backup/Matrix.info
EndIf
; All payload files and backups exist before the active blanker is moved.
If EXISTS SYS:WBStartup/Matrix
 Rename SYS:WBStartup/Matrix SYS:Prefs/TobysPinkMatrix-backup/Matrix-disabled
EndIf
If EXISTS SYS:WBStartup/Matrix.info
 Rename SYS:WBStartup/Matrix.info SYS:Prefs/TobysPinkMatrix-backup/Matrix-disabled.info
EndIf
Copy Files/TobysPinkMatrix SYS:WBStartup/TobysPinkMatrix
Copy Files/TobysPinkMatrix.info SYS:WBStartup/TobysPinkMatrix.info
Echo "Installed. Please restart this operating system."
Echo "Default wait: 20 seconds. Open PinkMatrixSettings to adjust it."
Echo "Backup: SYS:Prefs/TobysPinkMatrix-backup"
Wait 10
