-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathINS.NSI
More file actions
97 lines (78 loc) · 3.09 KB
/
INS.NSI
File metadata and controls
97 lines (78 loc) · 3.09 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
; ----------------------------------------------------------------
Name "ALVIS - Allegro Visualization Plugin"
Caption "ALVIS - Allegro Visualization Plugin"
OutFile "alvis.exe"
; ----------------------------------------------------------------
InstallDir $PROGRAMFILES\Winamp
InstallDirRegKey HKEY_LOCAL_MACHINE \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp" \
"UninstallString"
DirText "The installer has determined that this is the path to Winamp. If it is not correct, please change (You will not be able to proceed until a valid path is found)."
Function QueryWinampVisPath ; sets $1 with vis path
StrCpy $1 $INSTDIR\Plugins
ReadINIStr $9 $INSTDIR\winamp.ini Winamp VisDir
StrCmp $9 "" End
IfFileExists $9 0 End
StrCpy $1 $9 ; update dir
End:
FunctionEnd
Function .onVerifyInstDir
IfFileExists $INSTDIR\Winamp.exe NoAbort
Abort
NoAbort:
FunctionEnd
; The stuff to install
Section ""
; this function sets $1 to point to the 'winamp\plugins' folder:
; (see function definition above)
Call QueryWinampVisPath
; ----------------------------------------------------------------
; Set the current output path (the folder to which files will be
; decompressed) to '$1', which is the path to the winamp plugins
; folder.
SetOutPath $1
; Now list all the files you want to go into that folder on the
; user's computer. Use local paths to point to the files;
; these paths will not be preserved for the decompression.
File "src\vis_alvis.dll"
File "support\boom.bmp"
File "support\alvis.htm"
File "support\alvis.css"
; ----------------------------------------------------------------
; ----------------------------------------------------------------
; Note: If you want to create a subdirectory called 'XYZ' underneath
; the winamp plugins directory, to store more files for your plugin,
; you would do something like this:
; SetOutPath $1\XYZ
; File "C:\Program Files\winamp\plugins\XYZ\*.*"
; ----------------------------------------------------------------
;Create uninstaller
WriteUninstaller "$INSTDIR\PLUGINS\Uninstall ALVIS.exe"
SectionEnd
Function .onInstSuccess
ExecShell "open" '"$INSTDIR\PLUGINS\alvis.htm"'
FindWindow $R0 "winamp v1.x"
StrCmp $R0 0 "" NoOpen2
MessageBox MB_YESNO|MB_ICONQUESTION \
"The plugin was installed successfully. Would you like to run Winamp now with this plugin set as the default plug-in?" \
IDNO End
WriteINIStr "$INSTDIR\Winamp.ini" "Winamp" "visplugin_name" "vis_alvis.dll"
WriteINIStr "$INSTDIR\Winamp.ini" "Winamp" "visplugin_num" "0"
Exec '"$INSTDIR\Winamp.exe"'
Goto end
NoOpen2:
MessageBox MB_OK "The plugin was successfully installed. Press CTRL+P while in Winamp to select, configure, and run it."
End:
FunctionEnd
;--------------------------------
;Uninstaller Section
Section "Uninstall"
;ADD YOUR OWN STUFF HERE!
Delete "$INSTDIR\vis_alvis.dll"
Delete "$INSTDIR\boom.bmp"
Delete "$INSTDIR\alvis.ini"
Delete "$INSTDIR\alvis.htm"
Delete "$INSTDIR\alvis.css"
Delete "$INSTDIR\Uninstall ALVIS.exe"
SectionEnd
; eof