]> git.sesse.net Git - vlc/blob - extras/package/win32/NSIS/vlc.win32.nsi.in
56e8b03b2325a5e88e89dc48274e7eedf6c85280
[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   RegDLL "$INSTDIR\axvlc.dll"
289 SectionEnd
290 !endif
291 SectionGroupEnd
292
293
294 Section $Name_Section05 SEC05
295   SectionIn 1 2 3
296   WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
297   WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
298     '"$INSTDIR\vlc.exe" --started-from-file cdda:///%1'
299   WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
300   WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
301     '"$INSTDIR\vlc.exe" --started-from-file dvd:///%1'
302
303   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
304   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" $Action_OnArrivalDVD
305   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
306   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
307   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "Open"
308   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
309
310   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
311   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" $Action_OnArrivalAudioCD
312   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
313   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
314   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "Open"
315   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
316
317   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayVideoCDMovieOnArrival" "VLCPlayVCDMovieOnArrival" ""
318   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "Action" $Action_OnArrivalVCDMovie
319   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
320   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "InvokeProgID" "VLC.VCDMovie"
321   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "InvokeVerb" "Open"
322   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "Provider" "VideoLAN VLC media player"
323
324   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlaySuperVideoCDMovieOnArrival" "VLCPlaySVCDMovieOnArrival" ""
325   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "Action" $Action_OnArrivalSVCDMovie
326   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
327   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "InvokeProgID" "VLC.SVCDMovie"
328   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "InvokeVerb" "Open"
329   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "Provider" "VideoLAN VLC media player"
330
331   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDAudioOnArrival" "VLCPlayDVDAudioOnArrival" ""
332   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "Action" $Action_OnArrivalDVDAudio
333   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
334   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "InvokeProgID" "VLC.OPENFolder"
335   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "InvokeVerb" "Open"
336   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "Provider" "VideoLAN VLC media player"
337
338   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayVideoFilesOnArrival" "VLCPlayVideoFilesOnArrival" ""
339   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "Action" $Action_OnArrivalVideoFiles
340   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
341   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "InvokeProgID" "VLC.OPENFolder"
342   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "InvokeVerb" "Open"
343   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "Provider" "VideoLAN VLC media player"
344
345   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayMusicFilesOnArrival" "VLCPlayMusicFilesOnArrival" ""
346   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "Action" $Action_OnArrivalMusicFiles
347   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
348   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "InvokeProgID" "VLC.OPENFolder"
349   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "InvokeVerb" "Open"
350   WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "Provider" "VideoLAN VLC media player"
351
352   WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
353   WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Open"
354   WriteRegStr HKCR "VLC.DVDMovie\shell\Open\command" "" \
355     '"$INSTDIR\vlc.exe" --started-from-file dvd:///%1'
356   WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
357
358   WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
359   WriteRegStr HKCR "VLC.CDAudio\shell" "" "Open"
360   WriteRegStr HKCR "VLC.CDAudio\shell\Open\command" "" \
361     '"$INSTDIR\vlc.exe" --started-from-file cdda:///%1'
362   WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
363
364   WriteRegStr HKCR "VLC.VCDMovie" "" "VLC VCD Movie"
365   WriteRegStr HKCR "VLC.VCDMovie\shell" "" "Open"
366   WriteRegStr HKCR "VLC.VCDMovie\shell\Open\command" "" \
367      '"$INSTDIR\vlc.exe" --started-from-file vcd:///%1'
368   WriteRegStr HKCR "VLC.VCDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
369
370   WriteRegStr HKCR "VLC.SVCDMovie" "" "VLC SVCD Movie"
371   WriteRegStr HKCR "VLC.SVCDMovie\shell" "" "Open"
372   WriteRegStr HKCR "VLC.SVCDMovie\shell\Open\command" "" \
373      '"$INSTDIR\vlc.exe" --started-from-file vcd:///%1'
374   WriteRegStr HKCR "VLC.SVCDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
375
376   WriteRegStr HKCR "VLC.OPENFolder" "" "VLC Play content"
377   WriteRegStr HKCR "VLC.OPENFolder\shell" "" "Open"
378   WriteRegStr HKCR "VLC.OPENFolder\shell\Open\command" "" \
379      '"$INSTDIR\vlc.exe" %1'
380   WriteRegStr HKCR "VLC.OPENFolder\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
381
382 SectionEnd
383
384
385 SectionGroup /e !$Name_Section06 SEC06
386   SectionGroup $Name_SectionGroupAudio
387     !insertmacro MacroAudioExtensions RegisterExtensionSection
388   SectionGroupEnd
389   SectionGroup $Name_SectionGroupVideo
390     !insertmacro MacroVideoExtensions RegisterExtensionSection
391   SectionGroupEnd
392   SectionGroup $Name_SectionGroupOther
393     !insertmacro MacroOtherExtensions RegisterExtensionSection
394     !insertmacro MacroSkinExtensions RegisterSkinExtensionSection
395   SectionGroupEnd
396 SectionGroupEnd
397
398 Section $Name_Section07 SEC07
399   SectionIn 1 3
400   !insertmacro MacroAllExtensions AddContextMenu
401   !insertmacro AddContextMenuExt "Directory"
402 SectionEnd
403
404 Section /o $Name_Section08 SEC08
405   !insertmacro delprefs
406 SectionEnd
407
408 ; Installer section descriptions
409 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
410   !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $Desc_Section01
411   !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} $Desc_Section02a
412   !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} $Desc_Section02b
413 !ifdef INSTALL_MOZILLA
414   !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $Desc_Section03
415 !endif
416 !ifdef INSTALL_ACTIVEX
417   !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $Desc_Section04
418 !endif
419   !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $Desc_Section05
420   !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $Desc_Section06
421   !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $Desc_Section07
422   !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $Desc_Section08
423 !insertmacro MUI_FUNCTION_DESCRIPTION_END
424
425 ;;; Start function
426 Function .onInit
427
428 @HAVE_WIN64_TRUE@ !include "x64.nsh"
429 @HAVE_WIN64_TRUE@ ${If} ${RunningX64}
430 @HAVE_WIN64_TRUE@ ${Else}
431 @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."
432 @HAVE_WIN64_TRUE@    Quit
433 @HAVE_WIN64_TRUE@ ${Endif}
434 ${If} ${AtLeastWinXP}
435     ${If} ${IsWinXP}
436     ${AndIf} ${AtMostServicePack} 1
437         Goto WinTooOld
438     ${Endif}
439 ${Else}
440     Goto WinTooOld
441 ${Endif}
442
443 @HAVE_WIN64_TRUE@ SetRegView 64
444 ReadRegStr $INSTDIR HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir"
445 StrCmp $INSTDIR "" 0 UAC_Elevate
446 StrCpy $INSTDIR "$@PROGRAMFILES@\VideoLAN\VLC"
447
448 UAC_Elevate:
449     UAC::RunElevated
450     StrCmp 1223 $0 UAC_ElevationAborted
451     StrCmp 0 $0 0 UAC_Err
452     StrCmp 1 $1 0 UAC_Success
453     Quit
454
455 UAC_Err:
456     MessageBox mb_iconstop "Unable to elevate, error $0"
457     Abort
458
459 UAC_ElevationAborted:
460     MessageBox mb_iconstop "This installer requires admin access, aborting!"
461     Abort
462
463 WinTooOld:
464     MessageBox MB_OK|MB_ICONSTOP "This version of VLC only runs on Windows XP SP2 and newer."
465     Quit
466
467 UAC_Success:
468     StrCmp 1 $3 +4
469     StrCmp 3 $1 0 UAC_ElevationAborted
470     MessageBox mb_iconstop "This installer requires admin access, try again"
471     goto UAC_Elevate
472   !insertmacro MUI_LANGDLL_DISPLAY
473
474   !include "languages\english.nsh"
475   StrCmp $LANGUAGE ${LANG_FRENCH} French 0
476   StrCmp $LANGUAGE ${LANG_GERMAN} German 0
477   StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
478   StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
479   StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
480   StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
481   StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
482   StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
483   StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
484   StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
485   StrCmp $LANGUAGE ${LANG_DANISH} Danish 0
486   StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
487   StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
488   StrCmp $LANGUAGE ${LANG_JAPANESE} Japanese 0
489 ;  StrCmp $LANGUAGE ${LANG_BENGALI} Bengali 0
490 ;  StrCmp $LANGUAGE ${LANG_PUNJABI} Punjabi 0
491 ;  StrCmp $LANGUAGE ${LANG_SLOVENIAN} Slovenian 0
492   StrCmp $LANGUAGE ${LANG_SPANISH} Spanish 0
493   StrCmp $LANGUAGE ${LANG_ESTONIAN} Estonian 0
494   StrCmp $LANGUAGE ${LANG_LITHUANIAN} Lithuanian 0
495   StrCmp $LANGUAGE ${LANG_BASQUE} Basque 0
496   StrCmp $LANGUAGE ${LANG_SERBIAN} Serbian 0
497   StrCmp $LANGUAGE ${LANG_RUSSIAN} Russian 0
498   StrCmp $LANGUAGE ${LANG_HEBREW} Hebrew 0
499   StrCmp $LANGUAGE ${LANG_GALICIAN} Galician 0
500   StrCmp $LANGUAGE ${LANG_SWEDISH} Swedish 0
501   StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
502   French:
503   !include "languages\french.nsh"
504   Goto EndLanguageCmp
505   German:
506   !include "languages\german.nsh"
507   Goto EndLanguageCmp
508   Italian:
509   !include "languages\italian.nsh"
510   Goto EndLanguageCmp
511   Hungarian:
512   !include "languages\hungarian.nsh"
513   Goto EndLanguageCmp
514   Romanian:
515   !include "languages\romanian.nsh"
516   Goto EndLanguageCmp
517   Catalan:
518   !include "languages\catalan.nsh"
519   Goto EndLanguageCmp
520   Bulgarian:
521   !include "languages\bulgarian.nsh"
522   Goto EndLanguageCmp
523   Slovak:
524   !include "languages\slovak.nsh"
525   Goto EndLanguageCmp
526   Polish:
527   !include "languages\polish.nsh"
528   Goto EndLanguageCmp
529   Dutch:
530   !include "languages\dutch.nsh"
531   Goto EndLanguageCmp
532   Danish:
533   !include "languages\danish.nsh"
534   Goto EndLanguageCmp
535   Schinese:
536   !include "languages\schinese.nsh"
537   Goto EndLanguageCmp
538   Finnish:
539   !include "languages\finnish.nsh"
540   Goto EndLanguageCmp
541   Japanese:
542   !include "languages\japanese.nsh"
543   Goto EndLanguageCmp
544   Bengali:
545   !include "languages\bengali.nsh"
546   Goto EndLanguageCmp
547   Punjabi:
548   !include "languages\punjabi.nsh"
549   Goto EndLanguageCmp
550   Slovenian:
551   !include "languages\slovenian.nsh"
552   Goto EndLanguageCmp
553   Spanish:
554   !include "languages\spanish.nsh"
555   Goto EndLanguageCmp
556   Estonian:
557   !include "languages\estonian.nsh"
558   Goto EndLanguageCmp
559   Lithuanian:
560   !include "languages\lithuanian.nsh"
561   Goto EndLanguageCmp
562   Basque:
563   !include "languages\basque.nsh"
564   Goto EndLanguageCmp
565   Serbian:
566   !include "languages\serbian.nsh"
567   Goto EndLanguageCmp
568   Russian:
569   !include "languages\Russian.nsh"
570   Goto EndLanguageCmp
571   Hebrew:
572   !include "languages\hebrew.nsh"
573   Goto EndLanguageCmp
574   Galician:
575   !include "languages\galician.nsh"
576   Goto EndLanguageCmp
577   Swedish:
578   !include "languages\swedish.nsh"
579   Goto EndLanguageCmp
580   Brazilian:
581   !include "languages\brazilian_portuguese.nsh"
582   EndLanguageCmp:
583
584   ReadRegStr $R0  ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
585   "UninstallString"
586   StrCmp $R0 "" done
587
588   MessageBox MB_YESNO|MB_ICONEXCLAMATION $Message_AlreadyInstalled /SD IDNO IDNO done
589
590   ;Run the uninstaller
591   ;uninst:
592     ClearErrors
593     ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
594   done:
595
596 FunctionEnd
597
598 Function .OnInstFailed
599     UAC::Unload
600 FunctionEnd
601
602 Function .OnInstSuccess
603     UAC::Unload
604 FunctionEnd
605
606 ;; End function
607 Section -Post
608   WriteUninstaller "$INSTDIR\uninstall.exe"
609   WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
610   WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
611   WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
612
613   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
614     "DisplayName" "$(^Name)"
615   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
616     "UninstallString" "$INSTDIR\uninstall.exe"
617   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
618     "InstallLocation" "$INSTDIR"
619   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
620     "DisplayIcon" "$INSTDIR\vlc.exe"
621   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
622     "DisplayVersion" "${PRODUCT_VERSION}"
623   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
624     "URLInfoAbout" "${PRODUCT_WEB_SITE}"
625   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
626     "Publisher" "${PRODUCT_PUBLISHER}"
627   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
628     "VersionMajor"  "@VERSION_MAJOR@"
629   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
630     "VersionMinor" "@VERSION_MINOR@"
631 SectionEnd
632
633 ;;;;;;;;;;;;;;;;;;;;;;;;
634 ; Uninstaller sections ;
635 ;;;;;;;;;;;;;;;;;;;;;;;;
636
637 ; TrimNewlines (copied from NSIS documentation)
638 ; input, top of stack  (e.g. whatever$\r$\n)
639 ; output, top of stack (replaces, with e.g. whatever)
640 ; modifies no other variables.
641
642 Function un.TrimNewlines
643  Exch $R0
644  Push $R1
645  Push $R2
646  StrCpy $R1 0
647
648  loop:
649    IntOp $R1 $R1 - 1
650    StrCpy $R2 $R0 1 $R1
651    StrCmp $R2 "$\r" loop
652    StrCmp $R2 "$\n" loop
653    IntOp $R1 $R1 + 1
654    IntCmp $R1 0 no_trim_needed
655    StrCpy $R0 $R0 $R1
656
657  no_trim_needed:
658    Pop $R2
659    Pop $R1
660    Exch $R0
661 FunctionEnd
662
663 Function un.RemoveEmptyDirs
664   Pop $9
665   !define Index 'Line${__LINE__}'
666   FindFirst $0 $1 "$INSTDIR$9*"
667   StrCmp $0 "" "${Index}-End"
668   "${Index}-Loop:"
669     StrCmp $1 "" "${Index}-End"
670     StrCmp $1 "." "${Index}-Next"
671     StrCmp $1 ".." "${Index}-Next"
672       Push $0
673       Push $1
674       Push $9
675       Push "$9$1\"
676       Call un.RemoveEmptyDirs
677       Pop $9
678       Pop $1
679       Pop $0
680     "${Index}-Remove:"
681     RMDir "$INSTDIR$9$1"
682     "${Index}-Next:"
683     FindNext $0 $1
684     Goto "${Index}-Loop"
685   "${Index}-End:"
686   FindClose $0
687   !undef Index
688 FunctionEnd
689
690 Section "un.$Name_Section91" SEC91
691   SectionIn 1 2 3 RO
692   SetShellVarContext all
693
694   !insertmacro MacroAllExtensions DeleteContextMenu
695   !insertmacro MacroAllExtensions UnRegisterExtensionSection
696   !insertmacro MacroSkinExtensions UnRegisterExtensionSection
697   !insertmacro DeleteContextMenuExt "Directory"
698
699   ;remove activex plugin
700   UnRegDLL "$INSTDIR\axvlc.dll"
701   Delete /REBOOTOK "$INSTDIR\axvlc.dll"
702   Delete /REBOOTOK "$INSTDIR\axvlc.dll.manifest"
703
704   ;remove mozilla plugin
705   Push $R0
706   Push $R1
707   Push $R2
708
709   !define Index 'Line${__LINE__}'
710   StrCpy $R1 "0"
711
712   "${Index}-Loop:"
713
714     ; Check for Key
715     EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
716     StrCmp $R0 "" "${Index}-End"
717     IntOp $R1 $R1 + 1
718     ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
719     StrCmp $R2 "" "${Index}-Loop" ""
720
721     ; old files (0.8.5 and before) that may be lying around
722     Delete /REBOOTOK "$R2\npvlc.dll"
723     Delete /REBOOTOK "$R2\libvlc.dll"
724     Delete /REBOOTOK "$R2\vlcintf.xpt"
725     Goto "${Index}-Loop"
726
727   "${Index}-End:"
728   !undef Index
729   Delete /REBOOTOK "$INSTDIR\npvlc.dll"
730   Delete /REBOOTOK "$INSTDIR\npvlc.dll.manifest"
731
732   RMDir "$SMPROGRAMS\VideoLAN"
733   RMDir /r $SMPROGRAMS\VideoLAN
734
735   FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
736   UninstallLoop:
737     ClearErrors
738     FileRead $UninstallLog $R0
739     IfErrors UninstallEnd
740     Push $R0
741     Call un.TrimNewLines
742     Pop $R0
743     Delete "$INSTDIR\$R0"
744     Goto UninstallLoop
745   UninstallEnd:
746   FileClose $UninstallLog
747   Delete "$INSTDIR\uninstall.log"
748   Delete "$INSTDIR\uninstall.exe"
749   Push "\"
750   Call un.RemoveEmptyDirs
751   RMDir "$INSTDIR"
752
753   DeleteRegKey HKLM Software\VideoLAN
754
755   DeleteRegKey HKCR Applications\vlc.exe
756   DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
757   DeleteRegKey HKCR DVD\shell\PlayWithVLC
758   DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
759   DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
760   DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
761   DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
762   DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayVideoCDMovieOnArrival" "VLCPlayVCDMovieOnArrival"
763   DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival
764   DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlaySuperVideoCDMovieOnArrival" "VLCPlaySVCDMovieOnArrival"
765   DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival
766   DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDAudioOnArrival" "VLCPlayDVDAudioOnArrival"
767   DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival
768   DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayVideoFilesOnArrival" "VLCPlayVideoFilesOnArrival"
769   DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival
770   DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayMusicFilesOnArrival" "VLCPlayMusicFilesOnArrival"
771   DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival
772
773   DeleteRegKey HKLM Software\Clients\Media\VLC
774   DeleteRegValue HKLM "Software\RegisteredApplications" "VLC"
775   DeleteRegKey HKCR "VLC.MediaFile"
776   DeleteRegKey HKCR "VLC.DVDMovie"
777   DeleteRegKey HKCR "VLC.CDAudio"
778   DeleteRegKey HKCR "VLC.VCDMovie"
779   DeleteRegKey HKCR "VLC.SVCDMovie"
780   DeleteRegKey HKCR "VLC.OPENFolder"
781
782
783   DeleteRegKey HKLM \
784     "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
785
786   DeleteRegKey HKLM \
787     "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
788
789   Delete "$DESKTOP\VLC media player.lnk"
790
791   DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
792   DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
793   SetAutoClose true
794 SectionEnd
795
796 Section /o "un.$Name_Section92" SEC92
797   !insertmacro delprefs
798 SectionEnd
799
800 ; Uninstaller section descriptions
801 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
802   !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} $Desc_Section91
803   !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} $Desc_Section92
804 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
805
806 Function un.OnUnInstFailed
807     UAC::Unload
808 FunctionEnd
809
810 Function un.OnUnInstSuccess
811     UAC::Unload
812     Delete "$INSTDIR\UAC.dll"
813 FunctionEnd
814
815 Function un.onInit
816
817 UAC_Elevate:
818     UAC::RunElevated
819     StrCmp 1223 $0 UAC_ElevationAborted
820     StrCmp 0 $0 0 UAC_Err
821     StrCmp 1 $1 0 UAC_Success
822     Quit
823
824 UAC_Err:
825     MessageBox mb_iconstop "Unable to elevate, error $0"
826     Abort
827
828 UAC_ElevationAborted:
829     MessageBox mb_iconstop "This installer requires admin access, aborting!"
830     Abort
831
832 UAC_Success:
833     StrCmp 1 $3 +4
834     StrCmp 3 $1 0 UAC_ElevationAborted
835     MessageBox mb_iconstop "This installer requires admin access, try again"
836     goto UAC_Elevate
837
838   !insertmacro MUI_UNGETLANGUAGE
839
840   !include "languages\english.nsh"
841   StrCmp $LANGUAGE ${LANG_FRENCH} French 0
842   StrCmp $LANGUAGE ${LANG_GERMAN} German 0
843   StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
844   StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
845   StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
846   StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
847   StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
848   StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
849   StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
850   StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
851   StrCmp $LANGUAGE ${LANG_DANISH} Danish 0
852   StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
853   StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
854   StrCmp $LANGUAGE ${LANG_JAPANESE} Japanese 0
855 ;  StrCmp $LANGUAGE ${LANG_BENGALI} Bengali 0
856 ;  StrCmp $LANGUAGE ${LANG_PUNJABI} Punjabi 0
857 ;  StrCmp $LANGUAGE ${LANG_SLOVENIAN} Slovenian 0
858   StrCmp $LANGUAGE ${LANG_SPANISH} Spanish 0
859   StrCmp $LANGUAGE ${LANG_ESTONIAN} Estonian 0
860   StrCmp $LANGUAGE ${LANG_LITHUANIAN} Lithuanian 0
861   StrCmp $LANGUAGE ${LANG_BASQUE} Basque 0
862   StrCmp $LANGUAGE ${LANG_SERBIAN} Serbian 0
863   StrCmp $LANGUAGE ${LANG_RUSSIAN} Russian 0
864   StrCmp $LANGUAGE ${LANG_HEBREW} Hebrew 0
865   StrCmp $LANGUAGE ${LANG_GALICIAN} Galician 0
866   StrCmp $LANGUAGE ${LANG_SWEDISH} Swedish 0
867   StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
868   French:
869   !include "languages\french.nsh"
870   Goto EndLanguageCmp
871   German:
872   !include "languages\german.nsh"
873   Goto EndLanguageCmp
874   Italian:
875   !include "languages\italian.nsh"
876   Goto EndLanguageCmp
877   Hungarian:
878   !include "languages\hungarian.nsh"
879   Goto EndLanguageCmp
880   Romanian:
881   !include "languages\romanian.nsh"
882   Goto EndLanguageCmp
883   Catalan:
884   !include "languages\catalan.nsh"
885   Goto EndLanguageCmp
886   Bulgarian:
887   !include "languages\bulgarian.nsh"
888   Goto EndLanguageCmp
889   Slovak:
890   !include "languages\slovak.nsh"
891   Goto EndLanguageCmp
892   Polish:
893   !include "languages\polish.nsh"
894   Goto EndLanguageCmp
895   Dutch:
896   !include "languages\dutch.nsh"
897   Goto EndLanguageCmp
898   Danish:
899   !include "languages\danish.nsh"
900   Goto EndLanguageCmp
901   Schinese:
902   !include "languages\schinese.nsh"
903   Goto EndLanguageCmp
904   Finnish:
905   !include "languages\finnish.nsh"
906   Goto EndLanguageCmp
907   Japanese:
908   !include "languages\japanese.nsh"
909   Goto EndLanguageCmp
910   Bengali:
911   !include "languages\bengali.nsh"
912   Goto EndLanguageCmp
913   Punjabi:
914   !include "languages\punjabi.nsh"
915   Goto EndLanguageCmp
916   Slovenian:
917   !include "languages\slovenian.nsh"
918   Goto EndLanguageCmp
919   Spanish:
920   !include "languages\spanish.nsh"
921   Goto EndLanguageCmp
922   Estonian:
923   !include "languages\estonian.nsh"
924   Goto EndLanguageCmp
925   Lithuanian:
926   !include "languages\lithuanian.nsh"
927   Goto EndLanguageCmp
928   Basque:
929   !include "languages\basque.nsh"
930   Goto EndLanguageCmp
931   Serbian:
932   !include "languages\serbian.nsh"
933   Goto EndLanguageCmp
934   Russian:
935   !include "languages\russian.nsh"
936   Goto EndLanguageCmp
937   Hebrew:
938   !include "languages\hebrew.nsh"
939   Goto EndLanguageCmp
940   Galician:
941   !include "languages\galician.nsh"
942   Goto EndLanguageCmp
943   Swedish:
944   !include "languages\swedish.nsh"
945   Goto EndLanguageCmp
946   Brazilian:
947   !include "languages\brazilian_portuguese.nsh"
948   EndLanguageCmp:
949
950 FunctionEnd