]> git.sesse.net Git - vlc/blob - extras/package/win32/vlc.win32.nsi.in
Win32: fix the path to the plugins cache
[vlc] / extras / package / win32 / 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 Team"
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 @BUILD_ACTIVEX_TRUE@ !define INSTALL_ACTIVEX
24 @BUILD_MOZILLA_TRUE@ !define INSTALL_MOZILLA
25
26 @FILE_LIBVLCCORE_DLL@
27 @FILE_LIBVLC_DLL@
28
29 ;;;;;;;;;;;;;;;;;;;;;;;;;
30 ; General configuration ;
31 ;;;;;;;;;;;;;;;;;;;;;;;;;
32
33 Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
34 OutFile ..\vlc-${VERSION}-win32.exe
35 InstallDir "$PROGRAMFILES\VideoLAN\VLC"
36 InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
37 !ifdef NSIS_LZMA_COMPRESS_WHOLE
38 SetCompressor lzma
39 !else
40 SetCompressor /SOLID lzma
41 !endif
42
43 SetOverwrite ifnewer
44 CRCCheck on
45 BrandingText "${PRODUCT_GROUP} ${PRODUCT_NAME}"
46
47 InstType $Name_InstTypeRecommended
48 InstType $Name_InstTypeMinimum
49 InstType $Name_InstTypeFull
50
51 RequestExecutionLevel user
52 !addincludedir .
53 !addplugindir .
54 !include UAC.nsh
55
56 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
57 ; NSIS Modern User Interface configuration ;
58 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
59
60 ; MUI 1.67 compatible ------
61   !include "MUI.nsh"
62
63 ; MUI Settings
64   !define MUI_ABORTWARNING
65   !define MUI_ICON "vlc.ico"
66   !define MUI_UNICON "vlc.ico"
67   !define MUI_COMPONENTSPAGE_SMALLDESC
68
69 ; Installer pages
70   ; Welcome page
71     !define MUI_WELCOMEPAGE_TITLE_3LINES
72     !insertmacro MUI_PAGE_WELCOME
73   ; License page
74     !define MUI_LICENSEPAGE_BUTTON $(^NextBtn)
75     !insertmacro MUI_PAGE_LICENSE "COPYING.txt"
76   ; Components page
77     !insertmacro MUI_PAGE_COMPONENTS
78   ; Directory page
79     !insertmacro MUI_PAGE_DIRECTORY
80   ; Instfiles page
81     !insertmacro MUI_PAGE_INSTFILES
82   ; Finish page
83
84     Function ExecAppFile
85       Exec '$INSTDIR\vlc.exe'
86     FunctionEnd
87
88     Function AppRunAs
89       !insertmacro UAC.CallFunctionAsUser ExecAppFile
90     FunctionEnd
91
92     !define MUI_FINISHPAGE_RUN
93     !define MUI_FINISHPAGE_RUN_FUNCTION AppRunAs
94     !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"
95     !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
96     !define MUI_FINISHPAGE_LINK $Link_VisitWebsite
97     !define MUI_FINISHPAGE_LINK_LOCATION "http://www.videolan.org/vlc/"
98     !define MUI_FINISHPAGE_NOREBOOTSUPPORT
99     !insertmacro MUI_PAGE_FINISH
100
101 ; Uninstaller pages
102     !insertmacro MUI_UNPAGE_CONFIRM
103     !insertmacro MUI_UNPAGE_COMPONENTS
104     !insertmacro MUI_UNPAGE_INSTFILES
105     !insertmacro MUI_UNPAGE_FINISH
106
107 ; Language files
108   !insertmacro MUI_LANGUAGE "English" # first language is the default language
109   !insertmacro MUI_LANGUAGE "French"
110   !insertmacro MUI_LANGUAGE "German"
111   !insertmacro MUI_LANGUAGE "Spanish"
112   !insertmacro MUI_LANGUAGE "SimpChinese"
113   !insertmacro MUI_LANGUAGE "TradChinese"
114   !insertmacro MUI_LANGUAGE "Japanese"
115   !insertmacro MUI_LANGUAGE "Korean"
116   !insertmacro MUI_LANGUAGE "Italian"
117   !insertmacro MUI_LANGUAGE "Dutch"
118   !insertmacro MUI_LANGUAGE "Danish"
119   !insertmacro MUI_LANGUAGE "Swedish"
120   !insertmacro MUI_LANGUAGE "Norwegian"
121   !insertmacro MUI_LANGUAGE "Finnish"
122   !insertmacro MUI_LANGUAGE "Greek"
123   !insertmacro MUI_LANGUAGE "Russian"
124   !insertmacro MUI_LANGUAGE "Portuguese"
125   !insertmacro MUI_LANGUAGE "PortugueseBR"
126   !insertmacro MUI_LANGUAGE "Arabic"
127   !insertmacro MUI_LANGUAGE "Polish"
128   !insertmacro MUI_LANGUAGE "Romanian"
129   !insertmacro MUI_LANGUAGE "Slovak"
130   !insertmacro MUI_LANGUAGE "Czech"
131   !insertmacro MUI_LANGUAGE "Hungarian"
132   !insertmacro MUI_LANGUAGE "Catalan"
133   !insertmacro MUI_LANGUAGE "Bulgarian"
134
135 ; Reserve files for solid compression
136   !insertmacro MUI_RESERVEFILE_LANGDLL
137   !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
138
139 ; MUI end ------
140
141 ;;;;;;;;;;;;;;;;;;;;;;;
142 ; Macro and Functions ;
143 ;;;;;;;;;;;;;;;;;;;;;;;
144
145 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
146 ; 1. File type associations ;
147 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
148
149 ;; Function that register one extension for VLC
150 Function RegisterExtension
151   ; back up old value for extension $R0 (eg. ".opt")
152   ReadRegStr $1 HKCR "$R0" ""
153   StrCmp $1 "" NoBackup
154     StrCmp $1 "VLC$R0" "NoBackup"
155     WriteRegStr HKCR "$R0" "VLC.backup" $1
156 NoBackup:
157   WriteRegStr HKCR "$R0" "" "VLC$R0"
158   ReadRegStr $0 HKCR "VLC$R0" ""
159   WriteRegStr HKCR "VLC$R0" "" "VLC media file ($R0)"
160   WriteRegStr HKCR "VLC$R0\shell" "" "Open"
161   WriteRegStr HKCR "VLC$R0\shell\Open" "" $ShellAssociation_Play
162   WriteRegStr HKCR "VLC$R0\shell\Open\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'
163   WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
164
165 ;;; Vista Only part
166   ; Vista and above detection
167   ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
168   StrCpy $R2 $R1 1
169   StrCmp $R2 '6' ForVista ToEnd
170 ForVista:
171   WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0"
172
173 ToEnd:
174 FunctionEnd
175
176 ;; Function that removes one extension that VLC owns.
177 Function un.RegisterExtension
178   ;start of restore script
179   ReadRegStr $1 HKCR "$R0" ""
180   StrCmp $1 "VLC$R0" 0 NoOwn ; only do this if we own it
181     ; Read the old value from Backup
182     ReadRegStr $1 HKCR "$R0" "VLC.backup"
183     StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key
184       DeleteRegKey HKCR "$R0"
185     Goto NoOwn
186 Restore:
187       WriteRegStr HKCR "$R0" "" $1
188       DeleteRegValue HKCR "$R0" "VLC.backup"
189 NoOwn:
190     DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings
191     DeleteRegKey HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations\VLC$R0" ; for vista
192 FunctionEnd
193
194 !macro RegisterExtensionSection EXT
195   Section ${EXT}
196     SectionIn 1 3
197     Push $R0
198     StrCpy $R0 ${EXT}
199     Call RegisterExtension
200     Pop $R0
201   SectionEnd
202 !macroend
203
204 !macro UnRegisterExtensionSection EXT
205   Push $R0
206   StrCpy $R0 ${EXT}
207   Call un.RegisterExtension
208   Pop $R0
209 !macroend
210
211 !macro WriteRegStrSupportedTypes EXT
212   WriteRegStr HKCR Applications\vlc.exe\SupportedTypes ${EXT} ""
213 !macroend
214
215 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
216 ; Extension lists  Macros                    ;
217 ; Those macros calls the previous functions  ;
218 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
219
220 !macro MacroAudioExtensions _action
221   !insertmacro ${_action} ".a52"
222   !insertmacro ${_action} ".aac"
223   !insertmacro ${_action} ".ac3"
224   !insertmacro ${_action} ".aob"
225   !insertmacro ${_action} ".dts"
226   !insertmacro ${_action} ".flac"
227   !insertmacro ${_action} ".m4a"
228   !insertmacro ${_action} ".m4p"
229   !insertmacro ${_action} ".mka"
230   !insertmacro ${_action} ".mod"
231   !insertmacro ${_action} ".mp1"
232   !insertmacro ${_action} ".mp2"
233   !insertmacro ${_action} ".mp3"
234   !insertmacro ${_action} ".oma"
235   !insertmacro ${_action} ".oga"
236   !insertmacro ${_action} ".spx"
237   !insertmacro ${_action} ".tta"
238   !insertmacro ${_action} ".wav"
239   !insertmacro ${_action} ".wma"
240   !insertmacro ${_action} ".wv"
241   !insertmacro ${_action} ".xm"
242 !macroend
243
244 !macro MacroVideoExtensions _action
245   !insertmacro ${_action} ".asf"
246   !insertmacro ${_action} ".avi"
247   !insertmacro ${_action} ".divx"
248   !insertmacro ${_action} ".dv"
249   !insertmacro ${_action} ".flv"
250   !insertmacro ${_action} ".gxf"
251   !insertmacro ${_action} ".m1v"
252   !insertmacro ${_action} ".m2v"
253   !insertmacro ${_action} ".m2ts"
254   !insertmacro ${_action} ".m4v"
255   !insertmacro ${_action} ".mkv"
256   !insertmacro ${_action} ".mov"
257   !insertmacro ${_action} ".mp4"
258   !insertmacro ${_action} ".mpeg"
259   !insertmacro ${_action} ".mpeg1"
260   !insertmacro ${_action} ".mpeg2"
261   !insertmacro ${_action} ".mpeg4"
262   !insertmacro ${_action} ".mpg"
263   !insertmacro ${_action} ".mts"
264   !insertmacro ${_action} ".mxf"
265   !insertmacro ${_action} ".nuv"
266   !insertmacro ${_action} ".ogg"
267   !insertmacro ${_action} ".ogm"
268   !insertmacro ${_action} ".ogx"
269   !insertmacro ${_action} ".ogv"
270   !insertmacro ${_action} ".rmvb"
271   !insertmacro ${_action} ".ts"
272   !insertmacro ${_action} ".vob"
273   !insertmacro ${_action} ".vro"
274   !insertmacro ${_action} ".wmv"
275 !macroend
276
277 !macro MacroOtherExtensions _action
278   !insertmacro ${_action} ".asx"
279   !insertmacro ${_action} ".bin"
280   !insertmacro ${_action} ".cue"
281   !insertmacro ${_action} ".ifo"
282   !insertmacro ${_action} ".m3u"
283   !insertmacro ${_action} ".pls"
284   !insertmacro ${_action} ".sdp"
285   !insertmacro ${_action} ".vlc"
286   !insertmacro ${_action} ".xspf"
287 !macroend
288
289 ; One macro to rule them all
290 !macro MacroAllExtensions _action
291   !insertmacro MacroAudioExtensions ${_action}
292   !insertmacro MacroVideoExtensions ${_action}
293   !insertmacro MacroOtherExtensions ${_action}
294 !macroend
295
296 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
297 ; 2. Context menu entries ;
298 ;;;;;;;;;;;;;;;;;;;;;;;;;;;
299
300 ; Generic function for adding the context menu for one ext.
301 !macro AddContextMenuExt EXT
302   WriteRegStr HKCR ${EXT}\shell\PlayWithVLC "" $ContextMenuEntry_PlayWith
303   WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --no-playlist-enqueue "%1"'
304
305   WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC "" $ContextMenuEntry_AddToPlaylist
306   WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '"$INSTDIR\vlc.exe" --started-from-file --playlist-enqueue "%1"'
307 !macroend
308
309 !macro AddContextMenu EXT
310   Push $R0
311   ReadRegStr $R0 HKCR ${EXT} ""
312   !insertmacro AddContextMenuExt $R0
313   Pop $R0
314 !macroend
315
316 !macro DeleteContextMenuExt EXT
317   DeleteRegKey HKCR ${EXT}\shell\PlayWithVLC
318   DeleteRegKey HKCR ${EXT}\shell\AddToPlaylistVLC
319 !macroend
320
321 !macro DeleteContextMenu EXT
322   Push $R0
323   ReadRegStr $R0 HKCR ${EXT} ""
324   !insertmacro DeleteContextMenuExt $R0
325   Pop $R0
326 !macroend
327
328 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
329 ; 3. Delete prefs           ;
330 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
331
332 !macro delprefs
333   StrCpy $0 0
334   !define Index 'Line${__LINE__}'
335   "${Index}-Loop:"
336   ; FIXME
337   ; this will loop through all the logged users and "virtual" windows users
338   ; (it looks like users are only present in HKEY_USERS when they are logged in)
339     ClearErrors
340     EnumRegKey $1 HKU "" $0
341     StrCmp $1 "" "${Index}-End"
342     IntOp $0 $0 + 1
343     ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
344     StrCmp $2 "" "${Index}-Loop"
345     RMDir /r "$2\vlc"
346     Goto "${Index}-Loop"
347   "${Index}-End:"
348   !undef Index
349   SetShellVarContext all
350   RMDir /r "$APPDATA\\VideoLAN"
351   SetShellVarContext current
352 !macroend
353
354 ;;;;;;;;;;;;;;;
355 ; 4. Logging  ;
356 ;;;;;;;;;;;;;;;
357 Var UninstallLog
358 !macro OpenUninstallLog
359   FileOpen $UninstallLog "$INSTDIR\uninstall.log" a
360   FileSeek $UninstallLog 0 END
361 !macroend
362
363 !macro CloseUninstallLog
364   FileClose $UninstallLog
365   SetFileAttributes "$INSTDIR\uninstall.log" HIDDEN
366 !macroend
367
368 ;;;;;;;;;;;;;;;;;;;;
369 ; 5. Installations ;
370 ;;;;;;;;;;;;;;;;;;;;
371 !macro InstallFile FILEREGEX
372   File "${FILEREGEX}"
373   !define Index 'Line${__LINE__}'
374   FindFirst $0 $1 "$INSTDIR\${FILEREGEX}"
375   StrCmp $0 "" "${Index}-End"
376   "${Index}-Loop:"
377     StrCmp $1 "" "${Index}-End"
378     FileWrite $UninstallLog "$1$\r$\n"
379     FindNext $0 $1
380     Goto "${Index}-Loop"
381   "${Index}-End:"
382   !undef Index
383 !macroend
384
385 !macro InstallFolder FOLDER
386   File /r "${FOLDER}"
387   Push "${FOLDER}"
388   Call InstallFolderInternal
389 !macroend
390
391 Function InstallFolderInternal
392   Pop $9
393   !define Index 'Line${__LINE__}'
394   FindFirst $0 $1 "$INSTDIR\$9\*"
395   StrCmp $0 "" "${Index}-End"
396   "${Index}-Loop:"
397     StrCmp $1 "" "${Index}-End"
398     StrCmp $1 "." "${Index}-Next"
399     StrCmp $1 ".." "${Index}-Next"
400     IfFileExists "$9\$1\*" 0 "${Index}-Write"
401       Push $0
402       Push $9
403       Push "$9\$1"
404       Call InstallFolderInternal
405       Pop $9
406       Pop $0
407       Goto "${Index}-Next"
408     "${Index}-Write:"
409     FileWrite $UninstallLog "$9\$1$\r$\n"
410     "${Index}-Next:"
411     FindNext $0 $1
412     Goto "${Index}-Loop"
413   "${Index}-End:"
414   !undef Index
415 FunctionEnd
416 ;;; End of Macros
417
418
419 ;;;;;;;;;;;;;;;;;;;;;;
420 ; Installer sections ;
421 ; The CORE of the    ;
422 ; installer          ;
423 ;;;;;;;;;;;;;;;;;;;;;;
424
425 Section $Name_Section01 SEC01
426   SectionIn 1 2 3 RO
427   SetShellVarContext all
428   SetOutPath "$INSTDIR"
429
430   !insertmacro OpenUninstallLog
431
432   ; VLC.exe, libvlc.dll
433   !insertmacro InstallFile vlc.exe
434   !insertmacro InstallFile vlc.exe.manifest
435   !insertmacro InstallFile vlc-cache-gen.exe
436
437   ; All dlls
438   !insertmacro InstallFile *.dll
439
440   ; Text files
441   !insertmacro InstallFile *.txt
442
443   ; Subfolders
444   !insertmacro InstallFolder plugins
445   !insertmacro InstallFolder locale
446 @BUILD_OSDMENU_TRUE@ !insertmacro InstallFolder osdmenu
447 @BUILD_SKINS_TRUE@   !insertmacro InstallFolder skins
448 @BUILD_HTTPD_TRUE@   !insertmacro InstallFolder http
449 @BUILD_LUA_TRUE@     !insertmacro InstallFolder lua
450   ExecWait "$INSTDIR\vlc-cache-gen.exe $INSTDIR\plugins"
451
452
453   ; URLs
454   WriteIniStr "$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \
455     "${PRODUCT_WEB_SITE}"
456   FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"
457   WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" \
458     "${PRODUCT_WEB_SITE}/doc/"
459   FileWrite $UninstallLog "Documentation.url$\r$\n"
460   WriteIniStr "$INSTDIR\New_Skins.url" "InternetShortcut" "URL" \
461     "${PRODUCT_WEB_SITE}/vlc/skins.php"
462   FileWrite $UninstallLog "New_Skins.url$\r$\n"
463
464   !insertmacro CloseUninstallLog
465
466   ; Add VLC to "recommended programs" for the following extensions
467   WriteRegStr HKCR Applications\vlc.exe "" ""
468   WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"
469   WriteRegStr HKCR Applications\vlc.exe\shell\Open "" $ContextMenuEntry_PlayWith
470   WriteRegStr HKCR Applications\vlc.exe\shell\Open\command "" \
471     '"$INSTDIR\vlc.exe" --started-from-file "%1"'
472   !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
473
474 ; Windows default programs Registration
475   ; Vista and above detection
476   ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
477   StrCpy $R1 $R0 1
478   StrCmp $R1 '6' lbl_vista lbl_done
479
480   lbl_vista:
481   WriteRegStr HKLM "Software\RegisteredApplications" "VLC" "Software\Clients\Media\VLC\Capabilities"
482   WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationName" "VLC media player"
483   WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"
484   WriteRegStr HKLM "Software\Clients\Media\VLC" "" "VLC media player"
485   WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "HideIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /HideIcons /S"
486   WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ShowIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /ShowIcons /S"
487   WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ReinstallCommand" "$\"$INSTDIR\spad-setup.exe$\" /Reinstall /S"
488   WriteRegDWORD HKLM "Software\Clients\Media\VLC\InstallInfo" "IconsVisible" 0x001
489
490   lbl_done:
491 SectionEnd
492
493 Section $Name_Section02a SEC02a
494   SectionIn 1 2 3
495   CreateDirectory "$SMPROGRAMS\VideoLAN"
496   CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings"
497   CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Audio"
498   CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to DirectX (default).lnk" \
499     "$INSTDIR\vlc.exe" "--aout aout_directx --save-config vlc://quit"
500   CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Audio\Set Audio mode to Waveout.lnk" \
501     "$INSTDIR\vlc.exe" "--aout waveout --save-config vlc://quit"
502   CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Interface"
503 @BUILD_SKINS_TRUE@  CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Skinnable.lnk" \
504 @BUILD_SKINS_TRUE@    "$INSTDIR\vlc.exe" "-I skins --save-config vlc://quit"
505   CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Interface\Set Main Interface to Qt (default).lnk" \
506     "$INSTDIR\vlc.exe" "-I qt --save-config vlc://quit"
507   CreateDirectory "$SMPROGRAMS\VideoLAN\Quick Settings\Video"
508   ; FIXME add detection for Vista. Direct3D will be default there, for all others it's DirectX
509   CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D.lnk" \
510     "$INSTDIR\vlc.exe" "--vout direct3d --overlay --directx-hw-yuv --save-config vlc://quit"
511   CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to Direct3D (no hardware acceleration).lnk" \
512     "$INSTDIR\vlc.exe" "--vout direct3d --overlay --no-directx-hw-yuv --save-config vlc://quit"
513   CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX.lnk" \
514     "$INSTDIR\vlc.exe" "--vout directx --overlay --directx-hw-yuv --save-config vlc://quit"
515   CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no hardware acceleration).lnk" \
516     "$INSTDIR\vlc.exe" "--vout directx --no-overlay --no-directx-hw-yuv --save-config vlc://quit"
517   CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to DirectX (no video overlay).lnk" \
518     "$INSTDIR\vlc.exe" "--vout directx --no-overlay --directx-hw-yuv --save-config vlc://quit"
519   CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Video\Set Video mode to OpenGL.lnk" \
520     "$INSTDIR\vlc.exe" "--vout opengl --overlay --save-config vlc://quit"
521   CreateShortCut "$SMPROGRAMS\VideoLAN\Quick Settings\Reset VLC media player preferences and cache files.lnk" \
522     "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache vlc://quit"
523   CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
524     "$INSTDIR\Documentation.url"
525   CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \
526     "$INSTDIR\NEWS.txt" ""
527   CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \
528     "$INSTDIR\${PRODUCT_GROUP} Website.url"
529   CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
530     "$INSTDIR\vlc.exe" ""
531 SectionEnd
532
533 Section $Name_Section02b SEC02b
534   SectionIn 1 2 3
535   CreateShortCut "$DESKTOP\VLC media player.lnk" \
536     "$INSTDIR\vlc.exe" ""
537 SectionEnd
538
539 !ifdef INSTALL_MOZILLA
540 Section /o $Name_Section03 SEC03
541   SectionIn 3
542
543   SetOutPath "$INSTDIR"
544   !insertmacro OpenUninstallLog
545   !insertmacro InstallFile mozilla\npvlc.dll
546   !insertmacro InstallFile mozilla\npvlc.dll.manifest
547   !insertmacro CloseUninstallLog
548
549   !define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
550   WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
551   WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"
552   WriteRegStr HKLM ${Moz} "Product" "VLC media player"
553   WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
554   WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
555
556  ; for very old version of mozilla, these lines may be needed
557  ;Push $R0
558  ;Push $R1
559  ;Push $R2
560
561  ;!define Index 'Line${__LINE__}'
562  ;StrCpy $R1 "0"
563
564  ;"${Index}-Loop:"
565
566  ;  ; Check for Key
567  ;  EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
568  ;  StrCmp $R0 "" "${Index}-End"
569  ;  IntOp $R1 $R1 + 1
570  ;  ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
571  ;  StrCmp $R2 "" "${Index}-Loop" ""
572
573  ;  CopyFiles "$INSTDIR\npvlc.dll" "$R2"
574  ;  !ifdef LIBVLC_DLL
575  ;  CopyFiles ${LIBVLC_DLL} "$R2"
576  ;  !endif
577  ;  !ifdef LIBVLC_CONTROL_DLL
578  ;  CopyFiles ${LIBVLC_CONTROL_DLL} "$R2"
579  ;  !endif
580  ;  Goto "${Index}-Loop"
581
582  ;"${Index}-End:"
583  ;!undef Index
584
585 SectionEnd
586 !endif
587
588 !ifdef INSTALL_ACTIVEX
589 Section $Name_Section04 SEC04
590   SectionIn 3
591   SetOutPath "$INSTDIR"
592   !insertmacro OpenUninstallLog
593   !insertmacro InstallFile activex\axvlc.dll
594   !insertmacro InstallFile activex\axvlc.dll.manifest
595   !insertmacro CloseUninstallLog
596   RegDLL "$INSTDIR\axvlc.dll"
597 SectionEnd
598 !endif
599
600
601 Section $Name_Section05 SEC05
602   SectionIn 1 2 3
603   WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
604   WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
605     '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
606   WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
607   WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
608     '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
609
610   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
611   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" $Action_OnArrivalDVD
612   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
613   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
614   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "Open"
615   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
616
617   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
618   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" $Action_OnArrivalAudioCD
619   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
620   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
621   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "Open"
622   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
623   WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
624   WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Open"
625   WriteRegStr HKCR "VLC.DVDMovie\shell\Open\command" "" \
626     '"$INSTDIR\vlc.exe" --started-from-file dvd://%1'
627   WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
628   WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
629   WriteRegStr HKCR "VLC.CDAudio\shell" "" "Open"
630   WriteRegStr HKCR "VLC.CDAudio\shell\Open\command" "" \
631     '"$INSTDIR\vlc.exe" --started-from-file cdda://%1'
632   WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
633
634 SectionEnd
635
636
637 SectionGroup /e !$Name_Section06 SEC06
638   SectionGroup $Name_SectionGroupAudio
639     !insertmacro MacroAudioExtensions RegisterExtensionSection
640   SectionGroupEnd
641   SectionGroup $Name_SectionGroupVideo
642     !insertmacro MacroVideoExtensions RegisterExtensionSection
643   SectionGroupEnd
644   SectionGroup $Name_SectionGroupOther
645     !insertmacro MacroOtherExtensions RegisterExtensionSection
646   SectionGroupEnd
647 SectionGroupEnd
648
649 Section $Name_Section07 SEC07
650   SectionIn 1 3
651   !insertmacro MacroAllExtensions AddContextMenu
652   !insertmacro AddContextMenuExt "Directory"
653 SectionEnd
654
655 Section $Name_Section08 SEC08
656   !insertmacro delprefs
657 SectionEnd
658
659 ; Installer section descriptions
660 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
661   !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $Desc_Section01
662   !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} $Desc_Section02a
663   !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} $Desc_Section02b
664 @BUILD_MOZILLA_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $Desc_Section03
665 @BUILD_ACTIVEX_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $Desc_Section04
666   !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $Desc_Section05
667   !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $Desc_Section06
668   !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $Desc_Section07
669   !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $Desc_Section08
670 !insertmacro MUI_FUNCTION_DESCRIPTION_END
671
672 ;;; Start function
673 Function .onInit
674
675 UAC_Elevate:
676     UAC::RunElevated
677     StrCmp 1223 $0 UAC_ElevationAborted
678     StrCmp 0 $0 0 UAC_Err
679     StrCmp 1 $1 0 UAC_Success
680     Quit
681
682 UAC_Err:
683     MessageBox mb_iconstop "Unable to elevate, error $0"
684     Abort
685
686 UAC_ElevationAborted:
687     MessageBox mb_iconstop "This installer requires admin access, aborting!"
688     Abort
689
690 UAC_Success:
691     StrCmp 1 $3 +4
692     StrCmp 3 $1 0 UAC_ElevationAborted
693     MessageBox mb_iconstop "This installer requires admin access, try again"
694     goto UAC_Elevate
695   !insertmacro MUI_LANGDLL_DISPLAY
696
697   !include "languages\english.nsh"
698   StrCmp $LANGUAGE ${LANG_FRENCH} French 0
699   StrCmp $LANGUAGE ${LANG_GERMAN} German 0
700   StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
701   StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
702   StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
703   StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
704   StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
705   StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
706   StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
707   StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
708   StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
709   StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
710   StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
711   French:
712   !include "languages\french.nsh"
713   Goto EndLanguageCmp
714   German:
715   !include "languages\german.nsh"
716   Goto EndLanguageCmp
717   Italian:
718   !include "languages\italian.nsh"
719   Goto EndLanguageCmp
720   Hungarian:
721   !include "languages\hungarian.nsh"
722   Goto EndLanguageCmp
723   Romanian:
724   !include "languages\romanian.nsh"
725   Goto EndLanguageCmp
726   Catalan:
727   !include "languages\catalan.nsh"
728   Goto EndLanguageCmp
729   Bulgarian:
730   !include "languages\bulgarian.nsh"
731   Goto EndLanguageCmp
732   Slovak:
733   !include "languages\slovak.nsh"
734   Goto EndLanguageCmp
735   Polish:
736   !include "languages\polish.nsh"
737   Goto EndLanguageCmp
738   Dutch:
739   !include "languages\dutch.nsh"
740   Goto EndLanguageCmp
741   Schinese:
742   !include "languages\schinese.nsh"
743   Goto EndLanguageCmp
744   Finnish:
745   !include "languages\finnish.nsh"
746   Goto EndLanguageCmp
747   Brazilian:
748   !include "languages\brazilian_portuguese.nsh"
749   EndLanguageCmp:
750
751   ReadRegStr $R0  ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
752   "UninstallString"
753   StrCmp $R0 "" done
754
755   MessageBox MB_YESNO|MB_ICONEXCLAMATION $Message_AlreadyInstalled IDNO done
756
757   ;Run the uninstaller
758   ;uninst:
759     ClearErrors
760     ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
761   done:
762
763 FunctionEnd
764
765 Function .OnInstFailed
766     UAC::Unload
767 FunctionEnd
768
769 Function .OnInstSuccess
770     UAC::Unload
771 FunctionEnd
772 ;; End function
773 Section -Post
774   WriteUninstaller "$INSTDIR\uninstall.exe"
775   WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
776   WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
777   WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"
778
779   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
780     "DisplayName" "$(^Name)"
781   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
782     "UninstallString" "$INSTDIR\uninstall.exe"
783   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
784     "InstallLocation" "$INSTDIR"
785   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
786     "DisplayIcon" "$INSTDIR\vlc.exe"
787   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
788     "DisplayVersion" "${PRODUCT_VERSION}"
789   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
790     "URLInfoAbout" "${PRODUCT_WEB_SITE}"
791   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
792     "Publisher" "${PRODUCT_PUBLISHER}"
793   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
794     "VersionMajor"  "@VERSION_MAJOR@"
795   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
796     "VersionMinor" "@VERSION_MINOR@"
797 SectionEnd
798
799 ;;;;;;;;;;;;;;;;;;;;;;;;
800 ; Uninstaller sections ;
801 ;;;;;;;;;;;;;;;;;;;;;;;;
802
803 ; TrimNewlines (copied from NSIS documentation)
804 ; input, top of stack  (e.g. whatever$\r$\n)
805 ; output, top of stack (replaces, with e.g. whatever)
806 ; modifies no other variables.
807
808 Function un.TrimNewlines
809  Exch $R0
810  Push $R1
811  Push $R2
812  StrCpy $R1 0
813
814  loop:
815    IntOp $R1 $R1 - 1
816    StrCpy $R2 $R0 1 $R1
817    StrCmp $R2 "$\r" loop
818    StrCmp $R2 "$\n" loop
819    IntOp $R1 $R1 + 1
820    IntCmp $R1 0 no_trim_needed
821    StrCpy $R0 $R0 $R1
822
823  no_trim_needed:
824    Pop $R2
825    Pop $R1
826    Exch $R0
827 FunctionEnd
828
829 Function un.RemoveEmptyDirs
830   Pop $9
831   !define Index 'Line${__LINE__}'
832   FindFirst $0 $1 "$INSTDIR$9*"
833   StrCmp $0 "" "${Index}-End"
834   "${Index}-Loop:"
835     StrCmp $1 "" "${Index}-End"
836     StrCmp $1 "." "${Index}-Next"
837     StrCmp $1 ".." "${Index}-Next"
838       Push $0
839       Push $1
840       Push $9
841       Push "$9$1\"
842       Call un.RemoveEmptyDirs
843       Pop $9
844       Pop $1
845       Pop $0
846     "${Index}-Remove:"
847     RMDir "$INSTDIR$9$1"
848     "${Index}-Next:"
849     FindNext $0 $1
850     Goto "${Index}-Loop"
851   "${Index}-End:"
852   FindClose $0
853   !undef Index
854 FunctionEnd
855
856 Section "un.$Name_Section91" SEC91
857   SectionIn 1 2 3 RO
858   SetShellVarContext all
859
860   !insertmacro MacroAllExtensions DeleteContextMenu
861   !insertmacro MacroAllExtensions UnRegisterExtensionSection
862   !insertmacro DeleteContextMenuExt "Directory"
863
864   ;remove activex plugin
865   UnRegDLL "$INSTDIR\axvlc.dll"
866   Delete /REBOOTOK "$INSTDIR\axvlc.dll"
867   Delete /REBOOTOK "$INSTDIR\axvlc.dll.manifest"
868
869   ;remove mozilla plugin
870   Push $R0
871   Push $R1
872   Push $R2
873
874   !define Index 'Line${__LINE__}'
875   StrCpy $R1 "0"
876
877   "${Index}-Loop:"
878
879     ; Check for Key
880     EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
881     StrCmp $R0 "" "${Index}-End"
882     IntOp $R1 $R1 + 1
883     ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
884     StrCmp $R2 "" "${Index}-Loop" ""
885
886     ; old files (0.8.5 and before) that may be lying around
887     Delete /REBOOTOK "$R2\npvlc.dll"
888     Delete /REBOOTOK "$R2\libvlc.dll"
889     Delete /REBOOTOK "$R2\vlcintf.xpt"
890     Goto "${Index}-Loop"
891
892   "${Index}-End:"
893   !undef Index
894   Delete /REBOOTOK "$INSTDIR\npvlc.dll"
895   Delete /REBOOTOK "$INSTDIR\npvlc.dll.manifest"
896
897   RMDir "$SMPROGRAMS\VideoLAN"
898   RMDir /r $SMPROGRAMS\VideoLAN
899
900   FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
901   UninstallLoop:
902     ClearErrors
903     FileRead $UninstallLog $R0
904     IfErrors UninstallEnd
905     Push $R0
906     Call un.TrimNewLines
907     Pop $R0
908     Delete "$INSTDIR\$R0"
909     Goto UninstallLoop
910   UninstallEnd:
911   FileClose $UninstallLog
912   Delete "$INSTDIR\uninstall.log"
913   Delete "$INSTDIR\uninstall.exe"
914   Push "\"
915   Call un.RemoveEmptyDirs
916   RMDir "$INSTDIR"
917
918   DeleteRegKey HKLM Software\VideoLAN
919
920   DeleteRegKey HKCR Applications\vlc.exe
921   DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
922   DeleteRegKey HKCR DVD\shell\PlayWithVLC
923   DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
924   DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
925   DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
926   DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
927   DeleteRegKey HKLM Software\Clients\Media\VLC
928   DeleteRegValue HKLM "Software\RegisteredApplications" "VLC"
929   DeleteRegKey HKCR "VLC.MediaFile"
930
931   DeleteRegKey HKLM \
932     "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
933
934   DeleteRegKey HKLM \
935     "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
936
937   Delete "$DESKTOP\VLC media player.lnk"
938
939   DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
940   DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
941   SetAutoClose true
942 SectionEnd
943
944 Section /o "un.$Name_Section92" SEC92
945   !insertmacro delprefs
946 SectionEnd
947
948 ; Uninstaller section descriptions
949 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
950   !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} $Desc_Section91
951   !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} $Desc_Section92
952 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
953
954 Function un.OnUnInstFailed
955     UAC::Unload
956 FunctionEnd
957
958 Function un.OnUnInstSuccess
959     UAC::Unload
960     Delete "$INSTDIR\UAC.dll"
961 FunctionEnd
962
963 Function un.onInit
964
965 UAC_Elevate:
966     UAC::RunElevated
967     StrCmp 1223 $0 UAC_ElevationAborted
968     StrCmp 0 $0 0 UAC_Err
969     StrCmp 1 $1 0 UAC_Success
970     Quit
971
972 UAC_Err:
973     MessageBox mb_iconstop "Unable to elevate, error $0"
974     Abort
975
976 UAC_ElevationAborted:
977     MessageBox mb_iconstop "This installer requires admin access, aborting!"
978     Abort
979
980 UAC_Success:
981     StrCmp 1 $3 +4
982     StrCmp 3 $1 0 UAC_ElevationAborted
983     MessageBox mb_iconstop "This installer requires admin access, try again"
984     goto UAC_Elevate
985
986   !insertmacro MUI_UNGETLANGUAGE
987
988   !include "languages\english.nsh"
989   StrCmp $LANGUAGE ${LANG_FRENCH} French 0
990   StrCmp $LANGUAGE ${LANG_GERMAN} German 0
991   StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
992   StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
993   StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
994   StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
995   StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
996   StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
997   StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
998   StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
999   StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
1000   StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
1001   StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
1002   French:
1003   !include "languages\french.nsh"
1004   Goto EndLanguageCmp
1005   German:
1006   !include "languages\german.nsh"
1007   Goto EndLanguageCmp
1008   Italian:
1009   !include "languages\italian.nsh"
1010   Goto EndLanguageCmp
1011   Hungarian:
1012   !include "languages\hungarian.nsh"
1013   Goto EndLanguageCmp
1014   Romanian:
1015   !include "languages\romanian.nsh"
1016   Goto EndLanguageCmp
1017   Catalan:
1018   !include "languages\catalan.nsh"
1019   Goto EndLanguageCmp
1020   Bulgarian:
1021   !include "languages\bulgarian.nsh"
1022   Goto EndLanguageCmp
1023   Slovak:
1024   !include "languages\slovak.nsh"
1025   Goto EndLanguageCmp
1026   Polish:
1027   !include "languages\polish.nsh"
1028   Goto EndLanguageCmp
1029   Dutch:
1030   !include "languages\dutch.nsh"
1031   Goto EndLanguageCmp
1032   Schinese:
1033   !include "languages\schinese.nsh"
1034   Goto EndLanguageCmp
1035   Finnish:
1036   !include "languages\finnish.nsh"
1037   Goto EndLanguageCmp
1038   Brazilian:
1039   !include "languages\brazilian_portuguese.nsh"
1040   EndLanguageCmp:
1041
1042 FunctionEnd