From 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d Mon Sep 17 00:00:00 2001 From: Jef Date: Tue, 24 Sep 2024 14:54:57 +0200 Subject: Initial community commit --- Src/installer/winamp/utils/skins.nsh | 56 ++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Src/installer/winamp/utils/skins.nsh (limited to 'Src/installer/winamp/utils/skins.nsh') diff --git a/Src/installer/winamp/utils/skins.nsh b/Src/installer/winamp/utils/skins.nsh new file mode 100644 index 00000000..f4a67ee6 --- /dev/null +++ b/Src/installer/winamp/utils/skins.nsh @@ -0,0 +1,56 @@ +!ifndef NULLSOFT_WINAMP_SKINS_HEADER +!define NULLSOFT_WINAMP_SKINS_HEADER + +Function ${INSTALL_TYPE_PREFIX}Skins_GetPath + Push $0 + ReadINIStr $0 "$WINAMPINI" "Winamp" "SkinDir" + ${If} $0 != "" + Push $INSTDIR + Push $0 + nsis_winamp::GetFullPath + Pop $0 + ${EndIf} + Exch $0 +FunctionEnd + +!macro Skins_GetPath __pathOut + Call ${INSTALL_TYPE_PREFIX}Skins_GetPath + Pop "${__pathOut}" +!macroend + +!define Skins_GetPath "!insertmacro 'Skins_GetPath'" + +Function ${INSTALL_TYPE_PREFIX}Skins_GetDefaultPath + Push $0 + StrCpy $0 "$INSTDIR\Skins" + Exch $0 +FunctionEnd + +!macro Skins_GetDefaultPath __pathOut + Call ${INSTALL_TYPE_PREFIX}Skins_GetDefaultPath + Pop "${__pathOut}" +!macroend + +!define Skins_GetDefaultPath "!insertmacro 'Skins_GetDefaultPath'" + +Function ${INSTALL_TYPE_PREFIX}Skins_DeleteFolder + Exch $0 + + Delete "$0\${MODERNSKINNAME}.wal" + Delete "$0\${MODERNSKINNAME}.wsz" + Delete "$0\${MODERNSKINNAME}.zip" + RMDir /r "$0\${MODERNSKINNAME}" + RMDir /r "$0\Bento" + RMDir /r "$0\Big Bento" + RMDir "$0" ; don't try to delete, prompt user later + Pop $0 +FunctionEnd + +!macro Skins_DeleteFolder __skinsDir + Push "${__skinsDir}" + Call ${INSTALL_TYPE_PREFIX}Skins_DeleteFolder +!macroend + +!define Skins_DeleteFolder "!insertmacro 'Skins_DeleteFolder'" + +!endif ;NULLSOFT_WINAMP_SKINS_HEADER \ No newline at end of file -- cgit