PK ‰VŸ5Hu€k€k ctimw32.nsiSDN\œKt¹cd`ia``PbpbF&‹UH(ÙŒ¬ .«(ðMñÔó/íPtç2©cba`K‹0üg”g`„pÀ$UT Ò—E.—E´ E;-------------------------------- !define TIMIDITY_VERSION "CVS061231" !define DISPLAY_NAME "TiMidity++(${TIMIDITY_VERSION})" !define NEW_INTERFACE ;Var LOCAL_APPDATA !ifdef NEW_INTERFACE ;-------------------------------- ;Include Modern UI !include "MUI.nsh" !endif !include "logiclib.nsh" ; needed by ${switch} ;-------------------------------- # [Installer Attributes] Name "${DISPLAY_NAME}" OutFile "TiMidity-${TIMIDITY_VERSION}_setup.exe" Caption "${DISPLAY_NAME}" # [Licence Attributes] LicenseText "TiMidity++ is distributed under the GNU General Public License :" LicenseData "COPYING.txt" # [Directory Selection] InstallDir "C:\timidity" DirText "Select the directory to install TiMidity++ to :" # [Additional Installer Settings ] SetCompress force SetCompressor lzma ;-------------------------------- ;Interface Settings ShowInstDetails show AutoCloseWindow false SilentInstall normal CRCCheck on SetCompress auto SetDatablockOptimize on ;SetOverwrite ifnewer XPStyle on InstType "Typical" ;1 InstType "Full" ;2 ComponentText "Choose components" # [Background Gradient] BGGradient off !ifdef NEW_INTERFACE !define MUI_ABORTWARNING !endif ;-------------------------------- # [Pages] !ifndef NEW_INTERFACE Page license Page components PageEx directory DirVerify leave ; PageCallbacks "" "" dirLeave PageExEnd Page instfiles UninstPage uninstConfirm UninstPage instfiles !else ;NEW_INTERFACE !insertmacro MUI_PAGE_LICENSE "COPYING.txt" !insertmacro MUI_PAGE_COMPONENTS ; !define MUI_PAGE_CUSTOMFUNCTION_LEAVE dirLeave !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !define MUI_FINISHPAGE_RUN "$INSTDIR\timw32g.exe" !define MUI_FINISHPAGE_NOREBOOTSUPPORT !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES ;-------------------------------- ;Languages !insertmacro MUI_LANGUAGE "English" !insertmacro MUI_LANGUAGE "Japanese" !endif ;NEW_INTERFACE ;-------------------------------- LangString MSG_GOGOdll ${LANG_ENGLISH} "Do you want to download GOGO.dll mp3 encoder dll form http://www.marinecat.net?" LangString MSG_GOGOdll ${LANG_JAPANESE} "MP3‚ւ̕ϊ·—p‚Éhttp://www.marinecat.net ‚©‚çGOGO.DLL‚ðƒ_ƒEƒ“ƒ[ƒh‚µ‚Ü‚·‚©H" ; LangString MSG_EAWPatch ${LANG_ENGLISH} "Do you want to download EAW patches(not for commercial use) ?" ; LangString MSG_EAWPatch ${LANG_JAPANESE} "Eawpatch‰¹FƒZƒbƒgi”ñ¤—pj‚ðƒ_ƒEƒ“ƒ[ƒh‚µ‚Ü‚·‚©H" LangString MSG_Patch ${LANG_ENGLISH} "Do you want to downlodad SYUUHOU patches(not for commercial use) form S-denshi's HP(http://syuuhou.hp.infosee.co.jp)?" LangString MSG_Patch ${LANG_JAPANESE} "S|“dŽqihttp://syuuhou.hp.infosee.co.jpj‚©‚ç SYUUHOU‰¹FƒZƒbƒgi”ñ¤—pj‚ðƒ_ƒEƒ“ƒ[ƒh‚µ‚Ü‚·‚©H" LangString MSG_DlCanceled ${LANG_ENGLISH} "Download Canceled." LangString MSG_DlCanceled ${LANG_JAPANESE} "ƒ_ƒEƒ“ƒ[ƒh‚ªƒLƒƒƒ“ƒZƒ‹‚³‚ê‚Ü‚µ‚½" LangString MSG_DlFailed ${LANG_ENGLISH} "Download Failed." LangString MSG_DlFailed ${LANG_JAPANESE} "ƒ_ƒEƒ“ƒ[ƒhޏ”s" LangString MSG_DlCompleted ${LANG_ENGLISH} "Download completed." LangString MSG_DlCompleted ${LANG_JAPANESE} "ƒ_ƒEƒ“ƒ[ƒhI—¹" LangString MSG_AllUser ${LANG_ENGLISH} "Do you want to install TiMidity++ for all users on this computer ?" LangString MSG_AllUser ${LANG_JAPANESE} "‚±‚̃Rƒ“ƒsƒ…[ƒ^‚Ì‘Sƒ†[ƒU[‚ÉTiMidity++‚ðƒCƒ“ƒXƒg[ƒ‹‚µ‚Ü‚·‚©H" # [Files] Section "TiMidity++ program files (required)" SectionMain SectionIn 1 2 RO SetOutPath $INSTDIR File "COPYING.txt" File "README.ja.txt" File "README.txt" File "SETUP.ja.txt" File "SETUP.txt" File "timw32g.exe" File "twsyng.exe" File "twsynsrv.exe" File "timidity.exe" File "twsynth.bat" File "timpp32g.ini" File "timidity_output.ini" File "timidity_window.ini" ; File "7z.exe" ; File "tar.exe" ; File "tar32.dll" File "unzip.exe" File "unzip32.dll" File "unlha.exe" File "UNLHA32.DLL" File "portaudio.dll" File /r timiditydrv ;INI file DeleteINIStr $INSTDIR\timpp32g.ini PLAYER ConfigFile WriteINIStr $INSTDIR\timpp32g.ini PLAYER ConfigFile "$INSTDIR\timidity.cfg" ;Create uninstaller WriteUninstaller "$INSTDIR\Uninstall.exe" SectionEnd Section "Optional DLLs" SectionOptinaldlls SectionIn 1 2 SetOutPath $INSTDIR ; File "gogo.dll" File "portaudio.dll" File "pdcurses.dll" File "vorbis.dll" File "libFLAC.dll" File "vorbisenc.dll" File "libOggFLAC.dll" ; File "mingwm10.dll" ; File "pa_asio.dll" File "ogg.dll" SectionEnd ;Section "GOGO.DLL" SectionGOGOdll ; SectionIn 2 ; MessageBox MB_YESNO "$(MSG_GOGOdll)" IDNO GOGOEnd ; IfFileExists "$EXEDIR\wing313a.exe" End 0 ; NSISdl::download "http://www.marinecat.net/cgi/lcount/count.cgi?page=3133&name=wing313a.exe&downex=wing313a.exe" "$EXEDIR\wing313a.exe" ; Pop $R4 ; StrCmp $R4 "success" Success ; StrCmp $R4 "cancel" DownloadCanceled ; Goto NoSuccess ;DownloadCanceled: ; DetailPrint "$(MSG_DlCanceled)" ; Goto GOGOEnd ;NoSuccess: ; MessageBox MB_OK "$(MSG_DlFailed)" ; Goto GOGOEnd ;Success: ; DetailPrint "$(MSG_DlCompleted)" ;End: ; SetOutPath $EXEDIR ; nsExec::ExecToLog '"$INSTDIR\unzip.exe" -x "$EXEDIR\wing313a.exe" "$EXEDIR\wing313a\"' ; pop $0 ; StrCmp $0 "error" GOGOEnd ; SetOutPath $EXEDIR\wing313a ; Call GetWindowsVersion ; Pop $0 ; ClearErrors ; StrCmp $0 '95' WIN98 ; StrCmp $0 '98' WIN98 ; StrCmp $0 'ME' WIN98 ; nsExec::ExecToLog '"cmd" /C compile.bat' ; pop $0 ; Goto GOGOMade ;WIN98: ; nsExec::ExecToLog '"command.com" /C compile.bat' ; pop $0 ;GOGOMade: ; CopyFiles "$EXEDIR\wing313a\gogo.dll" "$INSTDIR" ; RMDir /r "$EXEDIR\wing313a" ;GOGOEnd: ;SectionEnd Section "Musix" SectionMusix SectionIn 1 2 SetOutPath $INSTDIR File /r Musix ;INI file DeleteINIStr $INSTDIR\timpp32g.ini PLAYER ConfigFile WriteINIStr $INSTDIR\timpp32g.ini PLAYER ConfigFile "$INSTDIR\Musix\timidity.cfg" ; compleate timidity.cfg FileOpen $0 "$INSTDIR\Musix\timidity.cfg" "w" FileOpen $1 "$INSTDIR\Musix\timskel.cfg" "r" FileWrite $0 'dir "$INSTDIR\Musix"$\r$\n' ClearErrors LOOP: FileRead $1 $2 FileWrite $0 $2 IfErrors DONE LOOP DONE: FileClose $1 FileClose $0 SectionEnd ;Section "Freepats" SectionFreepats ; SectionIn 1 2 ; ; SetOutPath $INSTDIR ; File /r freepats ; ;;INI file ;DeleteINIStr $INSTDIR\timpp32g.ini PLAYER ConfigFile ;WriteINIStr $INSTDIR\timpp32g.ini PLAYER ConfigFile "$INSTDIR\freepats\timidity.cfg" ; ; ;; compleate timidity.cfg ;FileOpen $0 "$INSTDIR\freepats\timidity.cfg" "w" ;FileOpen $1 "$INSTDIR\freepats\timskel.cfg" "r" ;FileWrite $0 'dir "$INSTDIR\freepats"$\r$\n' ;ClearErrors ;LOOP: ;FileRead $1 $2 ;FileWrite $0 $2 ;IfErrors DONE LOOP ;DONE: ;FileClose $1 ;FileClose $0 ; ;SectionEnd ;Section "Eawpatch" SectionEAWPatch ; SectionIn 1 2 ; IfFileExists "$EXEDIR\eawpats12_full.tar.gz" End 0 ; MessageBox MB_YESNO "$(MSG_EAWPatch)" IDNO PatchEnd ; FTPdl::download "ftp://ftp.ecc.u-tokyo.ac.jp/GENTOO/distfiles/eawpats12_full.tar.gz" "$EXEDIR\eawpats12_full.tar.gz" "" "" ; Pop $0 ; StrCmp $0 "success" End 0 ; MessageBox MB_OK "$(MSG_DlFailed)" ; Goto PatchEnd ;End: ; SetOutPath $INSTDIR ; nsExec::ExecToLog '"$INSTDIR\tar.exe" xvzf "$EXEDIR\eawpats12_full.tar.gz"' ; pop $0 ; StrCmp $0 "error" PatchEnd ; RMDir /r "$INSTDIR\Eawpatches" ; Rename $INSTDIR\eawpats $INSTDIR\Eawpatches ;File /r Eawpatches ;;INI file ;DeleteINIStr $INSTDIR\timpp32g.ini PLAYER ConfigFile ;WriteINIStr $INSTDIR\timpp32g.ini PLAYER ConfigFile "$INSTDIR\Eawpatches\timidity.cfg" ; compleate timidity.cfg ;FileOpen $0 "$INSTDIR\Eawpatches\timidity.cfg" "w" ;FileOpen $1 "$INSTDIR\Eawpatches\timskel.cfg" "r" ;FileWrite $0 'dir "$INSTDIR\Eawpatches"$\r$\n' ;ClearErrors ;LOOP: ;FileRead $1 $2 ;FileWrite $0 $2 ;IfErrors DONE LOOP ;DONE: ;FileClose $1 ;FileClose $0 ;PatchEnd: ;SectionEnd ;Section "S-densh SYUUHOU 30M Bpatch" SectionPatch ; SectionIn 2 ; IfFileExists "$EXEDIR\88pros.lzh" NextDl 0 ; MessageBox MB_YESNO "$(MSG_Patch)" IDNO PatchEnd ; NSISdl::download "http://syuuhou.hp.infoseek.co.jp/timidity/88pros.lzh" "$EXEDIR\88pros.lzh" ; Pop $R4 ; StrCmp $R4 "success" NextDl ; StrCmp $R4 "cancel" DownloadCanceled ; Goto NoSuccess ;NextDl: ; IfFileExists "$EXEDIR\inst.zip" End 0 ; NSISdl::download "http://syuuhou.hp.infoseek.co.jp/timidity/inst.zip" "$EXEDIR\inst.zip" ; Pop $R4 ; StrCmp $R4 "success" Success ; StrCmp $R4 "cancel" DownloadCanceled ; Goto NoSuccess ;DownloadCanceled: ; DetailPrint "$(MSG_DlCanceled)" ; Goto PatchEnd ;NoSuccess: ; MessageBox MB_OK "$(MSG_DlFailed)" ; Goto PatchEnd ;Success: ; DetailPrint "$(MSG_DlCompleted)" ;End: ; nsExec::ExecToLog '"$INSTDIR\7z.exe" e -y -o"$INSTDIR\SYUUHOU" "$EXEDIR\88pros.lzh"' ; SetOutPath "$INSTDIR\SYUUHOU" ; nsExec::ExecToLog '"$INSTDIR\unlha.exe" x "$EXEDIR\88pros.lzh"' ; SetOutPath $INSTDIR ; pop $0 ; StrCmp $0 "error" PatchEnd ; CopyFiles /SILENT "$EXEDIR\inst.zip" "$INSTDIR\SYUUHOU" ; ;INI file ;DeleteINIStr $INSTDIR\timpp32g.ini PLAYER ConfigFile ;WriteINIStr $INSTDIR\timpp32g.ini PLAYER ConfigFile "$INSTDIR\SYUUHOU\timidity.cfg" ;; compleate timidity.cfg ;Rename "$INSTDIR\SYUUHOU\timidity.cfg" "$INSTDIR\SYUUHOU\timskel.cfg" ;FileOpen $0 "$INSTDIR\SYUUHOU\timidity.cfg" "w" ;FileOpen $1 "$INSTDIR\SYUUHOU\timskel.cfg" "r" ;FileWrite $0 'dir "$INSTDIR\SYUUHOU\inst.zip#"$\r$\n' ;FileWrite $0 'dir "$INSTDIR\SYUUHOU"$\r$\n' ;ClearErrors ;LOOP: ;FileRead $1 $2 ;strcpy $3 $2 3 ;StrCmp $3 "dir" 0 +2 ;StrCpy $2 "#$2" ;FileWrite $0 $2 ;IfErrors DONE LOOP ;DONE: ;FileWrite $0 'source tune.cfg$\r$\n' ;FileWrite $0 'source adsrmod.cfg$\r$\n' ;FileClose $1 ;FileClose $0 ;PatchEnd: ;SectionEnd Section "Timidity++ Driver" SectionDriver SectionIn 1 2 ; Call GetWindowsVersion ; Pop $0 ; ClearErrors ; StrCmp $0 '95' REGDONE ; StrCmp $0 '98' REGDONE ; StrCmp $0 'ME' REGDONE IfFileExists "$INSTDIR\musix\timidity.cfg" +2 0 IfFileExists "$INSTDIR\SYUUHOU\timidity.cfg" 0 NOCFG IfFileExists "$WINDIR\timidity.cfg" 0 CFGABSENT Rename "$WINDIR\timidity.cfg" "$WINDIR\timidity.cfg.bak" CFGABSENT: IfFileExists "$INSTDIR\musix\timidity.cfg" 0 +2 CopyFiles "$INSTDIR\musix\timidity.cfg" $WINDIR IfFileExists "$INSTDIR\SYUUHOU\timidity.cfg" 0 +2 CopyFiles "$INSTDIR\SYUUHOU\timidity.cfg" $WINDIR NOCFG: ; ExecWait '"rundll32.exe" setupapi,InstallHinfSection DefaultInstall.ntx86 132 $INSTDIR\timiditydrv\timiditydrv.INF' ExecWait '"rundll32.exe" syssetup.dll,SetupInfObjectInstallAction timiditydrv.NT 132 $INSTDIR\timiditydrv\timiditydrv.INF' StrCpy $1 "0" LOOP0: IntOp $1 $1 + 1 ReadRegStr $0 HKLM "Software\Microsoft\Windows NT\CurrentVersion\Drivers32" "MIDI$1" StrCmp $0 "timiditydrv.dll" REGDONE ReadRegStr $0 HKLM "Software\Microsoft\Windows NT\CurrentVersion\Drivers32" "midi$1" StrCmp $0 "timiditydrv.dll" REGDONE StrCmp $1 "9" 0 LOOP0 StrCpy $1 "0" LOOP1: IntOp $1 $1 + 1 ClearErrors ReadRegStr $0 HKLM "Software\Microsoft\Windows NT\CurrentVersion\Drivers32" "MIDI$1" StrCmp $0 "" 0 NEXT1 ReadRegStr $0 HKLM "Software\Microsoft\Windows NT\CurrentVersion\Drivers32" "midi$1" StrCmp $0 "" 0 NEXT1 WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\Drivers32" "MIDI$1" "timiditydrv.dll" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TiMidity++\Backup" \ "MIDI" "MIDI$1" Goto REGDONE NEXT1: StrCmp $1 "9" 0 LOOP1 REGDONE: CopyFiles "$INSTDIR\portaudio.dll" $WINDIR SectionEnd Section "Windrive Configurator setwindrv" SectionSetWindrv SectionIn 1 2 SetOutPath $INSTDIR File "setwindrv.exe" File "iconv.dll" File "libglib-2.0-0.dll" File "libpangowin32-1.0-0.dll" File "intl.dll" File "libgmodule-2.0-0.dll" File "libpng13.dll" File "libatk-1.0-0.dll" File "libgobject-2.0-0.dll" File "libcairo-2.dll" File "libgtk-win32-2.0-0.dll" File "zlib1.dll" File "libgdk-win32-2.0-0.dll" File "libpango-1.0-0.dll" File "libgdk_pixbuf-2.0-0.dll" File "libpangocairo-1.0-0.dll" File "update_environ.exe" File /r etc File /r lib File /r share SectionEnd # [Shortcuts] Section "Create shortcuts in Start Menu" SectionShortcuts SectionIn 1 2 ;try to read from registry if last installation installed for All Users/Current User ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TiMidity++\Backup" \ "Shortcuts" StrCmp $0 "" cont exists cont: SetShellVarContext all MessageBox MB_YESNO "$(MSG_AllUser)" IDYES AllUsers SetShellVarContext current AllUsers: StrCpy $0 $SMPROGRAMS WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TiMidity++\Backup" \ "Shortcuts" "$0" exists: CreateDirectory "$0\TiMidity++" SetOutPath $INSTDIR CreateShortCut "$0\TiMidity++\timw32g.lnk" "$INSTDIR\timw32g.exe" CreateShortCut "$0\TiMidity++\twsyng.lnk" "$INSTDIR\twsyng.exe" CreateShortCut "$0\TiMidity++\setwindrv.lnk" "$INSTDIR\setwindrv.exe" CreateShortCut "$0\TiMidity++\License.lnk" "$INSTDIR\COPYING.txt" CreateShortCut "$0\TiMidity++\Uninstall TiMidity++.lnk" "$INSTDIR\uninstall.exe" CreateShortCut "$0\TiMidity++\driver.lnk" "$INSTDIR\timiditydrv\windrv.txt" CreateShortCut "$0\TiMidity++\driver_jp.lnk" "$INSTDIR\timiditydrv\windrv_ja.txt" SectionEnd Section "Create Quick Launch shortcut" SectionQuickLaunch SectionIn 1 2 SetShellVarContext current CreateShortCut "$QUICKLAUNCH\tim32g.lnk" "$INSTDIR\timw32g.exe" CreateShortCut "$QUICKLAUNCH\twsyng.lnk" "$INSTDIR\twsyng.exe" CreateShortCut "$QUICKLAUNCH\setwindrv.lnk" "$INSTDIR\setwindrv.exe" SectionEnd # [Registry] Section "Set environment variable for config editor" SectionIn 1 2 ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TiMidity++\Backup" \ "Registry" StrCmp $0 "" cont exists cont: StrCpy $0 $SMPROGRAMS WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TiMidity++\Backup" \ "Registry" "$0" exists: ReadRegStr $0 HKLM "System\CurrentControlSet\Control\Session Manager\Environment" \ "TIMIDITY_CFG_EDITOR" StrCmp $0 "" ccont eexists ccont: WriteRegStr HKLM "System\CurrentControlSet\Control\Session Manager\Environment" \ "TIMIDITY_CFG_EDITOR" "setwindrv" nsExec::ExecToLog '"update_environ.exe"' eexists: SectionEnd ;-------------------------------- # [Sections' descriptions (on mouse over)] !ifdef NEW_INTERFACE LangString DESC_SectionMain ${LANG_ENGLISH} "The TiMdity++" LangString DESC_SectionMain ${LANG_JAPANESE} "TiMdity++–{‘Ì" LangString DESC_SectionOptinaldlls ${LANG_ENGLISH} "Optional dlls for TiMidity++(not GPL). This package is not include gogo.dll and pa_asio.dll." LangString DESC_SectionOptinaldlls ${LANG_JAPANESE} "gogo.dll pa_asio.dllˆÈŠO‚̒ljÁ DLL(”ñ GPL)" ; LangString DESC_SectionGOGOdll ${LANG_ENGLISH} "Downlod gogo.dll. $\nIt is equied for mp3 conversion. (LGPL)" ; LangString DESC_SectionGOGOdll ${LANG_JAPANESE} "gogo.dll‚̃_ƒEƒ“ƒ[ƒh $\nmp3‚ւ̕ϊ·‚É•K—v(LGPL)" LangString DESC_SectionMusix ${LANG_ENGLISH} "Sound Set 1 $\nFrom Musix GNU+Linux(GPL2 see musix/COPYING)$\nhttp://www.musix.org.ar/" LangString DESC_SectionMusix ${LANG_JAPANESE} "‰¹FƒZƒbƒg1 $\nFrom Musix GNU+Linux(GPL2, musix/COPYINGŽQÆ)$\nhttp://www.musix.org.ar/" ; LangString DESC_SectionFreepats ${LANG_ENGLISH} "Sound Set 1 $\nfreepats-20060219(modified GPL see freepats/COPYING)" ; LangString DESC_SectionFreepats ${LANG_JAPANESE} "‰¹FƒZƒbƒg1 $\nfreepats-20060219(GPL€‹’, freepats/COPYINGŽQÆ)" ; LangString DESC_SectionEAWPatch ${LANG_ENGLISH} "Sound Set 1 $\nEAWpatch(not GPL, non-commercial use only)" ; LangString DESC_SectionEAWPatch ${LANG_JAPANESE} "‰¹FƒZƒbƒg1 $\nEAWƒpƒbƒ`(”ñGPL, ”ñ¤—p)" ; LangString DESC_SectionPatch ${LANG_ENGLISH} "Sound set 2 $\nS-densh's SYUUHOU 30 MB patch(not GPL, non-commercial use only)$\nhttp://syuuhou.hp.infoseek$\n.co.jp/timidity/" ; LangString DESC_SectionPatch ${LANG_JAPANESE} "‰¹FƒZƒbƒg2 $\nS-“dŽq‚Ì SYUUHOU 30 MB ƒpƒbƒ`(”ñGPL, ”ñ¤—p)$\nhttp://syuuhou.hp.infoseek$\n.co.jp/timidity/" LangString DESC_SectionShortcuts ${LANG_ENGLISH} "Create a 'TiMidity++' program group with shortcuts, in the start menu" LangString DESC_SectionShortcuts ${LANG_JAPANESE} "ƒXƒ^[ƒgƒƒjƒ…[‚ÉTiMidity++‚̃Oƒ‹[ƒv‚ƃVƒ‡[ƒgƒJƒbƒg‚ð“o˜^" LangString DESC_SectionQuickLaunch ${LANG_ENGLISH} "Create a shortcut to TiMidity++ in the QuickLaunch toolbar" LangString DESC_SectionQuickLaunch ${LANG_JAPANESE} "ƒNƒCƒbƒNƒ‰ƒ“ƒ`‚ÉTiMidity++‚̃Vƒ‡[ƒgƒJƒbƒg‚ð“o˜^" LangString DESC_SectionDriver ${LANG_ENGLISH} "Install TiMidity++ Driver for XP 2000 (rebooting requied)" LangString DESC_SectionDriver ${LANG_JAPANESE} "Windows2000‚Ü‚½‚ÍXP‚Å‘¼‚̃\ƒtƒg‚©‚çTiMidity++‰¹Œ¹‚ðŽg‚¦‚邿‚¤‚É‚·‚éB \ TiMidity++ Driver‚̃Cƒ“ƒXƒg[ƒ‹(—v Ä‹N“®j" LangString DESC_SectionSetWindrv ${LANG_ENGLISH} "TiMidity++ Driver configurator(setwindrv) suppor for writing timidity.cfg" LangString DESC_SectionSetWindrv ${LANG_JAPANESE} "TiMidity++ ƒhƒ‰ƒCƒo[Ý’èƒc[ƒ‹(setwindrv) timidity.cfg‚Ì쬗p" !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${SectionMain} $(DESC_SectionMain) !insertmacro MUI_DESCRIPTION_TEXT ${SectionOptinaldlls} $(DESC_SectionOptinaldlls) ; !insertmacro MUI_DESCRIPTION_TEXT ${SectionGOGOdll} $(DESC_SectionGOGOdll) !insertmacro MUI_DESCRIPTION_TEXT ${SectionMusix} $(DESC_SectionMusix) ; !insertmacro MUI_DESCRIPTION_TEXT ${SectionFreepats} $(DESC_SectionFreepats) ; !insertmacro MUI_DESCRIPTION_TEXT ${SectionEAWPatch} $(DESC_SectionEAWPatch) ; !insertmacro MUI_DESCRIPTION_TEXT ${SectionPatch} $(DESC_SectionPatch) !insertmacro MUI_DESCRIPTION_TEXT ${SectionShortcuts} $(DESC_SectionShortcuts) !insertmacro MUI_DESCRIPTION_TEXT ${SectionQuickLaunch} $(DESC_SectionQuickLaunch) !insertmacro MUI_DESCRIPTION_TEXT ${SectionDriver} $(DESC_SectionDriver) !insertmacro MUI_DESCRIPTION_TEXT ${SectionSetWindrv} $(DESC_SectionSetWindrv) !insertmacro MUI_FUNCTION_DESCRIPTION_END !endif ;NEW_INTERFACE ;-------------------------------- ; Functions LangString MSG_Welcome ${LANG_ENGLISH} "Welcome to TiMidity++ install program." LangString MSG_Welcome ${LANG_JAPANESE} "TiMidity++ƒCƒ“ƒXƒg[ƒ‰[‚ւ悤‚±‚»" LangString MSG_AbortInstall ${LANG_ENGLISH} "Abort install?" LangString MSG_AbortInstall ${LANG_JAPANESE} "ƒCƒ“ƒXƒg[ƒ‹‚ðŽæ‚è‚â‚߂܂·‚©" LangString MSG_StartTim ${LANG_ENGLISH} "Do you want to run TiMidity++ now?" LangString MSG_StartTim ${LANG_JAPANESE} "TiMidity++‚ð¡‹N“®‚µ‚Ü‚·‚©H" Function .onInit MessageBox MB_OK "$(MSG_Welcome)" !insertmacro MUI_LANGDLL_DISPLAY FunctionEnd !ifndef NEW_INTERFACE ;called when the user hits the 'cancel' button Function .onUserAbort MessageBox MB_YESNO "$(MSG_AbortInstall)" IDYES NoCancelAbort Abort NoCancelAbort: FunctionEnd called when the install was successful Function .onInstSuccess MessageBox MB_YESNO "$(MSG_StartTim)" IDNO DontRun Exec '$INSTDIR\timw32g.exe' DontRun: FunctionEnd !endif ;!NEW_INTERFACE ;;http://nsis.sourceforge.net/archive/nsisweb.php?page=628&instances=0,11,122 ; LangString MSG_IrLetter ${LANG_ENGLISH} "Installation directory cannot contain: '$R0'. Only letters, numbers and ':-_\' are allowed." ; LangString MSG_IrLetter ${LANG_JAPANESE} "ƒCƒ“ƒXƒg[ƒ‹ƒfƒBƒŒƒNƒgƒŠ‚É '$R0' ‚ªŠÜ‚Ü‚ê‚Ä‚¢‚Ü‚·B‰p”Žš‚Æ':-_\ 'ˆÈŠO‚ÍŽg‚¦‚Ü‚¹‚ñB" ; LangString MSG_IvInstDirectory ${LANG_ENGLISH} "invalid installation directory!" ; LangString MSG_IvInstDirectory ${LANG_JAPANESE} "ƒCƒ“ƒXƒg[ƒ‹ƒfƒBƒŒƒNƒgƒŠ‚ªŠÔˆá‚Á‚Ă܂·" ; LangString MSG_NotEnoughSpace ${LANG_ENGLISH} "not enough free space!" ; LangString MSG_NotEnoughSpace ${LANG_JAPANESE} "ƒfƒBƒXƒN—̈悪‘«‚è‚Ü‚¹‚ñ" ;Function StrCSpnReverse ; Exch $R0 ; string to check ; Exch ; Exch $R1 ; string of chars ; Push $R2 ; current char ; Push $R3 ; current char ; Push $R4 ; char loop ; Push $R5 ; char loop ; ; StrCpy $R4 -1 ; ; NextCharCheck: ; StrCpy $R2 $R0 1 $R4 ; IntOp $R4 $R4 - 1 ; StrCmp $R2 "" StrOK ; ; StrCpy $R5 -1 ; ; NextChar: ; StrCpy $R3 $R1 1 $R5 ; IntOp $R5 $R5 - 1 ; StrCmp $R3 "" +2 ; StrCmp $R3 $R2 NextCharCheck NextChar ; StrCpy $R0 $R2 ; Goto Done ; ; StrOK: ; StrCpy $R0 "" ; ; Done: ; ; Pop $R5 ; Pop $R4 ; Pop $R3 ; Pop $R2 ; Pop $R1 ; Exch $R0 ;FunctionEnd #Verify the installation directory ;Function dirLeave ; Push "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz:-_\ " ; Push $INSTDIR ; Call StrCSpnReverse ; Pop $R0 ; StrCmp $R0 "" +3 ; MessageBox MB_OK|MB_ICONEXCLAMATION "$(MSG_IrLetter)" ; Abort ; ; GetInstDirError $0 ; ${Switch} $0 ; ${Case} 1 ; MessageBox MB_OK "$(MSG_IvInstDirectory)" ; Abort ; ${Break} ; ${Case} 2 ; MessageBox MB_OK "$(MSG_NotEnoughSpace)" ; Abort ; ${Break} ; ${EndSwitch} ; ; ;FunctionEnd ; GetWindowsVersion ; ; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/ ; Updated by Joost Verburg ; ; Returns on top of stack ; ; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003) ; or ; '' (Unknown Windows Version) ; ; Usage: ; Call GetWindowsVersion ; Pop $R0 ; ; at this point $R0 is "NT 4.0" or whatnot ; Function GetWindowsVersion ; ; Push $R0 ; Push $R1 ; ; ClearErrors ; ; ReadRegStr $R0 HKLM \ ; "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion ; ; IfErrors 0 lbl_winnt ; ; ; we are not NT ; ReadRegStr $R0 HKLM \ ; "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber ; ; StrCpy $R1 $R0 1 ; StrCmp $R1 '4' 0 lbl_error ; ; StrCpy $R1 $R0 3 ; ; StrCmp $R1 '4.0' lbl_win32_95 ; StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98 ; ; lbl_win32_95: ; StrCpy $R0 '95' ; Goto lbl_done ; ; lbl_win32_98: ; StrCpy $R0 '98' ; Goto lbl_done ; ; lbl_win32_ME: ; StrCpy $R0 'ME' ; Goto lbl_done ; ; lbl_winnt: ; ; StrCpy $R1 $R0 1 ; ; StrCmp $R1 '3' lbl_winnt_x ; StrCmp $R1 '4' lbl_winnt_x ; ; StrCpy $R1 $R0 3 ; ; StrCmp $R1 '5.0' lbl_winnt_2000 ; StrCmp $R1 '5.1' lbl_winnt_XP ; StrCmp $R1 '5.2' lbl_winnt_2003 lbl_error ; ; lbl_winnt_x: ; StrCpy $R0 "NT $R0" 6 ; Goto lbl_done ; ; lbl_winnt_2000: ; Strcpy $R0 '2000' ; Goto lbl_done ; ; lbl_winnt_XP: ; Strcpy $R0 'XP' ; Goto lbl_done ; ; lbl_winnt_2003: ; Strcpy $R0 '2003' ; Goto lbl_done ; ; lbl_error: ; Strcpy $R0 '' ; lbl_done: ; ; Pop $R1 ; Exch $R0 ; ; FunctionEnd ;-------------------------------- LangString MSG_FinishUninstall ${LANG_ENGLISH} "TiMidity++ has been uninstalled. Please now delete the $INSTDIR directory if it doesn't contain some of your documents" LangString MSG_FinishUninstall ${LANG_JAPANESE} "TiMidity++ ‚̃Aƒ“ƒCƒ“ƒXƒg[ƒ‹‚ªI—¹‚µ‚Ü‚µ‚½B $INSTDIR ‚Ƀtƒ@ƒCƒ‹‚ªŽc‚Á‚Ä‚éꇂ͎蓮‚Å휂µ‚Ä‚­‚¾‚³‚¢" # [UnInstallation] UninstallText "This program will uninstall TiMidity++, continue ?" ShowUninstDetails show Section "Uninstall" ;RemoveDirver ; ExecWait '"rundll32.exe" setupapi,InstallHinfSection timiditydrvUninstall.NT 132 $INSTDIR\timiditydrv\timiditydrv.INF' ExecWait '"rundll32.exe" syssetup.dll,SetupInfObjectInstallAction timiditydrvUninstall.NT 132 $INSTDIR\timiditydrv\timiditydrv.INF' ClearErrors ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TiMidity++\Backup" \ "MIDI" IfErrors REGDONE DeleteRegValue HKLM "Software\Microsoft\Windows NT\CurrentVersion\Drivers32" $0 Delete /REBOOTOK "$SYSDIR\timiditydrv.dll" Delete /REBOOTOK "$WINDIR\portaudio.dll" Delete "$WINDIR\timidity.cfg" REGDONE: ;Remove Environmet variable ClearErrors ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TiMidity++\Backup" \ "Registry" IfErrors RREGDONE DeleteRegValue HKLM "System\CurrentControlSet\Control\Session Manager\Environment" \ "TIMIDITY_CFG_EDITOR" nsExec::ExecToLog '"$INSTDIR\update_environ.exe"' RREGDONE: Delete "$INSTDIR\COPYING.txt" Delete "$INSTDIR\README.ja.txt" Delete "$INSTDIR\README.txt" Delete "$INSTDIR\SETUP.ja.txt" Delete "$INSTDIR\SETUP.txt" Delete "$INSTDIR\timw32g.exe" Delete "$INSTDIR\twsyng.exe" Delete "$INSTDIR\twsynsrv.exe" Delete "$INSTDIR\timidity.exe" Delete "$INSTDIR\twsynth.bat" Delete "$INSTDIR\timpp32g.ini" Delete "$INSTDIR\timidity_output.ini" Delete "$INSTDIR\timidity_window.ini" ; Delete "$INSTDIR\7z.exe" ; Delete "$INSTDIR\tar.exe" ; Delete "$INSTDIR\tar32.dll" Delete "$INSTDIR\unzip.exe" Delete "$INSTDIR\unzip32.dll" Delete "$INSTDIR\unlha.exe" Delete "$INSTDIR\UNLHA32.DLL" Delete "$INSTDIR\portaudio.dl" ; Delete "$INSTDIR\gogo.dll" Delete "$INSTDIR\portaudio.dll" Delete "$INSTDIR\pdcurses.dll" Delete "$INSTDIR\vorbis.dll" Delete "$INSTDIR\libFLAC.dll" Delete "$INSTDIR\vorbisenc.dll" Delete "$INSTDIR\libOggFLAC.dll" ; Delete "$INSTDIR\mingwm10.dll" ; Delete "$INSTDIR\pa_asio.dll" Delete "$INSTDIR\ogg.dll" Delete "$INSTDIR\setwindrv.exe" Delete "$INSTDIR\iconv.dll" Delete "$INSTDIR\libglib-2.0-0.dll" Delete "$INSTDIR\libpangowin32-1.0-0.dll" Delete "$INSTDIR\intl.dll" Delete "$INSTDIR\libgmodule-2.0-0.dll" Delete "$INSTDIR\libpng13.dll" Delete "$INSTDIR\libatk-1.0-0.dll" Delete "$INSTDIR\libgobject-2.0-0.dll" Delete "$INSTDIR\libcairo-2.dll" Delete "$INSTDIR\libgtk-win32-2.0-0.dll" Delete "$INSTDIR\zlib1.dll" Delete "$INSTDIR\libgdk-win32-2.0-0.dll" Delete "$INSTDIR\libpango-1.0-0.dll" Delete "$INSTDIR\libgdk_pixbuf-2.0-0.dll" Delete "$INSTDIR\libpangocairo-1.0-0.dll" Delete "$INSTDIR\update_environ.exe" RMDir /r "$INSTDIR\etc" RMDir /r "$INSTDIR\lib" RMDir /r "$INSTDIR\share" RMDir /r "$INSTDIR\musix" ; RMDir /r "$INSTDIR\freepats" RMDir /r "$INSTDIR\SYUUHOU" ; RMDir /r "$INSTDIR\Eawpatches" RMDir /r "$INSTDIR\timiditydrv" ; Remove files and uninstaller Delete "$INSTDIR\uninstall.exe" RMDir "$INSTDIR" ; Remove icons ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TiMidity++\Backup" \ "Shortcuts" Delete "$0\TiMidity++\timw32g.lnk" Delete "$0\TiMidity++\twsyng.lnk" Delete "$0\TiMidity++\setwindrv.lnk" Delete "$0\TiMidity++\License.lnk" Delete "$0\TiMidity++\driver.lnk" Delete "$0\TiMidity++\driver_jp.lnk" Delete "$0\TiMidity++\Uninstall TiMidity++.lnk" RMDir "$0\TiMidity++" SetShellVarContext current Delete "$QUICKLAUNCH\timw32g.lnk" Delete "$QUICKLAUNCH\twsyng.lnk" Delete "$QUICKLAUNCH\setwindrv.lnk" ; Remove registry keys DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TiMidity++" DeleteRegKey HKLM SOFTWARE\TiMidity++ MessageBox MB_OK "$(MSG_FinishUninstall)" SectionEnd #eof! PK ‰VŸ5Hu€k€k  ¶timw32.nsiSD\UTÒ—EPKI l