aboutsummaryrefslogtreecommitdiff
path: root/Src/Plugins/Input/in_cdda/inst.nsi
blob: 4354a24706c0594bde71522a6311705f457b9c5e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Name "CDDB2 test, beta 1"

; The file to write
OutFile "cddb2.exe"

InstallDir $PROGRAMFILES\Winamp
InstallDirRegKey HKLM \
                 "Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp" \
                 "UninstallString"

; The text to prompt the user to enter a directory
DirText "Please select your Winamp path below (you will be able to proceed when Winamp is detected):"
DirShow hide

; automatically close the installer when done.
AutoCloseWindow true
; hide the "show details" box
ShowInstDetails nevershow

BGGradient 000000 308030 FFFFFF
InstallColors FF8080 000000
InstProgressFlags smooth colored

Function .onInit
  MessageBox MB_YESNO|MB_ICONQUESTION "Install CDDB2 update test?" IDYES update
   MessageBox MB_OK|MB_ICONINFORMATION "Install aborted."
   Abort
  update:
FunctionEnd

Function .onVerifyInstDir
  IfFileExists $INSTDIR\Winamp.exe Good
    Abort
  Good:
FunctionEnd

Function CloseWinamp
  Push $0
  loop:
    FindWindow $0 "Winamp v1.x"
    IntCmp $0 0 done
     SendMessage $0 16 0 0
     StrCpy $9 "yes"
     Sleep 100
     Goto loop
  done:
  Pop $0
FunctionEnd


Section "ThisNameIsIgnoredSoWhyBother?"
  StrCpy $9 "no"
  Call CloseWinamp
  SetOutPath $INSTDIR
  File "C:\program files\winamp\winamp.exe"
  SetOutPath $INSTDIR\Plugins

  UnRegDll $OUTDIR\cddbcontrolwinamp.dll
  UnRegDll $OUTDIR\cddbuiwinamp.dll
  File "C:\program files\winamp\plugins\in_cdda.dll"
  File "C:\program files\winamp\plugins\in_mp3.dll"
  File "cddbcontrolwinamp.dll"
  File "cddbuiwinamp.dll"
  RegDll $OUTDIR\cddbcontrolwinamp.dll
  RegDll $OUTDIR\cddbuiwinamp.dll

  DetailPrint Completed.
SectionEnd


Function .onInstSuccess
  MessageBox MB_OK|MB_ICONINFORMATION "Update installed."
  StrCmp $9 "no" nope
    Exec '"$INSTDIR\Winamp.exe"'
  nope:
FunctionEnd

; eof