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