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