From 14bb86c585777485b5dab465e8eadbbe0ece4d9e Mon Sep 17 00:00:00 2001 From: Tero Lindeman Date: Tue, 9 May 2017 21:09:50 +0300 Subject: [PATCH] Updated the installer + fixed missing uninstall files --- installer/UnFiles.cmd | 34 ++++++++++ installer/klystrack.nsi | 140 +++++++++------------------------------- 2 files changed, 66 insertions(+), 108 deletions(-) create mode 100644 installer/UnFiles.cmd diff --git a/installer/UnFiles.cmd b/installer/UnFiles.cmd new file mode 100644 index 00000000..91f73d9e --- /dev/null +++ b/installer/UnFiles.cmd @@ -0,0 +1,34 @@ +@rem NSIS Uninstall Header Recursive File List Maker +@rem Copyright 2014 Aleksandr Ivankiv + +@rem Modified for the klystrack installer by Tero Lindeman + +@SET DIR=%~1 +@SET HEADER=%~2 +@IF "%~1" == "/?" goto Help +@IF NOT DEFINED DIR goto Help +@IF NOT DEFINED HEADER SET HEADER=UnFiles.nsh +@IF NOT EXIST "%DIR%" ECHO Cannot find the folder %DIR%. & SET "DIR=" & goto :EOF + +@SetLocal EnableDelayedExpansion + +@FOR /F "tokens=*" %%f IN ('DIR %DIR%\*.* /A:-D /B /S') DO @( + set string=%%f + set string=!string:%CD%\%DIR%=! + echo Delete "$OUTDIR\!string:~1!" >> %HEADER% +) + +@FOR /F "tokens=*" %%d IN ('DIR %DIR%\*.* /A:D /B /S') DO @( + set string=%%d + set string=!string:%CD%\%DIR%=! + echo RMDir "$OUTDIR\!string:~1!" >> %HEADER% +) + +@EndLocal +@goto :EOF + +:Help +@echo. +@echo Usage: UNFILES FolderName [OutFile] +@echo. +@goto :EOF \ No newline at end of file diff --git a/installer/klystrack.nsi b/installer/klystrack.nsi index 9b17fdd3..82b4e6c4 100644 --- a/installer/klystrack.nsi +++ b/installer/klystrack.nsi @@ -44,66 +44,22 @@ SectionIn RO SetOutPath $INSTDIR\res - File zip\data\res\Default - File zip\data\res\AHX - File zip\data\res\C64 - File zip\data\res\Gameboy - File zip\data\res\Classic - File "zip\data\res\Golden_Brown" - File zip\data\res\Blacklyst - File "zip\data\res\Rust_Camo" - File "zip\data\res\Rust_Red" - File "zip\data\res\Ultimate_Proctamed" + File zip\data\res\* SetOutPath $INSTDIR\key File zip\data\key\FT2 File zip\data\key\AZERTY File zip\data\key\DVORAK + File zip\data\key\n00bstar CreateDirectory $INSTDIR\examples + CreateDirectory $INSTDIR\examples\songs + CreateDirectory $INSTDIR\examples\instruments - SetOutPath $INSTDIR\examples\instruments - - File zip\data\examples\instruments\bass.ki - File zip\data\examples\instruments\bass2.ki - File zip\data\examples\instruments\bigsnare.ki - File zip\data\examples\instruments\clap.ki - File zip\data\examples\instruments\dang.ki - File zip\data\examples\instruments\cowbell.ki - File zip\data\examples\instruments\hardkick.ki - File zip\data\examples\instruments\katana.ki - File zip\data\examples\instruments\JDsnare.ki - File zip\data\examples\instruments\kick.ki - File zip\data\examples\instruments\lead1.ki - File zip\data\examples\instruments\lethal_kick.ki - File zip\data\examples\instruments\lethal_snare.ki - File zip\data\examples\instruments\major.ki - File zip\data\examples\instruments\MontyKick.ki - File zip\data\examples\instruments\snappy.ki - File zip\data\examples\instruments\ssnare.ki - File zip\data\examples\instruments\stabmaj.ki - File zip\data\examples\instruments\stabmin.ki - File zip\data\examples\instruments\the_horror.ki - File zip\data\examples\instruments\tom.ki - File zip\data\examples\instruments\vibbas_flt.ki - File zip\data\examples\instruments\wetkick.ki - - SetOutPath $INSTDIR\examples\songs - - File "zip\data\examples\songs\ringmod.kt" - File "zip\data\examples\songs\Sprock'n'Sprawl.kt" - File "zip\data\examples\songs\phonkeh.kt" - File "zip\data\examples\songs\obspatial.kt" - File "zip\data\examples\songs\Paranoimia (Suntronic).kt" - File "zip\data\examples\songs\hskv03-rygar_trance.kt" - File "zip\data\examples\songs\castlevania.kt" - File "zip\data\examples\songs\dr.happy.kt" - File "zip\data\examples\songs\hwv 437.kt" - File "zip\data\examples\songs\smp_dpintro.kt" - File "zip\data\examples\songs\smp_dingleberries_fix.kt" - File "zip\data\examples\songs\Diverted_Experience.kt" - File "zip\data\examples\songs\Ocean Loader III.kt" + SetOutPath $INSTDIR\examples + + File /r examples\* ; For CreateShortCut @@ -140,74 +96,39 @@ Section Uninstall Delete LICENSE Delete SDL2.dll + Delete SDL2_image.dll Delete SDL.txt - Delete SDL2_image.txt - Delete SDL_image.dll + Delete SDL_image.txt Delete zlib1.dll Delete libpng16-16.dll Delete klystrack.exe + Delete Default.kt - SetOutPath $INSTDIR\res - - Delete Default - Delete AHX - Delete C64 - Delete Gameboy - Delete Classic - Delete "Golden_Brown" - Delete Blacklyst - Delete "Rust_Camo" - Delete "Rust_Red" - Delete "Ultimate_Proctamed" - - SetOutPath $TEMP\key + SetOutPath $INSTDIR\key Delete FT2 Delete AZERTY Delete DVORAK + Delete n00bstar + + ; remove all themes + + SetOutPath $INSTDIR\res + + !tempfile deletetemp + !system '"installer\UnFiles.cmd" "res" "${deletetemp}"' + !include ${deletetemp} + !delfile ${deletetemp} + + ; remove all examples - SetOutPath $INSTDIR\examples\instruments - - Delete bass.ki - Delete bass2.ki - Delete bigsnare.ki - Delete clap.ki - Delete dang.ki - Delete cowbell.ki - Delete hardkick.ki - Delete katana.ki - Delete JDsnare.ki - Delete kick.ki - Delete lead1.ki - Delete lethal_kick.ki - Delete lethal_snare.ki - Delete major.ki - Delete MontyKick.ki - Delete snappy.ki - Delete ssnare.ki - Delete stabmaj.ki - Delete stabmin.ki - Delete the_horror.ki - Delete tom.ki - Delete vibbas_flt.ki - Delete wetkick.ki - - SetOutPath $INSTDIR\examples\songs - - Delete "ringmod.kt" - Delete "Sprock'n'Sprawl.kt" - Delete "phonkeh.kt" - Delete "obspatial.kt" - Delete "Paranoimia (Suntronic).kt" - Delete "hskv03-rygar_trance.kt" - Delete "castlevania.kt" - Delete "dr.happy.kt" - Delete "hwv 437.kt" - Delete "smp_dpintro.kt" - Delete "smp_dingleberries_fix.kt" - Delete "Diverted_Experience.kt" - Delete "Ocean Loader III.kt" + SetOutPath $INSTDIR\examples + !tempfile deletetemp2 + !system '"installer\UnFiles.cmd" "examples" "${deletetemp2}"' + !include ${deletetemp2} + !delfile ${deletetemp2} + SetOutPath $TEMP Delete "$SMPROGRAMS\klystrack\klystrack.lnk" @@ -216,9 +137,12 @@ Section Uninstall RMDir $SMPROGRAMS\klystrack RMDir $INSTDIR\examples\songs + RMDir $INSTDIR\examples\songs\n00bstar-examples RMDir $INSTDIR\examples\instruments + RMDir $INSTDIR\examples\instruments\n00bstar-instruments RMDir $INSTDIR\examples RMDir $INSTDIR\res + RMDir $INSTDIR\key Delete $INSTDIR\uninstall.exe