1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
\r
2 ; NSIS installer script for vlc ;
\r
3 ; (http://nsis.sourceforge.net) ;
\r
4 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
\r
6 !define PRODUCT_NAME "VLC media player"
\r
7 !define PRODUCT_VERSION '${VERSION}'
\r
8 !define PRODUCT_GROUP "VideoLAN"
\r
9 !define PRODUCT_PUBLISHER "VideoLAN Team"
\r
10 !define PRODUCT_WEB_SITE "http://www.videolan.org"
\r
11 !define PRODUCT_DIR_REGKEY "Software\VideoLAN\VLC"
\r
12 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
\r
13 !define PRODUCT_UNINST_ROOT_KEY "HKLM"
\r
14 !define PRODUCT_ID "{ea92ef52-afe4-4212-bacb-dfe9fca94cd6}"
\r
16 ;;;;;;;;;;;;;;;;;;;;;;;;;
\r
17 ; General configuration ;
\r
18 ;;;;;;;;;;;;;;;;;;;;;;;;;
\r
20 Name "${PRODUCT_GROUP} ${PRODUCT_NAME} ${PRODUCT_VERSION}"
\r
21 OutFile ..\vlc-${VERSION}-win32.exe
\r
22 InstallDir "$PROGRAMFILES\VideoLAN\VLC"
\r
23 InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "Install_Dir"
\r
25 ShowInstDetails show
\r
26 ShowUnInstDetails show
\r
27 SetOverwrite ifnewer
\r
33 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
\r
34 ; NSIS Modern User Interface configuration ;
\r
35 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
\r
37 ; MUI 1.67 compatible ------
\r
41 !define MUI_ABORTWARNING
\r
42 !define MUI_ICON "vlc48x48new.ico"
\r
43 !define MUI_UNICON "vlc48x48new.ico"
\r
44 !define MUI_COMPONENTSPAGE_SMALLDESC
\r
47 !insertmacro MUI_PAGE_WELCOME
\r
49 !insertmacro MUI_PAGE_LICENSE "COPYING.txt"
\r
51 !insertmacro MUI_PAGE_COMPONENTS
\r
53 !insertmacro MUI_PAGE_DIRECTORY
\r
55 !insertmacro MUI_PAGE_INSTFILES
\r
57 !define MUI_FINISHPAGE_RUN "$INSTDIR\vlc.exe"
\r
58 !define MUI_FINISHPAGE_NOREBOOTSUPPORT
\r
59 !insertmacro MUI_PAGE_FINISH
\r
62 !insertmacro MUI_UNPAGE_INSTFILES
\r
65 !insertmacro MUI_LANGUAGE "English"
\r
68 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
\r
73 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
\r
74 ; Push extensions on stack ;
\r
75 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
\r
76 !macro MacroAudioExtensions _action
\r
77 !insertmacro ${_action} ".a52"
\r
78 !insertmacro ${_action} ".aac"
\r
79 !insertmacro ${_action} ".ac3"
\r
80 !insertmacro ${_action} ".dts"
\r
81 !insertmacro ${_action} ".flac"
\r
82 !insertmacro ${_action} ".mka"
\r
83 !insertmacro ${_action} ".mp1"
\r
84 !insertmacro ${_action} ".mp2"
\r
85 !insertmacro ${_action} ".mp3"
\r
86 !insertmacro ${_action} ".ogg"
\r
87 !insertmacro ${_action} ".spx"
\r
88 !insertmacro ${_action} ".wav"
\r
89 !insertmacro ${_action} ".wma"
\r
92 !macro MacroVideoExtensions _action
\r
93 !insertmacro ${_action} ".asf"
\r
94 !insertmacro ${_action} ".avi"
\r
95 !insertmacro ${_action} ".divx"
\r
96 !insertmacro ${_action} ".dv"
\r
97 !insertmacro ${_action} ".m1v"
\r
98 !insertmacro ${_action} ".m2v"
\r
99 !insertmacro ${_action} ".mkv"
\r
100 !insertmacro ${_action} ".mov"
\r
101 !insertmacro ${_action} ".mp4"
\r
102 !insertmacro ${_action} ".mpeg"
\r
103 !insertmacro ${_action} ".mpeg1"
\r
104 !insertmacro ${_action} ".mpeg2"
\r
105 !insertmacro ${_action} ".mpeg4"
\r
106 !insertmacro ${_action} ".mpg"
\r
107 !insertmacro ${_action} ".ps"
\r
108 !insertmacro ${_action} ".ts"
\r
109 !insertmacro ${_action} ".ogm"
\r
110 !insertmacro ${_action} ".vob"
\r
111 !insertmacro ${_action} ".wmv"
\r
114 !macro MacroOtherExtensions _action
\r
115 !insertmacro ${_action} ".asx"
\r
116 !insertmacro ${_action} ".bin"
\r
117 !insertmacro ${_action} ".cue"
\r
118 !insertmacro ${_action} ".m3u"
\r
119 !insertmacro ${_action} ".pls"
\r
120 !insertmacro ${_action} ".vlc"
\r
123 !macro MacroAllExtensions _action
\r
124 !insertmacro MacroAudioExtensions ${_action}
\r
125 !insertmacro MacroVideoExtensions ${_action}
\r
126 !insertmacro MacroOtherExtensions ${_action}
\r
129 ;;;;;;;;;;;;;;;;;;;;;;;;;;
\r
130 ; File type associations ;
\r
131 ;;;;;;;;;;;;;;;;;;;;;;;;;;
\r
133 Function RegisterExtension
\r
134 ; back up old value for extension $R0 (eg. ".opt")
\r
135 ReadRegStr $1 HKCR "$R0" ""
\r
136 StrCmp $1 "" NoBackup
\r
137 StrCmp $1 "VLC$R0" "NoBackup"
\r
138 WriteRegStr HKCR "$R0" "VLC.backup" $1
\r
140 WriteRegStr HKCR "$R0" "" "VLC$R0"
\r
141 ReadRegStr $0 HKCR "VLC$R0" ""
\r
142 WriteRegStr HKCR "VLC$R0" "" "VLC media file"
\r
143 WriteRegStr HKCR "VLC$R0\shell" "" "Play"
\r
144 WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" "%1"'
\r
145 WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
\r
148 Function un.RegisterExtension
\r
149 ;start of restore script
\r
150 ReadRegStr $1 HKCR "$R0" ""
\r
151 StrCmp $1 "VLC$R0" 0 NoOwn ; only do this if we own it
\r
152 ReadRegStr $1 HKCR "$R0" "VLC.backup"
\r
153 StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key
\r
154 DeleteRegKey HKCR "$R0"
\r
157 WriteRegStr HKCR "$R0" "" $1
\r
158 DeleteRegValue HKCR "$R0" "VLC.backup"
\r
160 DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings
\r
163 !macro RegisterExtensionSection EXT
\r
167 Call RegisterExtension
\r
172 !macro UnRegisterExtensionSection EXT
\r
175 Call un.RegisterExtension
\r
179 !macro WriteRegStrSupportedTypes EXT
\r
180 WriteRegStr HKCR Applications\vlc.exe\SupportedTypes ${EXT} ""
\r
183 ;;;;;;;;;;;;;;;;;;;;;;;;
\r
184 ; Context menu entries ;
\r
185 ;;;;;;;;;;;;;;;;;;;;;;;;
\r
187 !macro AddContextMenu EXT
\r
188 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC "" "Play with VLC media player"
\r
189 WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '$INSTDIR\vlc.exe --no-playlist-enqueue "%1"'
\r
191 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC "" "Add to VLC media player's Playlist"
\r
192 WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '$INSTDIR\vlc.exe --one-instance --playlist-enqueue "%1"'
\r
195 !macro DeleteContextMenu EXT
\r
196 DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC
\r
197 DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC
\r
200 ;;;;;;;;;;;;;;;;;;;;;;
\r
201 ; Installer sections ;
\r
202 ;;;;;;;;;;;;;;;;;;;;;;
\r
204 Section "Media player (required)" SEC01
\r
206 SetShellVarContext all
\r
207 SetOutPath "$INSTDIR"
\r
210 File vlc.exe.manifest
\r
218 ; Add VLC to "recomended programs" for the following extensions
\r
219 WriteRegStr HKCR Applications\vlc.exe "" ""
\r
220 WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"
\r
221 WriteRegStr HKCR Applications\vlc.exe\shell\Play "" "Play with VLC"
\r
222 WriteRegStr HKCR Applications\vlc.exe\shell\Play\command "" \
\r
223 '$INSTDIR\vlc.exe "%1"'
\r
224 !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
\r
226 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" "Play with VLC media player"
\r
227 WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
\r
228 "$INSTDIR\vlc.exe cdda:%1"
\r
229 WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" "Play with VLC media player"
\r
230 WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
\r
231 "$INSTDIR\vlc.exe dvd:%1"
\r
233 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
\r
234 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" "Play DVD movie"
\r
235 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
\r
236 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
\r
237 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play"
\r
238 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
\r
240 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
\r
241 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" "Play CD audio"
\r
242 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
\r
243 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
\r
244 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play"
\r
245 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
\r
246 WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
\r
247 WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Play"
\r
248 WriteRegStr HKCR "VLC.DVDMovie\shell\Play\command" "" \
\r
249 '$INSTDIR\vlc.exe dvd:%1@1:0'
\r
250 WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
\r
251 WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
\r
252 WriteRegStr HKCR "VLC.CDAudio\shell" "" "Play"
\r
253 WriteRegStr HKCR "VLC.CDAudio\shell\Play\command" "" \
\r
254 '$INSTDIR\vlc.exe cdda:%1'
\r
255 WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
\r
259 Section "Start Menu + Desktop Shortcut" SEC02
\r
261 CreateDirectory "$SMPROGRAMS\VideoLAN"
\r
262 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
\r
263 "$INSTDIR\vlc.exe" "--intf wxwin --wxwin-embed"
\r
264 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player (alt).lnk" \
\r
265 "$INSTDIR\vlc.exe" "--intf wxwin --no-wxwin-embed"
\r
266 CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player (skins).lnk" \
\r
267 "$INSTDIR\vlc.exe" "--intf skins"
\r
268 CreateShortCut "$SMPROGRAMS\VideoLAN\Reset VLC defaults and quit.lnk" \
\r
269 "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache --save-config vlc:quit "
\r
270 CreateShortCut "$DESKTOP\VLC media player.lnk" \
\r
271 "$INSTDIR\vlc.exe" "--intf wxwin"
\r
272 WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" \
\r
273 "${PRODUCT_WEB_SITE}"
\r
274 CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_NAME} Website.lnk" \
\r
275 "$INSTDIR\${PRODUCT_NAME}.url"
\r
276 WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" \
\r
277 "${PRODUCT_WEB_SITE}/doc/"
\r
278 CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
\r
279 "$INSTDIR\Documentation.url"
\r
282 Section /o "Mozilla plugin" SEC03
\r
286 ; doesn't work. bug in mozilla/mozilla firefox or moz documentation (xpt file isn't loaded)
\r
287 ; see mozilla bugs 184506 and 159445
\r
288 ;!define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
\r
289 ;WriteRegStr HKLM ${Moz} "Description" "VideoLAN VLC plugin for Mozilla"
\r
290 ;WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\mozilla\npvlc.dll"
\r
291 ;WriteRegStr HKLM ${Moz} "Product" "VLC media player"
\r
292 ;WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
\r
293 ;WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
\r
294 ;WriteRegStr HKLM ${Moz} "XPTPath" "$INSTDIR\mozilla\vlcintf.xpt"
\r
300 !define Index 'Line${__LINE__}'
\r
306 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
\r
307 StrCmp $R0 "" "${Index}-End"
\r
309 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
\r
310 StrCmp $R2 "" "${Index}-Loop" ""
\r
312 CopyFiles "$INSTDIR\mozilla\*" "$R2"
\r
313 Goto "${Index}-Loop"
\r
320 Section /o "ActiveX plugin" SEC04
\r
322 SetOutPath "$INSTDIR"
\r
323 File activex\axvlc.dll
\r
324 RegDLL "$INSTDIR\axvlc.dll"
\r
327 Section "Context Menus" SEC05
\r
329 !insertmacro MacroAllExtensions AddContextMenu
\r
332 SectionGroup "File type associations" SEC06
\r
333 SectionGroup "Audio Files"
\r
334 !insertmacro MacroAudioExtensions RegisterExtensionSection
\r
336 SectionGroup "Video Files"
\r
337 !insertmacro MacroVideoExtensions RegisterExtensionSection
\r
339 SectionGroup "Other"
\r
340 !insertmacro MacroOtherExtensions RegisterExtensionSection
\r
345 WriteUninstaller "$INSTDIR\uninstall.exe"
\r
346 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
\r
347 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
\r
348 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
\r
350 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
\r
351 "DisplayName" "$(^Name)"
\r
352 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
\r
353 "UninstallString" "$INSTDIR\uninstall.exe"
\r
354 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
\r
355 "DisplayIcon" "$INSTDIR\vlc.exe"
\r
356 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
\r
357 "DisplayVersion" "${PRODUCT_VERSION}"
\r
358 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
\r
359 "URLInfoAbout" "${PRODUCT_WEB_SITE}"
\r
360 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
\r
361 "Publisher" "${PRODUCT_PUBLISHER}"
\r
364 ; Section descriptions
\r
365 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
\r
366 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} \
\r
367 "The media player itself"
\r
368 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} \
\r
369 "Adds icons to your start menu and your desktop for easy access"
\r
370 !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} \
\r
371 "The VLC Mozilla and Mozilla Firefox plugin"
\r
372 !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} \
\r
373 "The VLC ActiveX plugin"
\r
374 !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} \
\r
375 "Add context menu items (Play With VLC and Add To VLC's Playlist)"
\r
376 !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} \
\r
377 "Sets VLC media player as the default application for the specified file type"
\r
378 !insertmacro MUI_FUNCTION_DESCRIPTION_END
\r
381 Function un.onUninstSuccess
\r
383 MessageBox MB_ICONINFORMATION|MB_OK \
\r
384 "$(^Name) was successfully removed from your computer."
\r
388 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 \
\r
389 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
\r
394 SetShellVarContext all
\r
396 !insertmacro MacroAllExtensions DeleteContextMenu
\r
397 !insertmacro MacroAllExtensions UnRegisterExtensionSection
\r
399 UnRegDLL "$INSTDIR\axvlc.dll"
\r
400 Delete /REBOOTOK "$INSTDIR\axvlc.dll"
\r
402 ;remove mozilla plugin
\r
407 !define Index 'Line${__LINE__}'
\r
413 EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
\r
414 StrCmp $R0 "" "${Index}-End"
\r
416 ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
\r
417 StrCmp $R2 "" "${Index}-Loop" ""
\r
419 Delete "$R2\vlcintf.xpt"
\r
420 Delete "$R2\npvlc.dll"
\r
421 Goto "${Index}-Loop"
\r
426 RMDir "$SMPROGRAMS\VideoLAN"
\r
427 RMDir /r $SMPROGRAMS\VideoLAN
\r
429 DeleteRegKey HKLM Software\VideoLAN
\r
431 DeleteRegKey HKCR Applications\vlc.exe
\r
432 DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
\r
433 DeleteRegKey HKCR DVD\shell\PlayWithVLC
\r
434 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
\r
435 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
\r
436 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
\r
437 DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
\r
438 DeleteRegKey HKCR "VLC.MediaFile"
\r
440 DeleteRegKey HKLM \
\r
441 SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}
\r
443 DeleteRegKey HKLM \
\r
444 Software\Microsoft\Windows\CurrentVersion\Uninstall\VideoLAN
\r
446 Delete "$DESKTOP\VLC media player.lnk"
\r
448 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
\r
449 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
\r