wasections.nsh 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. !include "FileFunc.nsh"
  2. !include ".\sectionsHelper.nsh"
  3. Section -SetWinampFolders
  4. ${If} ${Silent}
  5. Call SetupWinampDirectories
  6. ${EndIf}
  7. SectionEnd
  8. Section -KillWA
  9. ${If} ${FileExists} "$INSTDIR\${WINAMPEXE}"
  10. StrCpy $FIRSTINSTALL "0"
  11. ${Else}
  12. StrCpy $FIRSTINSTALL "1"
  13. ${EndIf}
  14. ${If} ${FileExists} "$WINAMPM3U"
  15. StrCpy $needplaystart "0"
  16. ${Else}
  17. StrCpy $needplaystart "1"
  18. ${EndIf}
  19. DetailPrint $(IDS_RUN_CHECK_PROCESS)
  20. SetDetailsPrint none
  21. ${Do}
  22. ClearErrors
  23. Delete "$INSTDIR\${WINAMPEXE}"
  24. ${If} ${Errors}
  25. SetErrors
  26. IfSilent done
  27. MessageBox MB_DEFBUTTON2|MB_ABORTRETRYIGNORE $(msgCloseWinamp) IDABORT done IDRETRY +2
  28. ClearErrors
  29. ${EndIf}
  30. ${LoopWhile} ${Errors}
  31. StrCpy $1 0
  32. ${Do}
  33. ClearErrors
  34. Delete "$INSTDIR\winampa.exe"
  35. ${If} ${Errors}
  36. SetErrors
  37. FindWindow $0 "WinampAgentMain"
  38. ${If} $0 = 0 ; something bad or other session
  39. IfSilent done
  40. MessageBox MB_DEFBUTTON2|MB_ABORTRETRYIGNORE $(IDS_MSG_AGENTONOTHERSESSION) IDABORT done IDRETRY +2
  41. ClearErrors
  42. ${Else}
  43. IntOp $1 $1 + 1
  44. IntCmp $1 40 done
  45. SendMessage $0 ${WM_CLOSE} 0 0 /TIMEOUT=2000
  46. Sleep 250
  47. IsWindow $0 0 agentwnd_killed
  48. SendMessage $0 ${WM_DESTROY} 0 0 /TIMEOUT=2000
  49. Sleep 250
  50. agentwnd_killed:
  51. ${EndIf}
  52. ${EndIf}
  53. ${LoopWhile} ${Errors}
  54. done:
  55. SetDetailsPrint lastused
  56. ${If} ${Errors}
  57. Abort $(msgInstallAborted)
  58. ${EndIf}
  59. ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "WinampAgent"
  60. ${If} $0 == "$INSTDIR\winampa.exe"
  61. StrCpy $RESTARTAGENT "1"
  62. DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "WinampAgent"
  63. ${Else}
  64. StrCpy $RESTARTAGENT "0"
  65. ${EndIf}
  66. SectionEnd
  67. Section -HiddenPathINI
  68. CreateDirectory $INSTDIR
  69. ${If} $SETTINGSDIR != $INSTDIR
  70. CreateDirectory $SETTINGSDIR
  71. Call GetWinampFolder
  72. Pop $0
  73. SetShellVarContext current
  74. StrCpy $1 "$APPDATA\$0"
  75. ${If} $SETTINGSDIR == $1
  76. WriteINIStr "$INSTDIR\paths.ini" "Winamp" "inidir" "{26}\$0"
  77. ${Else}
  78. WriteINIStr "$INSTDIR\paths.ini" "Winamp" "inidir" "$SETTINGSDIR"
  79. ${EndIf}
  80. ${EndIf}
  81. SectionEnd
  82. !include ".\sections\winamp.nsh"
  83. !ifndef WINAMP64
  84. Section -HiddenFeedback
  85. SetOutPath "$INSTDIR\Plugins"
  86. Delete "$INSTDIR\Plugins\gen_talkback.dll"
  87. File /nonfatal "${FILES_PATH}\Plugins\gen_crasher.dll"
  88. Delete "$INSTDIR\Plugins\reporter.exe"
  89. Delete "$INSTDIR\Plugins\tbsetup.exe"
  90. SetOutPath "$INSTDIR"
  91. File /nonfatal "${FILES_PATH}\reporter.exe"
  92. SectionEnd
  93. !endif ; WINAMP64
  94. !ifndef WINAMP64
  95. ${WinampSection} "winampAgent" $(compAgent) IDX_SEC_AGENT
  96. ${SECTIONIN_LITE}
  97. SetOutPath $INSTDIR
  98. File "${FILES_PATH}\winampa.exe"
  99. ${If} $RESTARTAGENT == "1"
  100. WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "WinampAgent" "$INSTDIR\winampa.exe"
  101. ${EndIf}
  102. Var /GLOBAL WINAMP_SECTION_NAME_4
  103. StrCpy $WINAMP_SECTION_NAME_4 "winampAgent"
  104. ${WinampSectionEnd}
  105. !endif ; WINAMP64
  106. !include ".\sections\frenchRadio.nsh"
  107. !include ".\sections\grp_mmedia.nsh"
  108. !include ".\sections\grp_walib.nsh"
  109. !include ".\sections\grp_uiext.nsh"
  110. !include ".\sections\grp_vis.nsh"
  111. !include ".\sections\extra.nsh"
  112. !include ".\sections\wmfdist.nsh"
  113. !include ".\sections\directX.nsh"
  114. ${DIRECTXINSTALL_INSERT_SECTION}
  115. !insertmacro GetTime
  116. Section "-end" IDX_SECTION_END
  117. SetDetailsPrint textonly
  118. ${If} ${FileExists} "$INSTDIR\Plugins\gen_peercast.dll"
  119. GetDLLVersion "$INSTDIR\Plugins\gen_peercast.dll" $0 $1
  120. ${If} $0 == ""
  121. MessageBox MB_YESNO "Peercast plug-in detected. The old version of this plug-in$\r$\nmay cause problems. Hit Yes to remove this plug-in (recommended)." /SD IDYES IDNO +2
  122. Delete "$INSTDIR\Plugins\gen_peercast.dll"
  123. ${EndIf}
  124. ${EndIf}
  125. Delete "$INSTDIR\Plugins\gen_nomad.dll" ; ha ha fuck off creative
  126. Delete "$INSTDIR\Plugins\in_mp3pro.dll" ; mp3 pro plugin is BUGGGGGY
  127. Delete "$INSTDIR\Plugins\gen_diebrowserdie.dll" ; DrO's deprecated StationInfo window killer
  128. Delete "$INSTDIR\Plugins\ml_lite_n.dll" ; deprecated essential pack plugin
  129. Delete "$INSTDIR\Plugins\gen_nopro.dll" ; deprecated essential pack plugin
  130. Delete "$INSTDIR\Plugins\gen_killpredixis.dll" ; deprecated essential pack plugin
  131. Delete "$INSTDIR\Plugins\gen_b4s2m3u.dll" ; DrO's deprecated PlaylistLoader plugin
  132. ; Delete "$INSTDIR\Plugins\gen_skinmanager.dll" ; placeholder for old essential pack plugin
  133. ; Delete "$INSTDIR\Plugins\gen_timerestore.dll" ; placeholder for old essential pack plugin
  134. ; Delete "$INSTDIR\Plugins\gen_undo.dll" ; placeholder for old essential pack plugin
  135. DeleteRegKey HKCR .wpz
  136. DeleteRegKey HKCR aip_file
  137. DeleteINIStr "$WINAMPINI" "Winamp" "mb_open"
  138. DeleteINIStr "$WINAMPINI" "Winamp" "last_shortdesc"
  139. DeleteINIStr "$WINAMPINI" "Winamp" "last_shorturl"
  140. WriteINIStr "$WINAMPINI" "Winamp" "mw_open" "1"
  141. ReadINIStr $R0 "$WINAMPINI" "Winamp" "outname"
  142. ${If} $R0 == ""
  143. ${If} ${FileExists} "$INSTDIR\Plugins\out_ds.dll"
  144. WriteINIStr "$WINAMPINI" "Winamp" "outname" "out_ds.dll"
  145. ${Else}
  146. ${If} ${FileExists} "$INSTDIR\Plugins\out_wave.dll"
  147. WriteINIStr "$WINAMPINI" "Winamp" "outname" "out_wave.dll"
  148. ${EndIf}
  149. ${EndIf}
  150. ${EndIf}
  151. Call StartMenu_WriteData
  152. WriteUninstaller "$INSTDIR\UninstWA.exe"
  153. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${WINAMP}" "DisplayName" "${WINAMP}"
  154. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${WINAMP}" "DisplayIcon" "$INSTDIR\${WINAMPEXE},0"
  155. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${WINAMP}" "InstallLocation" "$INSTDIR"
  156. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${WINAMP}" "UninstallString" '"$INSTDIR\UninstWA.exe"'
  157. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${WINAMP}" "HelpLink" "http://forums.winamp.com"
  158. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${WINAMP}" "URLInfoAbout" "http://www.winamp.com/"
  159. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${WINAMP}" "URLUpdateInfo" "http://www.winamp.com/"
  160. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${WINAMP}" "Publisher" "Winamp SA"
  161. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${WINAMP}" "DisplayVersion" "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MINOR_SECOND}"
  162. ; WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${WINAMP}" "DisplayVersion" "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MINOR_SECOND} ${InstallType}"
  163. WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${WINAMP}" "NoModify" 1
  164. WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${WINAMP}" "NoRepair" 1
  165. WriteRegStr HKCU "Software\${WINAMP}" "" "$INSTDIR"
  166. ; Add to App Paths for: Start -> Run -> Winamp
  167. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\${WINAMPEXE}" "" "$INSTDIR\${WINAMPEXE}"
  168. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\${WINAMPEXE}" "Path" "$INSTDIR"
  169. WriteINIStr "$INSTINI" "installer" "build" "${VERSION_SUFFIX}"
  170. ${GetTime} "" "LS" $0 $1 $2 $3 $4 $5 $6
  171. WriteINIStr "$INSTINI" "installer" "date" "$1/$0/$2 $4:$5:$6"
  172. WriteINIStr "$WINAMPINI" "WinampReg" "IsFirstInst" $FIRSTINSTALL
  173. WriteINIStr "$WINAMPINI" "WinampReg" "NeedReg" "1"
  174. ${If} $needplaystart <> 0
  175. WriteINIStr "$WINAMPINI" "SETUP" "WAParam" "$WINAMPM3U"
  176. ${Else}
  177. DeleteINIStr "$WINAMPINI" "SETUP" "WAParam"
  178. ${EndIf}
  179. SectionEnd