2006-02-26 03:48:23 -05:00
|
|
|
; $Id$
|
|
|
|
; Script generated by the HM NIS Edit Script Wizard.
|
|
|
|
|
|
|
|
; HM NIS Edit Wizard helper defines
|
2006-04-30 23:10:45 -04:00
|
|
|
!define PRODUCT_NAME "Firefly Media Server"
|
|
|
|
!define PRODUCT_SERVICE "Firefly Media Server"
|
2006-02-26 03:48:23 -05:00
|
|
|
!define /date DATEVER "%Y%m%d"
|
2006-05-07 03:35:43 -04:00
|
|
|
!define PRODUCT_VERSION "svn-$WCREV$"
|
2006-02-26 03:48:23 -05:00
|
|
|
!define PRODUCT_PUBLISHER "Ron Pedde"
|
2006-04-30 23:10:45 -04:00
|
|
|
!define PRODUCT_WEB_SITE "http://www.fireflymediaserver.org"
|
|
|
|
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\firefly.exe"
|
2006-02-26 03:48:23 -05:00
|
|
|
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
|
|
|
|
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
|
|
|
|
|
2006-04-30 23:10:45 -04:00
|
|
|
!define PROJROOT "..\..\.."
|
2006-12-24 12:53:01 -05:00
|
|
|
|
|
|
|
!define MTDROOT "..\.."
|
|
|
|
!define MTD_SOURCE "${MTDROOT}\win32\Release"
|
2006-04-30 23:10:45 -04:00
|
|
|
!define DLL_SOURCE "${PROJROOT}\win32\dll"
|
2006-12-24 12:53:01 -05:00
|
|
|
!define CONFIG_SOURCE "${MTDROOT}\win32\FireflyShell\Release"
|
|
|
|
!define ADMIN_ROOT "${MTDROOT}\admin-root"
|
2006-06-05 03:43:10 -04:00
|
|
|
!define REDIST_SOURCE "${PROJROOT}\win32\redist"
|
2006-04-30 23:10:45 -04:00
|
|
|
|
2006-02-26 03:48:23 -05:00
|
|
|
; MUI 1.67 compatible ------
|
|
|
|
!include "MUI.nsh"
|
|
|
|
|
|
|
|
; MUI Settings
|
2006-06-16 01:48:27 -04:00
|
|
|
;!define MUI_WELCOMEFINISHPAGE_BITMAP "ffsetup4.bmp"
|
2006-02-26 03:48:23 -05:00
|
|
|
!define MUI_ABORTWARNING
|
|
|
|
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
|
|
|
|
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
|
|
|
|
|
|
|
|
; Welcome page
|
|
|
|
!insertmacro MUI_PAGE_WELCOME
|
|
|
|
; License page
|
2006-04-22 17:37:58 -04:00
|
|
|
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE LicensePost
|
2006-04-30 23:10:45 -04:00
|
|
|
!insertmacro MUI_PAGE_LICENSE "${ADMIN_ROOT}\gpl-license.txt"
|
2006-02-26 03:48:23 -05:00
|
|
|
; Directory page
|
2006-04-22 17:37:58 -04:00
|
|
|
!define MUI_PAGE_CUSTOMFUNCTION_PRE DirectoryPre
|
|
|
|
!define MUI_PAGE_CUSTOMFUNCTION_SHOW DirectoryShow
|
|
|
|
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE DirectoryLeave
|
2006-02-26 03:48:23 -05:00
|
|
|
!insertmacro MUI_PAGE_DIRECTORY
|
2006-04-22 17:37:58 -04:00
|
|
|
|
|
|
|
; Music Directory Page
|
|
|
|
!define MUI_PAGE_CUSTOMFUNCTION_PRE DirectoryPre
|
|
|
|
!define MUI_PAGE_CUSTOMFUNCTION_SHOW DirectoryShow
|
|
|
|
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE DirectoryLeave
|
|
|
|
!insertmacro MUI_PAGE_DIRECTORY
|
|
|
|
|
2006-02-26 03:48:23 -05:00
|
|
|
; Instfiles page
|
|
|
|
!insertmacro MUI_PAGE_INSTFILES
|
|
|
|
; Finish page
|
|
|
|
!insertmacro MUI_PAGE_FINISH
|
|
|
|
|
|
|
|
; Uninstaller pages
|
|
|
|
!insertmacro MUI_UNPAGE_INSTFILES
|
|
|
|
|
|
|
|
; MUI end ------
|
2006-11-28 02:38:07 -05:00
|
|
|
!macro LANG_LOAD LANGLOAD
|
|
|
|
!insertmacro MUI_LANGUAGE "${LANGLOAD}"
|
|
|
|
; !verbose
|
|
|
|
!include "localizations\${LANGLOAD}.nsh"
|
|
|
|
; !verbose on
|
|
|
|
!undef LANG
|
|
|
|
!macroend
|
|
|
|
|
|
|
|
!macro LANG_STRING NAME VALUE
|
|
|
|
LangString "${NAME}" "${LANG_${LANG}}" "${VALUE}"
|
|
|
|
!macroend
|
|
|
|
|
|
|
|
!macro LANG_UNSTRING NAME VALUE
|
|
|
|
!insertmacro LANG_STRING "un.${NAME}" "${VALUE}"
|
|
|
|
!macroend
|
|
|
|
|
|
|
|
!macro LANG_BOTHSTRING NAME VALUE
|
|
|
|
!insertmacro LANG_STRING "${NAME}" "${VALUE}"
|
|
|
|
!insertmacro LANG_UNSTRING "${NAME}" "${VALUE}"
|
|
|
|
!macroend
|
|
|
|
|
|
|
|
|
|
|
|
!insertmacro LANG_LOAD "English"
|
|
|
|
!insertmacro LANG_LOAD "French"
|
|
|
|
!insertmacro LANG_LOAD "Dutch"
|
|
|
|
!insertmacro LANG_LOAD "German"
|
2006-12-06 00:08:24 -05:00
|
|
|
!insertmacro LANG_LOAD "Japanese"
|
|
|
|
!insertmacro LANG_LOAD "Swedish"
|
2006-12-08 00:36:24 -05:00
|
|
|
!insertmacro LANG_LOAD "Italian"
|
2006-02-26 03:48:23 -05:00
|
|
|
|
2006-06-06 01:22:25 -04:00
|
|
|
Name "${PRODUCT_NAME}"
|
2006-05-31 04:34:52 -04:00
|
|
|
Icon "..\ff.ico"
|
|
|
|
UninstallIcon "..\ff.ico"
|
2006-04-30 23:10:45 -04:00
|
|
|
OutFile "${PRODUCT_NAME} (${PRODUCT_VERSION}).exe"
|
2006-06-16 01:48:27 -04:00
|
|
|
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}\"
|
2006-02-26 03:48:23 -05:00
|
|
|
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
|
|
|
|
ShowInstDetails show
|
|
|
|
ShowUnInstDetails show
|
|
|
|
|
2006-03-31 03:32:14 -05:00
|
|
|
Section -Pre
|
2006-06-06 01:22:25 -04:00
|
|
|
!include WinMessages.nsh
|
|
|
|
FindWindow $0 "" "FireflyShellNotifyIconHidden"
|
|
|
|
SendMessage $0 ${WM_CLOSE} 0 0
|
|
|
|
|
|
|
|
nsSCM::QueryStatus "Bonjour Service"
|
|
|
|
Pop $0
|
|
|
|
Pop $1
|
|
|
|
|
|
|
|
StrCmp $0 "success" lbl_got_bonjour
|
2006-11-28 02:38:07 -05:00
|
|
|
MessageBox MB_OK "$(STRING_BONJOUR_ERROR)"
|
2006-06-06 01:22:25 -04:00
|
|
|
Quit
|
|
|
|
|
|
|
|
lbl_got_bonjour:
|
|
|
|
|
|
|
|
IntOp $9 0 + 0
|
|
|
|
|
2006-05-05 03:38:13 -04:00
|
|
|
nsSCM::QueryStatus "${PRODUCT_NAME}"
|
|
|
|
Pop $0
|
|
|
|
Pop $1
|
|
|
|
|
|
|
|
StrCmp $0 "success" lbl_stop_service
|
|
|
|
goto lbl_continue
|
|
|
|
|
|
|
|
lbl_stop_service:
|
2006-11-28 02:38:07 -05:00
|
|
|
DetailPrint "$(STRING_STOPPING_SERVICE)"
|
|
|
|
nsSCM::Stop "$(PRODUCT_NAME)"
|
2006-05-06 03:22:51 -04:00
|
|
|
|
|
|
|
lbl_wait_stop:
|
2006-06-08 05:37:04 -04:00
|
|
|
Sleep 1000
|
2006-11-28 02:38:07 -05:00
|
|
|
nsSCM::QueryStatus "$(PRODUCT_NAME)"
|
2006-05-06 03:22:51 -04:00
|
|
|
Pop $0
|
|
|
|
Pop $1
|
|
|
|
|
2006-11-28 02:38:07 -05:00
|
|
|
; DetailPrint $0
|
2006-05-06 03:22:51 -04:00
|
|
|
StrCmp $0 "success" lbl_check_status
|
|
|
|
goto lbl_continue
|
|
|
|
|
|
|
|
lbl_check_status:
|
|
|
|
IntCmp $1 1 lbl_continue lbl_wait_stop lbl_wait_stop
|
2006-06-06 01:22:25 -04:00
|
|
|
|
2006-05-05 03:38:13 -04:00
|
|
|
lbl_continue:
|
|
|
|
; should really loop until service stops...
|
2006-11-28 02:38:07 -05:00
|
|
|
DetailPrint "$(STRING_WAITING_FOR_STOP)"
|
2006-06-06 01:22:25 -04:00
|
|
|
|
|
|
|
IntOp $9 $9 + 1
|
2006-06-08 05:37:04 -04:00
|
|
|
IntCmp $9 10 +1 +1 lbl_done_pre
|
|
|
|
|
|
|
|
Sleep 1500
|
|
|
|
Delete $2\firefly.exe
|
2006-06-06 01:22:25 -04:00
|
|
|
IfErrors lbl_continue
|
|
|
|
|
2006-06-08 05:37:04 -04:00
|
|
|
lbl_done_pre:
|
2006-05-02 02:14:39 -04:00
|
|
|
|
2006-03-31 03:32:14 -05:00
|
|
|
SectionEnd
|
|
|
|
|
2006-02-26 03:48:23 -05:00
|
|
|
Section "MainSection" SEC01
|
2006-04-22 17:37:58 -04:00
|
|
|
SetOutPath "$2"
|
2007-01-17 00:10:01 -05:00
|
|
|
|
|
|
|
IfFileExists "$SMPROGRAMS\${PRODUCT_NAME}" HasProgramItems
|
|
|
|
goto NoProgramItems
|
|
|
|
|
|
|
|
HasProgramItems:
|
|
|
|
Delete "$SMPROGRAMS\${PRODUCT_NAME}\*"
|
|
|
|
|
|
|
|
NoProgramItems:
|
2006-06-08 05:37:04 -04:00
|
|
|
SetOverwrite on
|
2006-05-02 02:14:39 -04:00
|
|
|
File /oname=firefly.exe "${MTD_SOURCE}\mt-daapd.exe"
|
2006-05-29 07:07:19 -04:00
|
|
|
File "${CONFIG_SOURCE}\FireflyShell.exe"
|
2006-11-30 02:28:25 -05:00
|
|
|
File "${CONFIG_SOURCE}\FireflyShell-0c.dll"
|
|
|
|
File "${CONFIG_SOURCE}\FireflyShell-07.dll"
|
|
|
|
File "${CONFIG_SOURCE}\FireflyShell-13.dll"
|
2006-12-06 00:08:24 -05:00
|
|
|
File "${CONFIG_SOURCE}\FireflyShell-1d.dll"
|
|
|
|
File "${CONFIG_SOURCE}\FireflyShell-11.dll"
|
2006-12-08 00:36:24 -05:00
|
|
|
File "${CONFIG_SOURCE}\FireflyShell-10.dll"
|
2006-06-06 01:22:25 -04:00
|
|
|
File "${CONFIG_SOURCE}\..\FireflyShell.exe.manifest"
|
2006-04-25 19:13:04 -04:00
|
|
|
File "${DLL_SOURCE}\gnu_regex.dll"
|
|
|
|
File "${DLL_SOURCE}\pthreadVC2.dll"
|
|
|
|
File "${DLL_SOURCE}\sqlite.dll"
|
|
|
|
File "${DLL_SOURCE}\sqlite3.dll"
|
|
|
|
File "${DLL_SOURCE}\zlib1.dll"
|
2006-05-28 02:11:37 -04:00
|
|
|
File "${DLL_SOURCE}\avutil.dll"
|
|
|
|
File "${DLL_SOURCE}\avcodec.dll"
|
|
|
|
File "${DLL_SOURCE}\avformat.dll"
|
2006-05-28 02:36:28 -04:00
|
|
|
File "${DLL_SOURCE}\libFLAC.dll"
|
2006-05-02 02:14:39 -04:00
|
|
|
|
2006-06-05 03:43:10 -04:00
|
|
|
File "${REDIST_SOURCE}\msvcp71.dll"
|
|
|
|
File "${REDIST_SOURCE}\msvcr71.dll"
|
|
|
|
|
2006-05-02 02:14:39 -04:00
|
|
|
SetOutPath "$2\plugins"
|
2006-05-04 02:39:38 -04:00
|
|
|
File "${MTD_SOURCE}\rsp.dll"
|
2006-10-08 19:27:47 -04:00
|
|
|
File "${MTD_SOURCE}\out-daap.dll"
|
2006-05-04 02:39:38 -04:00
|
|
|
File "${MTD_SOURCE}\w32-event.dll"
|
2006-05-28 02:11:37 -04:00
|
|
|
File "${MTD_SOURCE}\ssc-ffmpeg.dll"
|
2006-06-05 03:43:10 -04:00
|
|
|
File "${MTD_SOURCE}\ssc-wma.dll"
|
2006-05-04 02:39:38 -04:00
|
|
|
|
2006-04-22 17:37:58 -04:00
|
|
|
SetOutPath "$2\admin-root"
|
2006-04-25 19:13:04 -04:00
|
|
|
File "${ADMIN_ROOT}\thanks.html"
|
2006-06-25 15:42:43 -04:00
|
|
|
File "${ADMIN_ROOT}\about.html"
|
2006-05-18 02:30:11 -04:00
|
|
|
File "${ADMIN_ROOT}\status.js"
|
2006-04-25 19:13:04 -04:00
|
|
|
File "${ADMIN_ROOT}\smartpopup.html"
|
|
|
|
File "${ADMIN_ROOT}\smart.js"
|
|
|
|
File "${ADMIN_ROOT}\smart.html"
|
|
|
|
File "${ADMIN_ROOT}\required.gif"
|
|
|
|
File "${ADMIN_ROOT}\playlist.js"
|
|
|
|
File "${ADMIN_ROOT}\playlist.html"
|
2006-06-14 16:27:16 -04:00
|
|
|
File "${ADMIN_ROOT}\ff_logo_sm.gif"
|
2006-06-27 18:17:21 -04:00
|
|
|
File "${ADMIN_ROOT}\firefly.js"
|
|
|
|
File "${ADMIN_ROOT}\firefly.css"
|
2006-11-11 16:56:31 -05:00
|
|
|
File "${ADMIN_ROOT}\index.css"
|
|
|
|
File "${ADMIN_ROOT}\config.css"
|
2006-04-25 19:13:04 -04:00
|
|
|
File "${ADMIN_ROOT}\linkTransparent.gif"
|
|
|
|
File "${ADMIN_ROOT}\linkOpaque.gif"
|
|
|
|
File "${ADMIN_ROOT}\index.html"
|
|
|
|
File "${ADMIN_ROOT}\hdr.html"
|
|
|
|
File "${ADMIN_ROOT}\gpl-license.txt"
|
|
|
|
File "${ADMIN_ROOT}\gpl-license.html"
|
|
|
|
File "${ADMIN_ROOT}\ftr.html"
|
|
|
|
File "${ADMIN_ROOT}\feedback.html"
|
|
|
|
File "${ADMIN_ROOT}\favicon.ico"
|
|
|
|
File "${ADMIN_ROOT}\DAAPApplet-0.1.jar"
|
|
|
|
File "${ADMIN_ROOT}\CREDITS"
|
|
|
|
File "${ADMIN_ROOT}\config-update.html"
|
|
|
|
File "${ADMIN_ROOT}\config.html"
|
|
|
|
File "${ADMIN_ROOT}\config.js"
|
2006-05-18 02:30:11 -04:00
|
|
|
File "${ADMIN_ROOT}\config.xml"
|
2006-04-25 19:13:04 -04:00
|
|
|
File "${ADMIN_ROOT}\aspl-license.txt"
|
|
|
|
File "${ADMIN_ROOT}\aspl-license.html"
|
|
|
|
File "${ADMIN_ROOT}\applet.html"
|
2006-05-24 02:52:15 -04:00
|
|
|
File "${ADMIN_ROOT}\spinner.gif"
|
2006-06-25 16:36:28 -04:00
|
|
|
File "${ADMIN_ROOT}\spinner_stopped.gif"
|
2006-05-27 17:04:19 -04:00
|
|
|
File "${ADMIN_ROOT}\util.js"
|
2006-05-28 04:45:44 -04:00
|
|
|
File "${ADMIN_ROOT}\pngfix.js"
|
2006-06-01 03:31:04 -04:00
|
|
|
File "${ADMIN_ROOT}\no_access.html"
|
2006-04-22 17:37:58 -04:00
|
|
|
SetOutPath "$2\admin-root\lib-js"
|
2006-04-25 19:13:04 -04:00
|
|
|
File "${ADMIN_ROOT}\lib-js\prototype.js"
|
|
|
|
File "${ADMIN_ROOT}\lib-js\rico.js"
|
2006-04-22 17:37:58 -04:00
|
|
|
SetOutPath "$2\admin-root\lib-js\script.aculo.us"
|
2006-04-25 19:13:04 -04:00
|
|
|
File "${ADMIN_ROOT}\lib-js\script.aculo.us\builder.js"
|
|
|
|
File "${ADMIN_ROOT}\lib-js\script.aculo.us\controls.js"
|
|
|
|
File "${ADMIN_ROOT}\lib-js\script.aculo.us\dragdrop.js"
|
|
|
|
File "${ADMIN_ROOT}\lib-js\script.aculo.us\effects.js"
|
|
|
|
File "${ADMIN_ROOT}\lib-js\script.aculo.us\scriptaculous.js"
|
|
|
|
File "${ADMIN_ROOT}\lib-js\script.aculo.us\slider.js"
|
|
|
|
File "${ADMIN_ROOT}\lib-js\script.aculo.us\unittest.js"
|
2006-04-22 17:37:58 -04:00
|
|
|
SetOutPath "$2"
|
2006-04-30 23:10:45 -04:00
|
|
|
File "mt-daapd-example.conf"
|
2006-04-22 17:37:58 -04:00
|
|
|
IfFileExists "$2\mt-daapd.conf" HasConf
|
2006-02-26 03:48:23 -05:00
|
|
|
SetOverwrite off
|
2006-04-22 17:37:58 -04:00
|
|
|
CopyFiles "$2\mt-daapd-example.conf" "$2\mt-daapd.conf"
|
|
|
|
WriteINIStr "$2\mt-daapd.conf" "general" "mp3_dir" $3
|
2006-04-25 19:13:04 -04:00
|
|
|
HasConf:
|
2006-05-04 02:39:38 -04:00
|
|
|
WriteINIStr "$2\mt-daapd.conf" "plugins" "plugin_dir" "plugins"
|
2007-01-17 00:10:01 -05:00
|
|
|
WriteINIStr "$2\mt-daapd.conf" "plugins" "plugins" ""
|
2006-05-06 03:22:51 -04:00
|
|
|
ReadINIStr $0 "$2\mt-daapd.conf" "general" "rescan_interval"
|
|
|
|
StrCmp $0 "" rescan_set rescan_skip
|
|
|
|
rescan_set:
|
|
|
|
WriteINIStr "$2\mt-daapd.conf" "general" "rescan_interval" "600"
|
|
|
|
rescan_skip:
|
2006-05-31 04:34:52 -04:00
|
|
|
|
|
|
|
ReadINIStr $0 "$2\mt-daapd.conf" "general" "logfile"
|
|
|
|
StrCmp $0 "" logfile_set logfile_skip
|
|
|
|
|
|
|
|
logfile_set:
|
|
|
|
WriteINIStr "$2\mt-daapd.conf" "general" "logfile" "firefly.log"
|
|
|
|
logfile_skip:
|
2006-06-06 01:22:25 -04:00
|
|
|
|
|
|
|
; Check for default exts
|
|
|
|
ReadINIStr $0 "$2\mt-daapd.conf" "general" "extensions"
|
|
|
|
StrCmp $0 ".mp3,.m4a,.m4p" ext_set ext_skip
|
|
|
|
|
|
|
|
ext_set:
|
|
|
|
WriteINIStr "$2\mt-daapd.conf" "general" "extensions" ".mp3,.m4a,.m4p,.wma"
|
|
|
|
|
|
|
|
ext_skip:
|
|
|
|
|
2006-06-16 02:06:15 -04:00
|
|
|
; Check for truncate
|
|
|
|
ReadINIStr $0 "$2\mt-daapd.conf" "general" "truncate"
|
|
|
|
StrCmp $0 "" trunc_set trunc_skip
|
|
|
|
|
|
|
|
trunc_set:
|
|
|
|
WriteINIStr "$2\mt-daapd.conf" "general" "truncate" "1"
|
|
|
|
|
|
|
|
trunc_skip:
|
2007-01-17 00:10:01 -05:00
|
|
|
WriteINIStr "$2\mt-daapd.conf" "general" "db_type" "sqlite3"
|
2006-12-24 12:53:01 -05:00
|
|
|
AccessControl::SetOnFile "$2\mt-daapd.conf" "Everyone" "FullAccess"
|
2006-04-22 17:37:58 -04:00
|
|
|
SetAutoClose False
|
2006-02-26 03:48:23 -05:00
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
Section -AdditionalIcons
|
2006-04-22 17:37:58 -04:00
|
|
|
WriteIniStr "$2\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
|
2006-04-30 23:10:45 -04:00
|
|
|
CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
|
2006-11-28 02:38:07 -05:00
|
|
|
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\$(STRING_WEBSITE).lnk" "$2\${PRODUCT_NAME}.url"
|
|
|
|
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\$(STRING_UNINSTALL).lnk" "$2\uninst.exe"
|
|
|
|
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\$(STRING_DEBUG_MODE).lnk" "$2\firefly.exe" "-d9 -f"
|
|
|
|
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\$(STRING_FF_CONFIGURATION).lnk" "$2\FireflyShell.exe"
|
|
|
|
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\$(STRING_ADV_CONFIG).lnk" "notepad.exe" "$2\mt-daapd.conf"
|
2006-05-31 04:34:52 -04:00
|
|
|
|
|
|
|
Delete "$SMPROGRAMS\Startup\Firefly Configuration.lnk"
|
|
|
|
|
2006-02-26 03:48:23 -05:00
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
Section -Post
|
2006-04-22 17:37:58 -04:00
|
|
|
WriteUninstaller "$2\uninst.exe"
|
|
|
|
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$2\mt-daapd.exe"
|
2006-02-26 03:48:23 -05:00
|
|
|
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
|
2006-04-22 17:37:58 -04:00
|
|
|
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$2\uninst.exe"
|
|
|
|
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$2\mt-daapd.exe"
|
2006-02-26 03:48:23 -05:00
|
|
|
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
|
|
|
|
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
|
|
|
|
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
|
2006-05-29 07:07:19 -04:00
|
|
|
|
|
|
|
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "FireflyShell" '"$2\FireflyShell.exe" -q'
|
2006-04-22 17:37:58 -04:00
|
|
|
; ExecWait "$2\mt-daapd.exe -i"
|
2006-03-31 03:32:14 -05:00
|
|
|
|
2006-04-30 23:10:45 -04:00
|
|
|
nsSCM::Install "${PRODUCT_NAME}" "${PRODUCT_SERVICE}" 16 2 "$2\firefly.exe" "" "Bonjour Service" "" ""
|
2006-03-31 03:32:14 -05:00
|
|
|
Pop $0
|
|
|
|
Pop $1
|
|
|
|
|
|
|
|
StrCmp $0 "success" lbl_install_success
|
|
|
|
IntCmp $1 1073 lbl_install_success ; service already exists
|
|
|
|
MessageBox MB_OK "Error installing service: $1"
|
|
|
|
|
|
|
|
lbl_install_success:
|
2006-05-07 03:35:43 -04:00
|
|
|
ExecWait 'netsh firewall add allowedprogram "$2\firefly.exe" "${PRODUCT_NAME}" enable'
|
|
|
|
|
2006-04-25 19:13:04 -04:00
|
|
|
nsSCM::Start "${PRODUCT_NAME}"
|
2006-05-31 04:34:52 -04:00
|
|
|
Exec '"$2\FireflyShell.exe" -q'
|
2006-02-26 03:48:23 -05:00
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
|
|
|
|
Function un.onUninstSuccess
|
|
|
|
HideWindow
|
2006-11-28 02:38:07 -05:00
|
|
|
MessageBox MB_ICONINFORMATION|MB_OK "$(un.STRING_UNINSTALLED)"
|
2006-02-26 03:48:23 -05:00
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function un.onInit
|
2006-11-28 02:38:07 -05:00
|
|
|
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(un.STRING_AREYOUSURE)" IDYES +2
|
2006-02-26 03:48:23 -05:00
|
|
|
Abort
|
|
|
|
FunctionEnd
|
|
|
|
|
2006-04-22 17:37:58 -04:00
|
|
|
Function .onInit
|
|
|
|
; Must set $INSTDIR here to avoid adding ${PRODUCT_NAME} to the end of the
|
|
|
|
; path when user selects a new directory using the 'Browse' button.
|
|
|
|
StrCpy $INSTDIR "$PROGRAMFILES\${PRODUCT_NAME}"
|
2006-11-21 12:27:13 -05:00
|
|
|
StrCpy $2 "$PROGRAMFILES\${PRODUCT_NAME}"
|
|
|
|
StrCpy $3 "$DOCUMENTS\My Music"
|
2006-11-28 02:38:07 -05:00
|
|
|
|
2006-12-06 00:08:24 -05:00
|
|
|
Push ""
|
|
|
|
Push ${LANG_ENGLISH}
|
|
|
|
Push English
|
|
|
|
Push ${LANG_FRENCH}
|
|
|
|
Push French
|
|
|
|
Push ${LANG_DUTCH}
|
|
|
|
Push Dutch
|
|
|
|
Push ${LANG_GERMAN}
|
|
|
|
Push German
|
|
|
|
Push ${LANG_JAPANESE}
|
|
|
|
Push Japanese
|
|
|
|
Push ${LANG_SWEDISH}
|
|
|
|
Push Swedish
|
2006-12-08 00:36:24 -05:00
|
|
|
Push ${LANG_ITALIAN}
|
|
|
|
Push Italian
|
2006-12-06 00:08:24 -05:00
|
|
|
; more
|
|
|
|
Push A
|
|
|
|
LangDLL::LangDialog "Installer Language" "Please select the language of the installer"
|
|
|
|
Pop $LANGUAGE
|
|
|
|
StrCmp $LANGUAGE "cancel" 0 +2
|
|
|
|
Abort
|
2006-04-22 17:37:58 -04:00
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function LicensePost
|
|
|
|
StrCpy $9 "0"
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function DirectoryPre
|
|
|
|
StrCmp $9 "0" OK
|
|
|
|
;Skip 2nd (Music) Directory Page if conf file Exists
|
|
|
|
IfFileExists "$2\mt-daapd.conf" "" OK
|
|
|
|
Abort
|
|
|
|
OK:
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
|
|
|
|
Function DirectoryShow
|
|
|
|
StrCmp $9 "0" AppDirectoryPage
|
|
|
|
StrCmp $9 "1" MusicDirectoryPage
|
|
|
|
|
|
|
|
AppDirectoryPage:
|
|
|
|
StrCpy $9 "1"
|
2006-11-28 02:38:07 -05:00
|
|
|
!insertmacro MUI_INNERDIALOG_TEXT 1041 "$(STRING_DESTFOLDER)"
|
2006-04-22 17:37:58 -04:00
|
|
|
!insertmacro MUI_INNERDIALOG_TEXT 1019 "$PROGRAMFILES\${PRODUCT_NAME}\"
|
2006-11-28 02:38:07 -05:00
|
|
|
!insertmacro MUI_INNERDIALOG_TEXT 1006 "$(STRING_DESTDETAIL)"
|
2006-04-22 17:37:58 -04:00
|
|
|
Goto EndDirectoryShow
|
|
|
|
|
|
|
|
MusicDirectoryPage:
|
|
|
|
StrCpy $9 "2"
|
2006-11-28 02:38:07 -05:00
|
|
|
!insertmacro MUI_HEADER_TEXT "$(STRING_MUSICTITLE)" "$(STRING_MUSICHEADER)"
|
|
|
|
!insertmacro MUI_INNERDIALOG_TEXT 1041 "$(STRING_MUSICFOLDER)"
|
2006-04-25 19:13:04 -04:00
|
|
|
!insertmacro MUI_INNERDIALOG_TEXT 1019 "$DOCUMENTS\My Music"
|
2006-11-28 02:38:07 -05:00
|
|
|
!insertmacro MUI_INNERDIALOG_TEXT 1006 "$(STRING_MUSICDETAIL)"
|
2006-04-22 17:37:58 -04:00
|
|
|
EndDirectoryShow:
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function DirectoryLeave
|
|
|
|
StrCmp $9 "1" SaveInstallDir
|
|
|
|
StrCmp $9 "2" SaveMusicDir
|
|
|
|
Goto EndDirectoryLeave
|
|
|
|
|
|
|
|
SaveInstallDir:
|
|
|
|
StrCpy $2 $INSTDIR
|
|
|
|
Goto EndDirectoryLeave
|
|
|
|
|
|
|
|
SaveMusicDir:
|
2006-04-30 23:10:45 -04:00
|
|
|
; Push $INSTDIR
|
|
|
|
; Call GetParent
|
|
|
|
; Pop $3
|
|
|
|
StrCpy $3 $INSTDIR
|
2006-04-22 17:37:58 -04:00
|
|
|
|
|
|
|
EndDirectoryLeave:
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function .onVerifyInstDir
|
|
|
|
StrCmp $9 "2" DataPath All
|
|
|
|
|
|
|
|
DataPath:
|
|
|
|
;all valid if UNC
|
|
|
|
StrCpy $R2 $INSTDIR 2
|
|
|
|
StrCmp $R2 "\\" PathOK
|
|
|
|
|
|
|
|
All:
|
|
|
|
; Invalid path if root
|
|
|
|
Push $INSTDIR
|
|
|
|
call GetRoot
|
|
|
|
Pop $R1
|
|
|
|
StrCmp $R1 $INSTDIR "" PathOK
|
|
|
|
Abort
|
|
|
|
|
|
|
|
PathOK:
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
;Helper Functions
|
|
|
|
|
2006-04-25 19:13:04 -04:00
|
|
|
; GetParent
|
|
|
|
; input, top of stack (e.g. C:\Program Files\Poop)
|
|
|
|
; output, top of stack (replaces, with e.g. C:\Program Files)
|
|
|
|
; modifies no other variables.
|
|
|
|
;
|
|
|
|
; Usage:
|
|
|
|
; Push "C:\Program Files\Directory\Whatever"
|
|
|
|
; Call GetParent
|
|
|
|
; Pop $R0
|
|
|
|
; ; at this point $R0 will equal "C:\Program Files\Directory"
|
|
|
|
Function GetParent
|
|
|
|
|
|
|
|
Exch $R0
|
|
|
|
Push $R1
|
|
|
|
Push $R2
|
|
|
|
Push $R3
|
|
|
|
|
|
|
|
StrCpy $R1 0
|
|
|
|
StrLen $R2 $R0
|
|
|
|
|
|
|
|
loop:
|
|
|
|
IntOp $R1 $R1 + 1
|
|
|
|
IntCmp $R1 $R2 get 0 get
|
|
|
|
StrCpy $R3 $R0 1 -$R1
|
|
|
|
StrCmp $R3 "\" get
|
|
|
|
Goto loop
|
|
|
|
|
|
|
|
get:
|
|
|
|
StrCpy $R0 $R0 -$R1
|
|
|
|
|
|
|
|
Pop $R3
|
|
|
|
Pop $R2
|
|
|
|
Pop $R1
|
|
|
|
Exch $R0
|
|
|
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
|
2006-04-22 17:37:58 -04:00
|
|
|
Function GetRoot
|
|
|
|
Exch $0
|
|
|
|
Push $1
|
|
|
|
Push $2
|
|
|
|
Push $3
|
|
|
|
Push $4
|
|
|
|
|
|
|
|
StrCpy $1 $0 2
|
|
|
|
StrCmp $1 "\\" UNC
|
|
|
|
StrCpy $0 $1
|
|
|
|
Goto done
|
|
|
|
|
|
|
|
UNC:
|
|
|
|
StrCpy $2 3
|
|
|
|
StrLen $3 $0
|
|
|
|
loop:
|
|
|
|
IntCmp $2 $3 "" "" loopend
|
|
|
|
StrCpy $1 $0 1 $2
|
|
|
|
IntOp $2 $2 + 1
|
|
|
|
StrCmp $1 "\" loopend loop
|
|
|
|
loopend:
|
|
|
|
StrCmp $4 "1" +3
|
|
|
|
StrCpy $4 1
|
|
|
|
Goto loop
|
|
|
|
IntOp $2 $2 - 1
|
|
|
|
StrCpy $0 $0 $2
|
|
|
|
|
|
|
|
done:
|
|
|
|
Pop $4
|
|
|
|
Pop $3
|
|
|
|
Pop $2
|
|
|
|
Pop $1
|
|
|
|
Exch $0
|
|
|
|
FunctionEnd
|
|
|
|
|
2006-02-26 03:48:23 -05:00
|
|
|
Section Uninstall
|
2007-01-17 00:10:01 -05:00
|
|
|
SetAutoClose false
|
|
|
|
|
|
|
|
!include WinMessages.nsh
|
|
|
|
close_loop:
|
|
|
|
FindWindow $0 "" "FireflyShellNotifyIconHidden"
|
|
|
|
|
|
|
|
IntCmp $0 0 close_done
|
|
|
|
SendMessage $0 ${WM_QUIT} 0 0
|
|
|
|
SendMessage $0 ${WM_CLOSE} 0 0
|
|
|
|
SendMessage $0 ${WM_DESTROY} 0 0
|
|
|
|
Sleep 125
|
|
|
|
Goto close_loop
|
|
|
|
close_done:
|
|
|
|
|
|
|
|
IntOp $9 0 + 0
|
|
|
|
|
|
|
|
nsSCM::QueryStatus "${PRODUCT_NAME}"
|
|
|
|
Pop $0
|
|
|
|
Pop $1
|
|
|
|
|
|
|
|
StrCmp $0 "success" un_lbl_stop_service
|
|
|
|
goto un_lbl_continue
|
|
|
|
|
|
|
|
un_lbl_stop_service:
|
|
|
|
DetailPrint "$(STRING_STOPPING_SERVICE)"
|
|
|
|
nsSCM::Stop "$(PRODUCT_NAME)"
|
|
|
|
|
|
|
|
un_lbl_wait_stop:
|
|
|
|
Sleep 1000
|
|
|
|
nsSCM::QueryStatus "$(PRODUCT_NAME)"
|
|
|
|
Pop $0
|
|
|
|
Pop $1
|
|
|
|
|
|
|
|
; DetailPrint $0
|
|
|
|
StrCmp $0 "success" un_lbl_check_status
|
|
|
|
goto un_lbl_continue
|
|
|
|
|
|
|
|
un_lbl_check_status:
|
|
|
|
IntCmp $1 1 un_lbl_continue un_lbl_wait_stop un_lbl_wait_stop
|
|
|
|
|
|
|
|
un_lbl_continue:
|
|
|
|
; should really loop until service stops...
|
|
|
|
DetailPrint "$(STRING_WAITING_FOR_STOP)"
|
|
|
|
|
|
|
|
IntOp $9 $9 + 1
|
|
|
|
IntCmp $9 10 +1 +1 un_lbl_done_pre
|
|
|
|
|
|
|
|
Sleep 1500
|
|
|
|
Delete "$INSTDIR\firefly.exe"
|
|
|
|
IfErrors un_lbl_continue
|
|
|
|
|
|
|
|
un_lbl_done_pre:
|
|
|
|
Sleep 1000
|
2006-03-31 03:32:14 -05:00
|
|
|
nsSCM::Remove "${PRODUCT_NAME}"
|
|
|
|
|
|
|
|
Pop $0
|
|
|
|
StrCmp $0 "success" lbl_continue_uninstall
|
|
|
|
|
2006-04-22 17:37:58 -04:00
|
|
|
MessageBox MB_OK "Error Uninstalling service: $1"
|
2006-03-31 03:32:14 -05:00
|
|
|
|
|
|
|
lbl_continue_uninstall:
|
2006-04-22 17:37:58 -04:00
|
|
|
|
2007-01-17 00:10:01 -05:00
|
|
|
Delete "$INSTDIR\admin-root\lib-js\script.aculo.us\*"
|
2006-04-22 17:37:58 -04:00
|
|
|
RMDir "$INSTDIR\admin-root\lib-js\script.aculo.us"
|
2007-01-17 00:10:01 -05:00
|
|
|
|
|
|
|
Delete "$INSTDIR\admin-root\lib-js\*"
|
2006-04-22 17:37:58 -04:00
|
|
|
RMDir "$INSTDIR\admin-root\lib-js"
|
2007-01-17 00:10:01 -05:00
|
|
|
|
|
|
|
Delete "$INSTDIR\admin-root\*"
|
2006-04-22 17:37:58 -04:00
|
|
|
RMDir "$INSTDIR\admin-root"
|
2006-05-02 02:14:39 -04:00
|
|
|
|
2007-01-17 00:10:01 -05:00
|
|
|
Delete "$INSTDIR\plugins\*"
|
|
|
|
RMDir "$INSTDIR\plugins"
|
2006-05-02 02:14:39 -04:00
|
|
|
|
2007-01-17 00:10:01 -05:00
|
|
|
Delete "$INSTDIR\*"
|
|
|
|
RMDir "$INSTDIR"
|
|
|
|
|
|
|
|
Delete "$SMPROGRAMS\${PRODUCT_NAME}\*"
|
|
|
|
RMDir "$SMPROGRAMS\${PRODUCT_NAME}"
|
|
|
|
RMDir "$INSTDIR"
|
2006-02-26 03:48:23 -05:00
|
|
|
|
|
|
|
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
|
|
|
|
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
|
2006-04-22 17:37:58 -04:00
|
|
|
SetAutoClose false
|
|
|
|
SectionEnd
|