;-------------------------------- ; BrowseAmp Skin installer script ; created by Henry Thasler on March 9, 2008 ; update 2008-03-23: WriteIniStr added in Installer Section ; modified by ;-------------------------------- ;Include Modern UI !include "MUI.nsh" !include "InstallOptions.nsh" ;-------------------------------- ;General !define AppLongName "Some really cool skin" ; Define your long skin name here. !define AppShortName "coolSkin" ; Define your short skin name for the installer exe without blanks here. !define AppVersion "1.0" ; Define your Skin version here. ;Name and file Name "${AppLongName}" OutFile "${AppShortName}.exe" ;Default installation folder InstallDir "$PROGRAMFILES\Winamp" ;-------------------------------- ;Interface Settings !define MUI_ABORTWARNING !define MUI_WELCOMEPAGE_TITLE "Welcome to ${AppLongName}" ;!define MUI_WELCOMEPAGE_TEXT "Version: ${AppVersion}\r\n\r\nThis will ${AppShortName} provides a free customizable web interface to control Winamp with a webbrowser over any TCP/IP based network connection.\r\n\r\nKey features:\r\n- build-in webserver.\r\n- user management with detailed privileges.\r\n- customizable web interface (Skins).\r\n- album art display support." !define MUI_DIRECTORYPAGE_TEXT_TOP "Setup has found the following Winamp folder. Make sure this is your current Winamp folder, if you have multiple Winamp versions installed.$\r$\n$\r$\nTo install in a different folder, click Browse and select another folder.$\r$\n$\r$\nClick Next to continue." ;-------------------------------- ;Pages !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "readme.txt" !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH ;-------------------------------- ;Languages !insertmacro MUI_LANGUAGE "English" ;-------------------------------- ;Installer Sections Section "Skin package" SecCopySkin SetOutPath "$INSTDIR\Plugins\browseamp\${AppShortName}" File /r /x *.exe /x *.nsi *.* ; uncomment the following line if you need a special file extension parsed by BrowseAmp. Change the extension (here: txt) and the mime-type (here: text/plain) according to your needs ; WriteIniStr "$INSTDIR\Plugins\browseamp\mime.ini" "mime" "txt" "text/plain" SectionEnd Function .onInit System::Call 'kernel32::CreateMutexA(i 0, i 0, t "myMutex") i .r1 ?e' Pop $R0 StrCmp $R0 0 +3 MessageBox MB_OK|MB_ICONEXCLAMATION "The installer is already running." Abort Call GetWinampInstPath Pop $0 StrCpy $INSTDIR $0 FunctionEnd Function GetWinampInstPath Push $0 Push $1 Push $2 ReadRegStr $0 HKLM \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp" \ "UninstallString" StrCmp $0 "" fin StrCpy $1 $0 1 0 ; get firstchar StrCmp $1 '"' "" getparent ; if first char is ", let's remove "'s first. StrCpy $0 $0 "" 1 StrCpy $1 0 rqloop: StrCpy $2 $0 1 $1 StrCmp $2 '"' rqdone StrCmp $2 "" rqdone IntOp $1 $1 + 1 Goto rqloop rqdone: StrCpy $0 $0 $1 getparent: ; the uninstall string goes to an EXE, let's get the directory. StrCpy $1 -1 gploop: StrCpy $2 $0 1 $1 StrCmp $2 "" gpexit StrCmp $2 "\" gpexit IntOp $1 $1 - 1 Goto gploop gpexit: StrCpy $0 $0 $1 StrCmp $0 "" fin IfFileExists $0\winamp.exe fin StrCpy $0 "" fin: Pop $2 Pop $1 Exch $0 FunctionEnd