]> git.sesse.net Git - vlc/blob - extras/package/win32/NSIS/vlc.win32.nsi.in
nsis: register x64 axvlc.dll properly
[vlc] / extras / package / win32 / NSIS / vlc.win32.nsi.in
1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 ; NSIS installer script for vlc ;
3 ; (http://nsis.sourceforge.net) ;
4 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5
6 !include "languages\declaration.nsh"
7
8 !define PRODUCT_NAME "VLC media player"
9 !define VERSION @VERSION@
10 !define PRODUCT_VERSION @VERSION@
11 !define PRODUCT_GROUP "VideoLAN"
12 !define PRODUCT_PUBLISHER "VideoLAN"
13 !define PRODUCT_WEB_SITE "http://www.videolan.org/"
14 !define PRODUCT_DIR_REGKEY "Software\VideoLAN\VLC"
15 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
16 !define PRODUCT_UNINST_ROOT_KEY "HKLM"
17 !define PRODUCT_ID "{ea92ef52-afe4-4212-bacb-dfe9fca94cd6}"
18
19 !define MUI_LANGDLL_REGISTRY_ROOT "HKLM"
20 !define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_DIR_REGKEY}"
21 !define MUI_LANGDLL_REGISTRY_VALUENAME "Language"
22
23 !define INSTALL_ACTIVEX
24 !define INSTALL_MOZILLA
25
26 ;;;;;;;;;;;;;;;;;;;;;;;;;
27 ; General configuration ;
28 ;;;;;;;;;;;;;;;;;;;;;;;;;
29
30 Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
31 @HAVE_WIN64_FALSE@ OutFile ..\vlc-${VERSION}-win32.exe
32 @HAVE_WIN64_TRUE@  OutFile ..\vlc-${VERSION}-win64.exe
33 InstallDir "$@PROGRAMFILES@\VideoLAN\VLC"
34 !ifdef NSIS_LZMA_COMPRESS_WHOLE
35 SetCompressor lzma
36 !else
37 SetCompressor /SOLID lzma
38 !endif
39
40 SetOverwrite ifnewer
41 CRCCheck on
42 BrandingText "${PRODUCT_GROUP} ${PRODUCT_NAME}"
43
44 InstType $Name_InstTypeRecommended
45 InstType $Name_InstTypeMinimum
46 InstType $Name_InstTypeFull
47
48 RequestExecutionLevel user
49 !addincludedir NSIS
50 !addplugindir NSIS
51 !include UAC.nsh
52 !include WinVer.nsh
53
54 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
55 ; NSIS Modern User Interface configuration ;
56 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
57
58 ; MUI 1.67 compatible ------
59   !include "MUI.nsh"
60
61 ; MUI Settings
62   !define MUI_ABORTWARNING
63   !define MUI_ICON "vlc.ico"
64   !define MUI_UNICON "vlc.ico"
65   !define MUI_COMPONENTSPAGE_SMALLDESC
66
67 ; Installer pages
68   ; Welcome page
69     !define MUI_WELCOMEPAGE_TITLE_3LINES
70     !insertmacro MUI_PAGE_WELCOME
71   ; License page
72     !define MUI_LICENSEPAGE_BUTTON $(^NextBtn)
73     !define MUI_LICENSEPAGE_TEXT_BOTTOM $License_NextText
74     !insertmacro MUI_PAGE_LICENSE "COPYING.txt"
75   ; Components page
76     !insertmacro MUI_PAGE_COMPONENTS
77   ; Directory page
78     !insertmacro MUI_PAGE_DIRECTORY
79   ; Instfiles page
80     !insertmacro MUI_PAGE_INSTFILES
81   ; Finish page
82     !define MUI_FINISHPAGE_LINK $Link_VisitWebsite
83     !define MUI_FINISHPAGE_LINK_LOCATION "http://www.videolan.org/vlc/"
84     !define MUI_FINISHPAGE_NOREBOOTSUPPORT
85     !insertmacro MUI_PAGE_FINISH
86
87 ; Uninstaller pages
88     !insertmacro MUI_UNPAGE_CONFIRM
89     !insertmacro MUI_UNPAGE_COMPONENTS
90     !insertmacro MUI_UNPAGE_INSTFILES
91     !insertmacro MUI_UNPAGE_FINISH
92
93 ; Language files
94   !insertmacro MUI_LANGUAGE "English" # first language is the default language
95   !insertmacro MUI_LANGUAGE "French"
96   !insertmacro MUI_LANGUAGE "German"
97   !insertmacro MUI_LANGUAGE "Spanish"
98   !insertmacro MUI_LANGUAGE "SimpChinese"
99   !insertmacro MUI_LANGUAGE "TradChinese"
100   !insertmacro MUI_LANGUAGE "Japanese"
101   !insertmacro MUI_LANGUAGE "Korean"
102   !insertmacro MUI_LANGUAGE "Italian"
103   !insertmacro MUI_LANGUAGE "Dutch"
104   !insertmacro MUI_LANGUAGE "Danish"
105   !insertmacro MUI_LANGUAGE "Swedish"
106   !insertmacro MUI_LANGUAGE "Norwegian"
107   !insertmacro MUI_LANGUAGE "Finnish"
108   !insertmacro MUI_LANGUAGE "Greek"
109   !insertmacro MUI_LANGUAGE "Russian"
110   !insertmacro MUI_LANGUAGE "Portuguese"
111   !insertmacro MUI_LANGUAGE "PortugueseBR"
112   !insertmacro MUI_LANGUAGE "Arabic"
113   !insertmacro MUI_LANGUAGE "Polish"
114   !insertmacro MUI_LANGUAGE "Romanian"
115   !insertmacro MUI_LANGUAGE "Slovak"
116   !insertmacro MUI_LANGUAGE "Serbian"
117   !insertmacro MUI_LANGUAGE "Czech"
118   !insertmacro MUI_LANGUAGE "Hungarian"
119   !insertmacro MUI_LANGUAGE "Catalan"
120   !insertmacro MUI_LANGUAGE "Bulgarian"
121   !insertmacro MUI_LANGUAGE "Estonian"
122   !insertmacro MUI_LANGUAGE "Lithuanian"
123   !insertmacro MUI_LANGUAGE "Basque"
124
125 ; Reserve files for solid compression
126   !insertmacro MUI_RESERVEFILE_LANGDLL
127   !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
128
129 ; MUI end ------
130
131 ;;;;;;;;;;;;;;;;;;;;;;;
132 ; Macro and Functions ;
133 ;;;;;;;;;;;;;;;;;;;;;;;
134
135 !include helpers/extensions.nsh
136 Var UninstallLog
137 !include helpers/install.nsh
138
139 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
140 ; Delete prefs Macro        ;
141 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
142
143 !macro delprefs
144   StrCpy $0 0
145   !define Index 'Line${__LINE__}'
146   "${Index}-Loop:"
147   ; FIXME
148   ; this will loop through all the logged users and "virtual" windows users
149   ; (it looks like users are only present in HKEY_USERS when they are logged in)
150     ClearErrors
151     EnumRegKey $1 HKU "" $0
152     StrCmp $1 "" "${Index}-End"
153     IntOp $0 $0 + 1
154     ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
155     StrCmp $2 "" "${Index}-Loop"
156     RMDir /r "$2\vlc"
157     Goto "${Index}-Loop"
158   "${Index}-End:"
159   !undef Index
160 !macroend
161
162 ;;;;;;;;;;;;;;;;;;;;;;
163 ; Installer sections ;
164 ; The CORE of the    ;
165 ; installer          ;
166 ;;;;;;;;;;;;;;;;;;;;;;
167
168 Section $Name_Section01 SEC01
169   SectionIn 1 2 3 RO
170   SetShellVarContext all
171   SetOutPath "$INSTDIR"
172
173   !insertmacro OpenUninstallLog
174
175   ; VLC.exe, libvlc.dll
176   !insertmacro InstallFile vlc.exe
177   !insertmacro InstallFile vlc.exe.manifest
178   !insertmacro InstallFile vlc-cache-gen.exe
179
180   ; All dlls
181   !insertmacro InstallFile *.dll
182
183   ; Text files
184   !insertmacro InstallFile *.txt
185
186   ; Subfolders
187   !insertmacro InstallFolder plugins
188   !insertmacro InstallFolder locale
189   !insertmacro InstallFolder sdk
190 @BUILD_SKINS_TRUE@   !insertmacro InstallFolder skins
191 @BUILD_LUA_TRUE@     !insertmacro InstallFolder lua
192
193   ; Generate the cache and add it to uninstall.log
194   ExecWait "$INSTDIR\vlc-cache-gen.exe $INSTDIR\plugins"
195   FindFirst $0 $1 "$INSTDIR\plugins\*.dat"
196   FileWrite $UninstallLog "plugins\$1$\r$\n"
197   FindClose $0
198
199
200   ; URLs
201   WriteIniStr "$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
202   FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"
203   WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}/doc/"
204   FileWrite $UninstallLog "Documentation.url$\r$\n"
205   WriteIniStr "$INSTDIR\New_Skins.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}/vlc/skins.php"
206   FileWrite $UninstallLog "New_Skins.url$\r$\n"
207
208   !insertmacro CloseUninstallLog
209
210   ; Add VLC to "recommended programs" for the following extensions
211   WriteRegStr HKCR Applications\vlc.exe "" ""
212   WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"
213   WriteRegStr HKCR Applications\vlc.exe\shell\Open "" $ContextMenuEntry_PlayWith
214   WriteRegStr HKCR Applications\vlc.exe\shell\Open\command "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'
215   !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
216
217 ; Windows default programs Registration
218   ; Vista and above detection
219   ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
220   StrCpy $R1 $R0 1
221   StrCmp $R1 '6' lbl_vista lbl_done
222
223   lbl_vista:
224   WriteRegStr HKLM "Software\RegisteredApplications" "VLC" "Software\Clients\Media\VLC\Capabilities"
225   WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationName" "VLC media player"
226   WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"
227   WriteRegStr HKLM "Software\Clients\Media\VLC" "" "VLC media player"
228   WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "HideIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /HideIcons /S"
229   WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ShowIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /ShowIcons /S"
230   WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ReinstallCommand" "$\"$INSTDIR\spad-setup.exe$\" /Reinstall /S"
231   WriteRegDWORD HKLM "Software\Clients\Media\VLC\InstallInfo" "IconsVisible" 0x001
232
233   lbl_done:
234 SectionEnd
235
236 Section $Name_Section02a SEC02a
237   SectionIn 1 2 3
238   CreateDirectory "$SMPROGRAMS\VideoLAN"
239   CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
240     "$INSTDIR\vlc.exe" ""
241   CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player skinned.lnk" \
242     "$INSTDIR\vlc.exe" "-Iskins"
243   CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
244     "$INSTDIR\Documentation.url"
245   CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \
246     "$INSTDIR\NEWS.txt" ""
247   CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \
248     "$INSTDIR\${PRODUCT_GROUP} Website.url"
249   CreateShortCut "$SMPROGRAMS\VideoLAN\Reset VLC media player preferences and cache files.lnk" \
250     "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache vlc://quit"
251 SectionEnd
252
253 Section $Name_Section02b SEC02b
254   SectionIn 1 2 3
255   CreateShortCut "$DESKTOP\VLC media player.lnk" \
256     "$INSTDIR\vlc.exe" ""
257 SectionEnd
258
259 SectionGroup /e !$Name_Section34
260 !ifdef INSTALL_MOZILLA
261 Section $Name_Section03 SEC03
262   SectionIn 1 3
263
264   SetOutPath "$INSTDIR"
265   !insertmacro OpenUninstallLog
266   !insertmacro InstallFile npvlc.dll
267   !insertmacro InstallFile npvlc.dll.manifest
268   !insertmacro CloseUninstallLog
269
270   !define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
271   WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
272   WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"
273   WriteRegStr HKLM ${Moz} "Product" "VLC media player"
274   WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
275   WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
276 SectionEnd
277 !endif
278
279 !ifdef INSTALL_ACTIVEX
280 Section $Name_Section04 SEC04
281   SectionIn 1 3
282
283   SetOutPath "$INSTDIR"
284   !insertmacro OpenUninstallLog
285   !insertmacro InstallFile axvlc.dll
286   !insertmacro InstallFile axvlc.dll.manifest
287   !insertmacro CloseUninstallLog
288 @HAVE_WIN64_FALSE@ RegDLL "$INSTDIR\axvlc.dll"
289 @HAVE_WIN64_TRUE@  ExecWait 'regsvr32.exe /s "$INSTDIR\axvlc.dll"'
290 SectionEnd
291 !endif
292 SectionGroupEnd
293
294
295 Section $Name_Section05 SEC05
296   SectionIn 1 2 3
297   WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
298   WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
299     '"$INSTDIR\vlc.exe" --started-from-file cdda:///%1'
300   WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
301   WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
302     '"$INSTDIR\vlc.exe" --started-from-file dvd:///%1'
303
304   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
305   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" $Action_OnArrivalDVD
306   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
307   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
308   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "Open"
309   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
310
311   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
312   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" $Action_OnArrivalAudioCD
313   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
314   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
315   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "Open"
316   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
317
318   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayVideoCDMovieOnArrival" "VLCPlayVCDMovieOnArrival" ""
319   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "Action" $Action_OnArrivalVCDMovie
320   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
321   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "InvokeProgID" "VLC.VCDMovie"
322   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "InvokeVerb" "Open"
323   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "Provider" "VideoLAN VLC media player"
324
325   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlaySuperVideoCDMovieOnArrival" "VLCPlaySVCDMovieOnArrival" ""
326   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "Action" $Action_OnArrivalSVCDMovie
327   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
328   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "InvokeProgID" "VLC.SVCDMovie"
329   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "InvokeVerb" "Open"
330   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "Provider" "VideoLAN VLC media player"
331
332   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDAudioOnArrival" "VLCPlayDVDAudioOnArrival" ""
333   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "Action" $Action_OnArrivalDVDAudio
334   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
335   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "InvokeProgID" "VLC.OPENFolder"
336   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "InvokeVerb" "Open"
337   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "Provider" "VideoLAN VLC media player"
338
339   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayVideoFilesOnArrival" "VLCPlayVideoFilesOnArrival" ""
340   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "Action" $Action_OnArrivalVideoFiles
341   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
342   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "InvokeProgID" "VLC.OPENFolder"
343   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "InvokeVerb" "Open"
344   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "Provider" "VideoLAN VLC media player"
345
346   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayMusicFilesOnArrival" "VLCPlayMusicFilesOnArrival" ""
347   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "Action" $Action_OnArrivalMusicFiles
348   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
349   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "InvokeProgID" "VLC.OPENFolder"
350   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "InvokeVerb" "Open"
351   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "Provider" "VideoLAN VLC media player"
352
353   WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
354   WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Open"
355   WriteRegStr HKCR "VLC.DVDMovie\shell\Open\command" "" \
356     '"$INSTDIR\vlc.exe" --started-from-file dvd:///%1'
357   WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
358
359   WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
360   WriteRegStr HKCR "VLC.CDAudio\shell" "" "Open"
361   WriteRegStr HKCR "VLC.CDAudio\shell\Open\command" "" \
362     '"$INSTDIR\vlc.exe" --started-from-file cdda:///%1'
363   WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
364
365   WriteRegStr HKCR "VLC.VCDMovie" "" "VLC VCD Movie"
366   WriteRegStr HKCR "VLC.VCDMovie\shell" "" "Open"
367   WriteRegStr HKCR "VLC.VCDMovie\shell\Open\command" "" \
368      '"$INSTDIR\vlc.exe" --started-from-file vcd:///%1'
369   WriteRegStr HKCR "VLC.VCDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
370
371   WriteRegStr HKCR "VLC.SVCDMovie" "" "VLC SVCD Movie"
372   WriteRegStr HKCR "VLC.SVCDMovie\shell" "" "Open"
373   WriteRegStr HKCR "VLC.SVCDMovie\shell\Open\command" "" \
374      '"$INSTDIR\vlc.exe" --started-from-file vcd:///%1'
375   WriteRegStr HKCR "VLC.SVCDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
376
377   WriteRegStr HKCR "VLC.OPENFolder" "" "VLC Play content"
378   WriteRegStr HKCR "VLC.OPENFolder\shell" "" "Open"
379   WriteRegStr HKCR "VLC.OPENFolder\shell\Open\command" "" \
380      '"$INSTDIR\vlc.exe" %1'
381   WriteRegStr HKCR "VLC.OPENFolder\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
382
383 SectionEnd
384
385
386 SectionGroup /e !$Name_Section06 SEC06
387   SectionGroup $Name_SectionGroupAudio
388     !insertmacro MacroAudioExtensions RegisterExtensionSection
389   SectionGroupEnd
390   SectionGroup $Name_SectionGroupVideo
391     !insertmacro MacroVideoExtensions RegisterExtensionSection
392   SectionGroupEnd
393   SectionGroup $Name_SectionGroupOther
394     !insertmacro MacroOtherExtensions RegisterExtensionSection
395     !insertmacro MacroSkinExtensions RegisterSkinExtensionSection
396   SectionGroupEnd
397 SectionGroupEnd
398
399 Section $Name_Section07 SEC07
400   SectionIn 1 3
401   !insertmacro MacroAllExtensions AddContextMenu
402   !insertmacro AddContextMenuExt "Directory"
403 SectionEnd
404
405 Section /o $Name_Section08 SEC08
406   !insertmacro delprefs
407 SectionEnd
408
409 ; Installer section descriptions
410 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
411   !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $Desc_Section01
412   !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} $Desc_Section02a
413   !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} $Desc_Section02b
414 !ifdef INSTALL_MOZILLA
415   !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $Desc_Section03
416 !endif
417 !ifdef INSTALL_ACTIVEX
418   !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $Desc_Section04
419 !endif
420   !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $Desc_Section05
421   !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $Desc_Section06
422   !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $Desc_Section07
423   !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $Desc_Section08
424 !insertmacro MUI_FUNCTION_DESCRIPTION_END
425
426 ;;; Start function
427 Function .onInit
428
429 @HAVE_WIN64_TRUE@ !include "x64.nsh"
430 @HAVE_WIN64_TRUE@ ${If} ${RunningX64}
431 @HAVE_WIN64_TRUE@ ${Else}
432 @HAVE_WIN64_TRUE@    MessageBox MB_OK|MB_ICONSTOP "This version of VLC only runs on 64bits operating systems.$\nYour operating system is 32bits.$\n$\nPlease get the 32 BITS version."
433 @HAVE_WIN64_TRUE@    Quit
434 @HAVE_WIN64_TRUE@ ${Endif}
435 ${If} ${AtLeastWinXP}
436     ${If} ${IsWinXP}
437     ${AndIf} ${AtMostServicePack} 1
438         Goto WinTooOld
439     ${Endif}
440 ${Else}
441     Goto WinTooOld
442 ${Endif}
443
444 @HAVE_WIN64_TRUE@ SetRegView 64
445 ReadRegStr $INSTDIR HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir"
446 StrCmp $INSTDIR "" 0 UAC_Elevate
447 StrCpy $INSTDIR "$@PROGRAMFILES@\VideoLAN\VLC"
448
449 UAC_Elevate:
450     UAC::RunElevated
451     StrCmp 1223 $0 UAC_ElevationAborted
452     StrCmp 0 $0 0 UAC_Err
453     StrCmp 1 $1 0 UAC_Success
454     Quit
455
456 UAC_Err:
457     MessageBox mb_iconstop "Unable to elevate, error $0"
458     Abort
459
460 UAC_ElevationAborted:
461     MessageBox mb_iconstop "This installer requires admin access, aborting!"
462     Abort
463
464 WinTooOld:
465     MessageBox MB_OK|MB_ICONSTOP "This version of VLC only runs on Windows XP SP2 and newer."
466     Quit
467
468 UAC_Success:
469     StrCmp 1 $3 +4
470     StrCmp 3 $1 0 UAC_ElevationAborted
471     MessageBox mb_iconstop "This installer requires admin access, try again"
472     goto UAC_Elevate
473   !insertmacro MUI_LANGDLL_DISPLAY
474
475   !include "languages\english.nsh"
476   StrCmp $LANGUAGE ${LANG_FRENCH} French 0
477   StrCmp $LANGUAGE ${LANG_GERMAN} German 0
478   StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
479   StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
480   StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
481   StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
482   StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
483   StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
484   StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
485   StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
486   StrCmp $LANGUAGE ${LANG_DANISH} Danish 0
487   StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
488   StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
489   StrCmp $LANGUAGE ${LANG_JAPANESE} Japanese 0
490 ;  StrCmp $LANGUAGE ${LANG_BENGALI} Bengali 0
491 ;  StrCmp $LANGUAGE ${LANG_PUNJABI} Punjabi 0
492 ;  StrCmp $LANGUAGE ${LANG_SLOVENIAN} Slovenian 0
493   StrCmp $LANGUAGE ${LANG_SPANISH} Spanish 0
494   StrCmp $LANGUAGE ${LANG_ESTONIAN} Estonian 0
495   StrCmp $LANGUAGE ${LANG_LITHUANIAN} Lithuanian 0
496   StrCmp $LANGUAGE ${LANG_BASQUE} Basque 0
497   StrCmp $LANGUAGE ${LANG_SERBIAN} Serbian 0
498   StrCmp $LANGUAGE ${LANG_RUSSIAN} Russian 0
499   StrCmp $LANGUAGE ${LANG_HEBREW} Hebrew 0
500   StrCmp $LANGUAGE ${LANG_GALICIAN} Galician 0
501   StrCmp $LANGUAGE ${LANG_SWEDISH} Swedish 0
502   StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
503   French:
504   !include "languages\french.nsh"
505   Goto EndLanguageCmp
506   German:
507   !include "languages\german.nsh"
508   Goto EndLanguageCmp
509   Italian:
510   !include "languages\italian.nsh"
511   Goto EndLanguageCmp
512   Hungarian:
513   !include "languages\hungarian.nsh"
514   Goto EndLanguageCmp
515   Romanian:
516   !include "languages\romanian.nsh"
517   Goto EndLanguageCmp
518   Catalan:
519   !include "languages\catalan.nsh"
520   Goto EndLanguageCmp
521   Bulgarian:
522   !include "languages\bulgarian.nsh"
523   Goto EndLanguageCmp
524   Slovak:
525   !include "languages\slovak.nsh"
526   Goto EndLanguageCmp
527   Polish:
528   !include "languages\polish.nsh"
529   Goto EndLanguageCmp
530   Dutch:
531   !include "languages\dutch.nsh"
532   Goto EndLanguageCmp
533   Danish:
534   !include "languages\danish.nsh"
535   Goto EndLanguageCmp
536   Schinese:
537   !include "languages\schinese.nsh"
538   Goto EndLanguageCmp
539   Finnish:
540   !include "languages\finnish.nsh"
541   Goto EndLanguageCmp
542   Japanese:
543   !include "languages\japanese.nsh"
544   Goto EndLanguageCmp
545   Bengali:
546   !include "languages\bengali.nsh"
547   Goto EndLanguageCmp
548   Punjabi:
549   !include "languages\punjabi.nsh"
550   Goto EndLanguageCmp
551   Slovenian:
552   !include "languages\slovenian.nsh"
553   Goto EndLanguageCmp
554   Spanish:
555   !include "languages\spanish.nsh"
556   Goto EndLanguageCmp
557   Estonian:
558   !include "languages\estonian.nsh"
559   Goto EndLanguageCmp
560   Lithuanian:
561   !include "languages\lithuanian.nsh"
562   Goto EndLanguageCmp
563   Basque:
564   !include "languages\basque.nsh"
565   Goto EndLanguageCmp
566   Serbian:
567   !include "languages\serbian.nsh"
568   Goto EndLanguageCmp
569   Russian:
570   !include "languages\Russian.nsh"
571   Goto EndLanguageCmp
572   Hebrew:
573   !include "languages\hebrew.nsh"
574   Goto EndLanguageCmp
575   Galician:
576   !include "languages\galician.nsh"
577   Goto EndLanguageCmp
578   Swedish:
579   !include "languages\swedish.nsh"
580   Goto EndLanguageCmp
581   Brazilian:
582   !include "languages\brazilian_portuguese.nsh"
583   EndLanguageCmp:
584
585   ReadRegStr $R0  ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
586   "UninstallString"
587   StrCmp $R0 "" done
588
589   MessageBox MB_YESNO|MB_ICONEXCLAMATION $Message_AlreadyInstalled /SD IDNO IDNO done
590
591   ;Run the uninstaller
592   ;uninst:
593     ClearErrors
594     ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
595   done:
596
597 FunctionEnd
598
599 Function .OnInstFailed
600     UAC::Unload
601 FunctionEnd
602
603 Function .OnInstSuccess
604     UAC::Unload
605 FunctionEnd
606
607 ;; End function
608 Section -Post
609   WriteUninstaller "$INSTDIR\uninstall.exe"
610   WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
611   WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
612   WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
613
614   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
615     "DisplayName" "$(^Name)"
616   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
617     "UninstallString" "$INSTDIR\uninstall.exe"
618   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
619     "InstallLocation" "$INSTDIR"
620   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
621     "DisplayIcon" "$INSTDIR\vlc.exe"
622   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
623     "DisplayVersion" "${PRODUCT_VERSION}"
624   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
625     "URLInfoAbout" "${PRODUCT_WEB_SITE}"
626   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
627     "Publisher" "${PRODUCT_PUBLISHER}"
628   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
629     "VersionMajor"  "@VERSION_MAJOR@"
630   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
631     "VersionMinor" "@VERSION_MINOR@"
632 SectionEnd
633
634 ;;;;;;;;;;;;;;;;;;;;;;;;
635 ; Uninstaller sections ;
636 ;;;;;;;;;;;;;;;;;;;;;;;;
637
638 ; TrimNewlines (copied from NSIS documentation)
639 ; input, top of stack  (e.g. whatever$\r$\n)
640 ; output, top of stack (replaces, with e.g. whatever)
641 ; modifies no other variables.
642
643 Function un.TrimNewlines
644  Exch $R0
645  Push $R1
646  Push $R2
647  StrCpy $R1 0
648
649  loop:
650    IntOp $R1 $R1 - 1
651    StrCpy $R2 $R0 1 $R1
652    StrCmp $R2 "$\r" loop
653    StrCmp $R2 "$\n" loop
654    IntOp $R1 $R1 + 1
655    IntCmp $R1 0 no_trim_needed
656    StrCpy $R0 $R0 $R1
657
658  no_trim_needed:
659    Pop $R2
660    Pop $R1
661    Exch $R0
662 FunctionEnd
663
664 Function un.RemoveEmptyDirs
665   Pop $9
666   !define Index 'Line${__LINE__}'
667   FindFirst $0 $1 "$INSTDIR$9*"
668   StrCmp $0 "" "${Index}-End"
669   "${Index}-Loop:"
670     StrCmp $1 "" "${Index}-End"
671     StrCmp $1 "." "${Index}-Next"
672     StrCmp $1 ".." "${Index}-Next"
673       Push $0
674       Push $1
675       Push $9
676       Push "$9$1\"
677       Call un.RemoveEmptyDirs
678       Pop $9
679       Pop $1
680       Pop $0
681     "${Index}-Remove:"
682     RMDir "$INSTDIR$9$1"
683     "${Index}-Next:"
684     FindNext $0 $1
685     Goto "${Index}-Loop"
686   "${Index}-End:"
687   FindClose $0
688   !undef Index
689 FunctionEnd
690
691 Section "un.$Name_Section91" SEC91
692   SectionIn 1 2 3 RO
693   SetShellVarContext all
694
695   !insertmacro MacroAllExtensions DeleteContextMenu
696   !insertmacro MacroAllExtensions UnRegisterExtensionSection
697   !insertmacro MacroSkinExtensions UnRegisterExtensionSection
698   !insertmacro DeleteContextMenuExt "Directory"
699
700   ;remove activex plugin
701 @HAVE_WIN64_FALSE@ UnRegDLL "$INSTDIR\axvlc.dll"
702 @HAVE_WIN64_TRUE@  ExecWait 'regsvr32.exe /s /u "$INSTDIR\axvlc.dll"'
703   Delete /REBOOTOK "$INSTDIR\axvlc.dll"
704   Delete /REBOOTOK "$INSTDIR\axvlc.dll.manifest"
705
706   ;remove mozilla plugin
707   Push $R0
708   Push $R1
709   Push $R2
710
711   !define Index 'Line${__LINE__}'
712   StrCpy $R1 "0"
713
714   "${Index}-Loop:"
715
716     ; Check for Key
717     EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
718     StrCmp $R0 "" "${Index}-End"
719     IntOp $R1 $R1 + 1
720     ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
721     StrCmp $R2 "" "${Index}-Loop" ""
722
723     ; old files (0.8.5 and before) that may be lying around
724     Delete /REBOOTOK "$R2\npvlc.dll"
725     Delete /REBOOTOK "$R2\libvlc.dll"
726     Delete /REBOOTOK "$R2\vlcintf.xpt"
727     Goto "${Index}-Loop"
728
729   "${Index}-End:"
730   !undef Index
731   Delete /REBOOTOK "$INSTDIR\npvlc.dll"
732   Delete /REBOOTOK "$INSTDIR\npvlc.dll.manifest"
733
734   RMDir "$SMPROGRAMS\VideoLAN"
735   RMDir /r $SMPROGRAMS\VideoLAN
736
737   FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
738   UninstallLoop:
739     ClearErrors
740     FileRead $UninstallLog $R0
741     IfErrors UninstallEnd
742     Push $R0
743     Call un.TrimNewLines
744     Pop $R0
745     Delete "$INSTDIR\$R0"
746     Goto UninstallLoop
747   UninstallEnd:
748   FileClose $UninstallLog
749   Delete "$INSTDIR\uninstall.log"
750   Delete "$INSTDIR\uninstall.exe"
751   Push "\"
752   Call un.RemoveEmptyDirs
753   RMDir "$INSTDIR"
754
755   DeleteRegKey HKLM Software\VideoLAN
756
757   DeleteRegKey HKCR Applications\vlc.exe
758   DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
759   DeleteRegKey HKCR DVD\shell\PlayWithVLC
760   DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
761   DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
762   DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
763   DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
764   DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayVideoCDMovieOnArrival" "VLCPlayVCDMovieOnArrival"
765   DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival
766   DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlaySuperVideoCDMovieOnArrival" "VLCPlaySVCDMovieOnArrival"
767   DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival
768   DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDAudioOnArrival" "VLCPlayDVDAudioOnArrival"
769   DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival
770   DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayVideoFilesOnArrival" "VLCPlayVideoFilesOnArrival"
771   DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival
772   DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayMusicFilesOnArrival" "VLCPlayMusicFilesOnArrival"
773   DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival
774
775   DeleteRegKey HKLM Software\Clients\Media\VLC
776   DeleteRegValue HKLM "Software\RegisteredApplications" "VLC"
777   DeleteRegKey HKCR "VLC.MediaFile"
778   DeleteRegKey HKCR "VLC.DVDMovie"
779   DeleteRegKey HKCR "VLC.CDAudio"
780   DeleteRegKey HKCR "VLC.VCDMovie"
781   DeleteRegKey HKCR "VLC.SVCDMovie"
782   DeleteRegKey HKCR "VLC.OPENFolder"
783
784
785   DeleteRegKey HKLM \
786     "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
787
788   DeleteRegKey HKLM \
789     "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
790
791   Delete "$DESKTOP\VLC media player.lnk"
792
793   DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
794   DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
795   SetAutoClose true
796 SectionEnd
797
798 Section /o "un.$Name_Section92" SEC92
799   !insertmacro delprefs
800 SectionEnd
801
802 ; Uninstaller section descriptions
803 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
804   !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} $Desc_Section91
805   !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} $Desc_Section92
806 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
807
808 Function un.OnUnInstFailed
809     UAC::Unload
810 FunctionEnd
811
812 Function un.OnUnInstSuccess
813     UAC::Unload
814     Delete "$INSTDIR\UAC.dll"
815 FunctionEnd
816
817 Function un.onInit
818
819 UAC_Elevate:
820     UAC::RunElevated
821     StrCmp 1223 $0 UAC_ElevationAborted
822     StrCmp 0 $0 0 UAC_Err
823     StrCmp 1 $1 0 UAC_Success
824     Quit
825
826 UAC_Err:
827     MessageBox mb_iconstop "Unable to elevate, error $0"
828     Abort
829
830 UAC_ElevationAborted:
831     MessageBox mb_iconstop "This installer requires admin access, aborting!"
832     Abort
833
834 UAC_Success:
835     StrCmp 1 $3 +4
836     StrCmp 3 $1 0 UAC_ElevationAborted
837     MessageBox mb_iconstop "This installer requires admin access, try again"
838     goto UAC_Elevate
839
840   !insertmacro MUI_UNGETLANGUAGE
841
842   !include "languages\english.nsh"
843   StrCmp $LANGUAGE ${LANG_FRENCH} French 0
844   StrCmp $LANGUAGE ${LANG_GERMAN} German 0
845   StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
846   StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
847   StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
848   StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
849   StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
850   StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
851   StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
852   StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
853   StrCmp $LANGUAGE ${LANG_DANISH} Danish 0
854   StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
855   StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
856   StrCmp $LANGUAGE ${LANG_JAPANESE} Japanese 0
857 ;  StrCmp $LANGUAGE ${LANG_BENGALI} Bengali 0
858 ;  StrCmp $LANGUAGE ${LANG_PUNJABI} Punjabi 0
859 ;  StrCmp $LANGUAGE ${LANG_SLOVENIAN} Slovenian 0
860   StrCmp $LANGUAGE ${LANG_SPANISH} Spanish 0
861   StrCmp $LANGUAGE ${LANG_ESTONIAN} Estonian 0
862   StrCmp $LANGUAGE ${LANG_LITHUANIAN} Lithuanian 0
863   StrCmp $LANGUAGE ${LANG_BASQUE} Basque 0
864   StrCmp $LANGUAGE ${LANG_SERBIAN} Serbian 0
865   StrCmp $LANGUAGE ${LANG_RUSSIAN} Russian 0
866   StrCmp $LANGUAGE ${LANG_HEBREW} Hebrew 0
867   StrCmp $LANGUAGE ${LANG_GALICIAN} Galician 0
868   StrCmp $LANGUAGE ${LANG_SWEDISH} Swedish 0
869   StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
870   French:
871   !include "languages\french.nsh"
872   Goto EndLanguageCmp
873   German:
874   !include "languages\german.nsh"
875   Goto EndLanguageCmp
876   Italian:
877   !include "languages\italian.nsh"
878   Goto EndLanguageCmp
879   Hungarian:
880   !include "languages\hungarian.nsh"
881   Goto EndLanguageCmp
882   Romanian:
883   !include "languages\romanian.nsh"
884   Goto EndLanguageCmp
885   Catalan:
886   !include "languages\catalan.nsh"
887   Goto EndLanguageCmp
888   Bulgarian:
889   !include "languages\bulgarian.nsh"
890   Goto EndLanguageCmp
891   Slovak:
892   !include "languages\slovak.nsh"
893   Goto EndLanguageCmp
894   Polish:
895   !include "languages\polish.nsh"
896   Goto EndLanguageCmp
897   Dutch:
898   !include "languages\dutch.nsh"
899   Goto EndLanguageCmp
900   Danish:
901   !include "languages\danish.nsh"
902   Goto EndLanguageCmp
903   Schinese:
904   !include "languages\schinese.nsh"
905   Goto EndLanguageCmp
906   Finnish:
907   !include "languages\finnish.nsh"
908   Goto EndLanguageCmp
909   Japanese:
910   !include "languages\japanese.nsh"
911   Goto EndLanguageCmp
912   Bengali:
913   !include "languages\bengali.nsh"
914   Goto EndLanguageCmp
915   Punjabi:
916   !include "languages\punjabi.nsh"
917   Goto EndLanguageCmp
918   Slovenian:
919   !include "languages\slovenian.nsh"
920   Goto EndLanguageCmp
921   Spanish:
922   !include "languages\spanish.nsh"
923   Goto EndLanguageCmp
924   Estonian:
925   !include "languages\estonian.nsh"
926   Goto EndLanguageCmp
927   Lithuanian:
928   !include "languages\lithuanian.nsh"
929   Goto EndLanguageCmp
930   Basque:
931   !include "languages\basque.nsh"
932   Goto EndLanguageCmp
933   Serbian:
934   !include "languages\serbian.nsh"
935   Goto EndLanguageCmp
936   Russian:
937   !include "languages\russian.nsh"
938   Goto EndLanguageCmp
939   Hebrew:
940   !include "languages\hebrew.nsh"
941   Goto EndLanguageCmp
942   Galician:
943   !include "languages\galician.nsh"
944   Goto EndLanguageCmp
945   Swedish:
946   !include "languages\swedish.nsh"
947   Goto EndLanguageCmp
948   Brazilian:
949   !include "languages\brazilian_portuguese.nsh"
950   EndLanguageCmp:
951
952 FunctionEnd