vlc.win32.nsi.in
上传用户:kjfoods
上传日期:2020-07-06
资源大小:29949k
文件大小:32k
源码类别:

midi

开发平台:

Unix_Linux

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ; NSIS installer script for vlc ;
  3. ; (http://nsis.sourceforge.net) ;
  4. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5. !include "languagesdeclaration.nsh"
  6. !define PRODUCT_NAME "VLC media player"
  7. !define VERSION @VERSION@
  8. !define PRODUCT_VERSION @VERSION@
  9. !define PRODUCT_GROUP "VideoLAN"
  10. !define PRODUCT_PUBLISHER "VideoLAN Team"
  11. !define PRODUCT_WEB_SITE "http://www.videolan.org"
  12. !define PRODUCT_DIR_REGKEY "SoftwareVideoLANVLC"
  13. !define PRODUCT_UNINST_KEY "SoftwareMicrosoftWindowsCurrentVersionUninstall${PRODUCT_NAME}"
  14. !define PRODUCT_UNINST_ROOT_KEY "HKLM"
  15. !define PRODUCT_ID "{ea92ef52-afe4-4212-bacb-dfe9fca94cd6}"
  16. !define MUI_LANGDLL_REGISTRY_ROOT "HKLM"
  17. !define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_DIR_REGKEY}"
  18. !define MUI_LANGDLL_REGISTRY_VALUENAME "Language"
  19. @BUILD_ACTIVEX_TRUE@ !define INSTALL_ACTIVEX
  20. @BUILD_MOZILLA_TRUE@ !define INSTALL_MOZILLA
  21. @FILE_LIBVLCCORE_DLL@
  22. @FILE_LIBVLC_DLL@
  23. ;;;;;;;;;;;;;;;;;;;;;;;;;
  24. ; General configuration ;
  25. ;;;;;;;;;;;;;;;;;;;;;;;;;
  26. Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
  27. OutFile ..vlc-${VERSION}-win32.exe
  28. InstallDir "$PROGRAMFILESVideoLANVLC"
  29. InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
  30. !ifdef NSIS_LZMA_COMPRESS_WHOLE
  31. SetCompressor lzma
  32. !else
  33. SetCompressor /SOLID lzma
  34. !endif
  35. ;ShowInstDetails show
  36. ;ShowUnInstDetails show
  37. SetOverwrite ifnewer
  38. CRCCheck on
  39. BrandingText "${PRODUCT_GROUP} ${PRODUCT_NAME}"
  40. InstType $Name_InstTypeRecommended
  41. InstType $Name_InstTypeMinimum
  42. InstType $Name_InstTypeFull
  43. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  44. ; NSIS Modern User Interface configuration ;
  45. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  46. ; MUI 1.67 compatible ------
  47.   !include "MUI.nsh"
  48. ; MUI Settings
  49.   !define MUI_ABORTWARNING
  50.   !define MUI_ICON "vlc.ico"
  51.   !define MUI_UNICON "vlc.ico"
  52.   !define MUI_COMPONENTSPAGE_SMALLDESC
  53. ; Installer pages
  54.   ; Welcome page
  55.     !define MUI_WELCOMEPAGE_TITLE_3LINES
  56.     !insertmacro MUI_PAGE_WELCOME
  57.   ; License page
  58.     !insertmacro MUI_PAGE_LICENSE "COPYING.txt"
  59.   ; Components page
  60.     !insertmacro MUI_PAGE_COMPONENTS
  61.   ; Directory page
  62.     !insertmacro MUI_PAGE_DIRECTORY
  63.   ; Instfiles page
  64.     !insertmacro MUI_PAGE_INSTFILES
  65.   ; Finish page
  66.     !define MUI_FINISHPAGE_RUN "$INSTDIRvlc.exe"
  67.     !define MUI_FINISHPAGE_SHOWREADME "$INSTDIRREADME.txt"
  68.     !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
  69.     !define MUI_FINISHPAGE_LINK $Link_VisitWebsite
  70.     !define MUI_FINISHPAGE_LINK_LOCATION "http://www.videolan.org/vlc/"
  71.     !define MUI_FINISHPAGE_NOREBOOTSUPPORT
  72.     !insertmacro MUI_PAGE_FINISH
  73. ; Uninstaller pages
  74.     !insertmacro MUI_UNPAGE_CONFIRM
  75.     !insertmacro MUI_UNPAGE_COMPONENTS
  76.     !insertmacro MUI_UNPAGE_INSTFILES
  77.     !insertmacro MUI_UNPAGE_FINISH
  78. ; Language files
  79.   !insertmacro MUI_LANGUAGE "English" # first language is the default language
  80.   !insertmacro MUI_LANGUAGE "French"
  81.   !insertmacro MUI_LANGUAGE "German"
  82.   !insertmacro MUI_LANGUAGE "Spanish"
  83.   !insertmacro MUI_LANGUAGE "SimpChinese"
  84.   !insertmacro MUI_LANGUAGE "TradChinese"
  85.   !insertmacro MUI_LANGUAGE "Japanese"
  86.   !insertmacro MUI_LANGUAGE "Korean"
  87.   !insertmacro MUI_LANGUAGE "Italian"
  88.   !insertmacro MUI_LANGUAGE "Dutch"
  89.   !insertmacro MUI_LANGUAGE "Danish"
  90.   !insertmacro MUI_LANGUAGE "Swedish"
  91.   !insertmacro MUI_LANGUAGE "Norwegian"
  92.   !insertmacro MUI_LANGUAGE "Finnish"
  93.   !insertmacro MUI_LANGUAGE "Greek"
  94.   !insertmacro MUI_LANGUAGE "Russian"
  95.   !insertmacro MUI_LANGUAGE "Portuguese"
  96.   !insertmacro MUI_LANGUAGE "PortugueseBR"
  97.   !insertmacro MUI_LANGUAGE "Arabic"
  98.   !insertmacro MUI_LANGUAGE "Polish"
  99.   !insertmacro MUI_LANGUAGE "Romanian"
  100.   !insertmacro MUI_LANGUAGE "Slovak"
  101.   !insertmacro MUI_LANGUAGE "Czech"
  102.   !insertmacro MUI_LANGUAGE "Hungarian"
  103.   !insertmacro MUI_LANGUAGE "Catalan"
  104.   !insertmacro MUI_LANGUAGE "Bulgarian"
  105. ; Reserve files for solid compression
  106.   !insertmacro MUI_RESERVEFILE_LANGDLL
  107.   !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
  108. ; MUI end ------
  109. ;;;;;;;;;;;;;;;;;;;;;;;
  110. ; Macro and Functions ;
  111. ;;;;;;;;;;;;;;;;;;;;;;;
  112. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  113. ; 1. File type associations ;
  114. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  115. ;; Function that register one extension for VLC
  116. Function RegisterExtension
  117.   ; back up old value for extension $R0 (eg. ".opt")
  118.   ReadRegStr $1 HKCR "$R0" ""
  119.   StrCmp $1 "" NoBackup
  120.     StrCmp $1 "VLC$R0" "NoBackup"
  121.     WriteRegStr HKCR "$R0" "VLC.backup" $1
  122. NoBackup:
  123.   WriteRegStr HKCR "$R0" "" "VLC$R0"
  124.   ReadRegStr $0 HKCR "VLC$R0" ""
  125.   WriteRegStr HKCR "VLC$R0" "" "VLC media file ($R0)"
  126.   WriteRegStr HKCR "VLC$R0shell" "" "Open"
  127.   WriteRegStr HKCR "VLC$R0shellOpen" "" $ShellAssociation_Play
  128.   WriteRegStr HKCR "VLC$R0shellOpencommand" "" '"$INSTDIRvlc.exe" --started-from-file "%1"'
  129.   WriteRegStr HKCR "VLC$R0DefaultIcon" "" '"$INSTDIRvlc.exe",0'
  130. ;;; Vista Only part
  131.   ; Vista detection
  132.   ReadRegStr $R1 HKLM "SOFTWAREMicrosoftWindows NTCurrentVersion" CurrentVersion
  133.   StrCpy $R2 $R1 3
  134.   StrCmp $R2 '6.0' ForVista ToEnd
  135. ForVista:
  136.   WriteRegStr HKLM "SoftwareClientsMediaVLCCapabilitiesFileAssociations" "$R0" "VLC$R0"
  137. ToEnd:
  138. FunctionEnd
  139. ;; Function that removes one extension that VLC owns.
  140. Function un.RegisterExtension
  141.   ;start of restore script
  142.   ReadRegStr $1 HKCR "$R0" ""
  143.   StrCmp $1 "VLC$R0" 0 NoOwn ; only do this if we own it
  144.     ; Read the old value from Backup
  145.     ReadRegStr $1 HKCR "$R0" "VLC.backup"
  146.     StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key
  147.       DeleteRegKey HKCR "$R0"
  148.     Goto NoOwn
  149. Restore:
  150.       WriteRegStr HKCR "$R0" "" $1
  151.       DeleteRegValue HKCR "$R0" "VLC.backup"
  152. NoOwn:
  153.     DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings
  154.     DeleteRegKey HKLM "SoftwareClientsMediaVLCCapabilitiesFileAssociationsVLC$R0" ; for vista
  155. FunctionEnd
  156. !macro RegisterExtensionSection EXT
  157.   Section ${EXT}
  158.     SectionIn 1 3
  159.     Push $R0
  160.     StrCpy $R0 ${EXT}
  161.     Call RegisterExtension
  162.     Pop $R0
  163.   SectionEnd
  164. !macroend
  165. !macro UnRegisterExtensionSection EXT
  166.   Push $R0
  167.   StrCpy $R0 ${EXT}
  168.   Call un.RegisterExtension
  169.   Pop $R0
  170. !macroend
  171. !macro WriteRegStrSupportedTypes EXT
  172.   WriteRegStr HKCR Applicationsvlc.exeSupportedTypes ${EXT} ""
  173. !macroend
  174. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  175. ; Extension lists  Macros                    ;
  176. ; Those macros calls the previous functions  ;
  177. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  178. !macro MacroAudioExtensions _action
  179.   !insertmacro ${_action} ".a52"
  180.   !insertmacro ${_action} ".aac"
  181.   !insertmacro ${_action} ".ac3"
  182.   !insertmacro ${_action} ".dts"
  183.   !insertmacro ${_action} ".flac"
  184.   !insertmacro ${_action} ".m4a"
  185.   !insertmacro ${_action} ".m4p"
  186.   !insertmacro ${_action} ".mka"
  187.   !insertmacro ${_action} ".mod"
  188.   !insertmacro ${_action} ".mp1"
  189.   !insertmacro ${_action} ".mp2"
  190.   !insertmacro ${_action} ".mp3"
  191.   !insertmacro ${_action} ".oma"
  192.   !insertmacro ${_action} ".oga"
  193.   !insertmacro ${_action} ".spx"
  194.   !insertmacro ${_action} ".tta"
  195.   !insertmacro ${_action} ".wav"
  196.   !insertmacro ${_action} ".wma"
  197.   !insertmacro ${_action} ".wv"
  198.   !insertmacro ${_action} ".xm"
  199. !macroend
  200. !macro MacroVideoExtensions _action
  201.   !insertmacro ${_action} ".asf"
  202.   !insertmacro ${_action} ".avi"
  203.   !insertmacro ${_action} ".divx"
  204.   !insertmacro ${_action} ".dv"
  205.   !insertmacro ${_action} ".flv"
  206.   !insertmacro ${_action} ".gxf"
  207.   !insertmacro ${_action} ".m1v"
  208.   !insertmacro ${_action} ".m2v"
  209.   !insertmacro ${_action} ".m2ts"
  210.   !insertmacro ${_action} ".m4v"
  211.   !insertmacro ${_action} ".mkv"
  212.   !insertmacro ${_action} ".mov"
  213.   !insertmacro ${_action} ".mp4"
  214.   !insertmacro ${_action} ".mpeg"
  215.   !insertmacro ${_action} ".mpeg1"
  216.   !insertmacro ${_action} ".mpeg2"
  217.   !insertmacro ${_action} ".mpeg4"
  218.   !insertmacro ${_action} ".mpg"
  219.   !insertmacro ${_action} ".mts"
  220.   !insertmacro ${_action} ".mxf"
  221.   !insertmacro ${_action} ".nuv"
  222.   !insertmacro ${_action} ".ogg"
  223.   !insertmacro ${_action} ".ogm"
  224.   !insertmacro ${_action} ".ogx"
  225.   !insertmacro ${_action} ".ogv"
  226.   !insertmacro ${_action} ".rmvb"
  227.   !insertmacro ${_action} ".ts"
  228.   !insertmacro ${_action} ".vob"
  229.   !insertmacro ${_action} ".wmv"
  230. !macroend
  231. !macro MacroOtherExtensions _action
  232.   !insertmacro ${_action} ".asx"
  233.   !insertmacro ${_action} ".bin"
  234.   !insertmacro ${_action} ".cue"
  235.   !insertmacro ${_action} ".ifo"
  236.   !insertmacro ${_action} ".m3u"
  237.   !insertmacro ${_action} ".pls"
  238.   !insertmacro ${_action} ".vlc"
  239.   !insertmacro ${_action} ".xspf"
  240. !macroend
  241. ; One macro to rule them all
  242. !macro MacroAllExtensions _action
  243.   !insertmacro MacroAudioExtensions ${_action}
  244.   !insertmacro MacroVideoExtensions ${_action}
  245.   !insertmacro MacroOtherExtensions ${_action}
  246. !macroend
  247. ;;;;;;;;;;;;;;;;;;;;;;;;;;;
  248. ; 2. Context menu entries ;
  249. ;;;;;;;;;;;;;;;;;;;;;;;;;;;
  250. ; Generic function for adding the context menu for one ext.
  251. !macro AddContextMenuExt EXT
  252.   WriteRegStr HKCR ${EXT}shellPlayWithVLC "" $ContextMenuEntry_PlayWith
  253.   WriteRegStr HKCR ${EXT}shellPlayWithVLCcommand "" '"$INSTDIRvlc.exe" --started-from-file --no-playlist-enqueue "%1"'
  254.   WriteRegStr HKCR ${EXT}shellAddToPlaylistVLC "" $ContextMenuEntry_AddToPlaylist
  255.   WriteRegStr HKCR ${EXT}shellAddToPlaylistVLCcommand "" '"$INSTDIRvlc.exe" --started-from-file --playlist-enqueue "%1"'
  256. !macroend
  257. !macro AddContextMenu EXT
  258.   Push $R0
  259.   ReadRegStr $R0 HKCR ${EXT} ""
  260.   !insertmacro AddContextMenuExt $R0
  261.   Pop $R0
  262. !macroend
  263. !macro DeleteContextMenuExt EXT
  264.   DeleteRegKey HKCR ${EXT}shellPlayWithVLC
  265.   DeleteRegKey HKCR ${EXT}shellAddToPlaylistVLC
  266. !macroend
  267. !macro DeleteContextMenu EXT
  268.   Push $R0
  269.   ReadRegStr $R0 HKCR ${EXT} ""
  270.   !insertmacro DeleteContextMenuExt $R0
  271.   Pop $R0
  272. !macroend
  273. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  274. ; 3. Delete prefs and cache ;
  275. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  276. !macro delprefs
  277.   StrCpy $0 0
  278.   !define Index 'Line${__LINE__}'
  279.   "${Index}-Loop:"
  280.   ; FIXME
  281.   ; this will loop through all the logged users and "virtual" windows users
  282.   ; (it looks like users are only present in HKEY_USERS when they are logged in)
  283.     ClearErrors
  284.     EnumRegKey $1 HKU "" $0
  285.     StrCmp $1 "" "${Index}-End"
  286.     IntOp $0 $0 + 1
  287.     ReadRegStr $2 HKU "$1SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders" AppData
  288.     StrCmp $2 "" "${Index}-Loop"
  289.     RMDir /r "$2vlc"
  290.     Goto "${Index}-Loop"
  291.   "${Index}-End:"
  292.   !undef Index
  293. !macroend
  294. ;;;;;;;;;;;;;;;
  295. ; 4. Logging  ;
  296. ;;;;;;;;;;;;;;;
  297. Var UninstallLog
  298. !macro OpenUninstallLog
  299.   FileOpen $UninstallLog "$INSTDIRuninstall.log" a
  300.   FileSeek $UninstallLog 0 END
  301. !macroend
  302. !macro CloseUninstallLog
  303.   FileClose $UninstallLog
  304.   SetFileAttributes "$INSTDIRuninstall.log" HIDDEN
  305. !macroend
  306. ;;;;;;;;;;;;;;;;;;;;
  307. ; 5. Installations ;
  308. ;;;;;;;;;;;;;;;;;;;;
  309. !macro InstallFile FILEREGEX
  310.   File "${FILEREGEX}"
  311.   !define Index 'Line${__LINE__}'
  312.   FindFirst $0 $1 "$INSTDIR${FILEREGEX}"
  313.   StrCmp $0 "" "${Index}-End"
  314.   "${Index}-Loop:"
  315.     StrCmp $1 "" "${Index}-End"
  316.     FileWrite $UninstallLog "$1$r$n"
  317.     FindNext $0 $1
  318.     Goto "${Index}-Loop"
  319.   "${Index}-End:"
  320.   !undef Index
  321. !macroend
  322. !macro InstallFolder FOLDER
  323.   File /r "${FOLDER}"
  324.   Push "${FOLDER}"
  325.   Call InstallFolderInternal
  326. !macroend
  327. Function InstallFolderInternal
  328.   Pop $9
  329.   !define Index 'Line${__LINE__}'
  330.   FindFirst $0 $1 "$INSTDIR$9*"
  331.   StrCmp $0 "" "${Index}-End"
  332.   "${Index}-Loop:"
  333.     StrCmp $1 "" "${Index}-End"
  334.     StrCmp $1 "." "${Index}-Next"
  335.     StrCmp $1 ".." "${Index}-Next"
  336.     IfFileExists "$9$1*" 0 "${Index}-Write"
  337.       Push $0
  338.       Push $9
  339.       Push "$9$1"
  340.       Call InstallFolderInternal
  341.       Pop $9
  342.       Pop $0
  343.       Goto "${Index}-Next"
  344.     "${Index}-Write:"
  345.     FileWrite $UninstallLog "$9$1$r$n"
  346.     "${Index}-Next:"
  347.     FindNext $0 $1
  348.     Goto "${Index}-Loop"
  349.   "${Index}-End:"
  350.   !undef Index
  351. FunctionEnd
  352. ;;; End of Macros
  353. ;;;;;;;;;;;;;;;;;;;;;;
  354. ; Installer sections ;
  355. ; The CORE of the    ;
  356. ; installer          ;
  357. ;;;;;;;;;;;;;;;;;;;;;;
  358.   
  359. Section $Name_Section01 SEC01
  360.   SectionIn 1 2 3 RO
  361.   SetShellVarContext all
  362.   SetOutPath "$INSTDIR"
  363.   !insertmacro OpenUninstallLog
  364.   ; VLC.exe, libvlc.dll
  365.   !insertmacro InstallFile vlc.exe
  366.   !insertmacro InstallFile vlc.exe.manifest
  367.   ; All dlls
  368.   !insertmacro InstallFile *.dll
  369.   ; Text files
  370.   !insertmacro InstallFile *.txt
  371.   ; Subfolders
  372.   !insertmacro InstallFolder plugins
  373.   !insertmacro InstallFolder locale
  374. @BUILD_OSDMENU_TRUE@ !insertmacro InstallFolder osdmenu
  375. @BUILD_SKINS_TRUE@   !insertmacro InstallFolder skins
  376. @BUILD_HTTPD_TRUE@   !insertmacro InstallFolder http
  377. @BUILD_LUA_TRUE@     !insertmacro InstallFolder lua
  378.   ; URLs
  379.   WriteIniStr "$INSTDIR${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" 
  380.     "${PRODUCT_WEB_SITE}"
  381.   FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$r$n"
  382.   WriteIniStr "$INSTDIRDocumentation.url" "InternetShortcut" "URL" 
  383.     "${PRODUCT_WEB_SITE}/doc/"
  384.   FileWrite $UninstallLog "Documentation.url$r$n"
  385.   WriteIniStr "$INSTDIRNew_Skins.url" "InternetShortcut" "URL" 
  386.     "${PRODUCT_WEB_SITE}/vlc/skins.php"
  387.   FileWrite $UninstallLog "New_Skins.url$r$n"
  388.   !insertmacro CloseUninstallLog
  389.   ; Add VLC to "recomended programs" for the following extensions
  390.   WriteRegStr HKCR Applicationsvlc.exe "" ""
  391.   WriteRegStr HKCR Applicationsvlc.exe "FriendlyAppName" "VLC media player"
  392.   WriteRegStr HKCR Applicationsvlc.exeshellOpen "" $ContextMenuEntry_PlayWith
  393.   WriteRegStr HKCR Applicationsvlc.exeshellOpencommand "" 
  394.     '"$INSTDIRvlc.exe" --started-from-file "%1"'
  395.   !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
  396. ; Vista Registration
  397.   ; Vista detection
  398.   ReadRegStr $R0 HKLM "SOFTWAREMicrosoftWindows NTCurrentVersion" CurrentVersion
  399.   StrCpy $R1 $R0 3
  400.   StrCmp $R1 '6.0' lbl_vista lbl_done
  401.   lbl_vista:
  402.   WriteRegStr HKLM "SoftwareRegisteredApplications" "VLC" "SoftwareClientsMediaVLCCapabilities"
  403.   WriteRegStr HKLM "SoftwareClientsMediaVLCCapabilities" "ApplicationName" "VLC media player"
  404.   WriteRegStr HKLM "SoftwareClientsMediaVLCCapabilities" "ApplicationDescription" "VLC - The video swiss knife"
  405.   lbl_done:
  406. SectionEnd
  407. Section $Name_Section02a SEC02a
  408.   SectionIn 1 2 3
  409.   CreateDirectory "$SMPROGRAMSVideoLAN"
  410.   CreateDirectory "$SMPROGRAMSVideoLANQuick Settings"
  411.   CreateDirectory "$SMPROGRAMSVideoLANQuick SettingsAudio"
  412.   CreateShortCut "$SMPROGRAMSVideoLANQuick SettingsAudioSet Audio mode to DirectX (default).lnk" 
  413.     "$INSTDIRvlc.exe" "--aout aout_directx --save-config vlc://quit"
  414.   CreateShortCut "$SMPROGRAMSVideoLANQuick SettingsAudioSet Audio mode to Waveout.lnk" 
  415.     "$INSTDIRvlc.exe" "--aout waveout --save-config vlc://quit"
  416.   CreateDirectory "$SMPROGRAMSVideoLANQuick SettingsInterface"
  417. @BUILD_SKINS_TRUE@  CreateShortCut "$SMPROGRAMSVideoLANQuick SettingsInterfaceSet Main Interface to Skinnable.lnk" 
  418. @BUILD_SKINS_TRUE@    "$INSTDIRvlc.exe" "-I skins --save-config vlc://quit"
  419.   CreateShortCut "$SMPROGRAMSVideoLANQuick SettingsInterfaceSet Main Interface to Qt (default).lnk" 
  420.     "$INSTDIRvlc.exe" "-I qt --save-config vlc://quit"
  421.   CreateDirectory "$SMPROGRAMSVideoLANQuick SettingsVideo"
  422.   ; FIXME add detection for Vista. Direct3D will be default there, for all others it's DirectX
  423.   CreateShortCut "$SMPROGRAMSVideoLANQuick SettingsVideoSet Video mode to Direct3D.lnk" 
  424.     "$INSTDIRvlc.exe" "--vout direct3d --overlay --directx-hw-yuv --save-config vlc://quit"
  425.   CreateShortCut "$SMPROGRAMSVideoLANQuick SettingsVideoSet Video mode to Direct3D (no hardware acceleration).lnk" 
  426.     "$INSTDIRvlc.exe" "--vout direct3d --overlay --no-directx-hw-yuv --save-config vlc://quit"
  427.   CreateShortCut "$SMPROGRAMSVideoLANQuick SettingsVideoSet Video mode to DirectX.lnk" 
  428.     "$INSTDIRvlc.exe" "--vout directx --overlay --directx-hw-yuv --save-config vlc://quit"
  429.   CreateShortCut "$SMPROGRAMSVideoLANQuick SettingsVideoSet Video mode to DirectX (no hardware acceleration).lnk" 
  430.     "$INSTDIRvlc.exe" "--vout directx --no-overlay --no-directx-hw-yuv --save-config vlc://quit"
  431.   CreateShortCut "$SMPROGRAMSVideoLANQuick SettingsVideoSet Video mode to DirectX (no video overlay).lnk" 
  432.     "$INSTDIRvlc.exe" "--vout directx --no-overlay --directx-hw-yuv --save-config vlc://quit"
  433.   CreateShortCut "$SMPROGRAMSVideoLANQuick SettingsVideoSet Video mode to OpenGL.lnk" 
  434.     "$INSTDIRvlc.exe" "--vout opengl --overlay --save-config vlc://quit"
  435.   CreateShortCut "$SMPROGRAMSVideoLANQuick SettingsReset VLC media player preferences and cache files.lnk" 
  436.     "$INSTDIRvlc.exe" "--reset-config --reset-plugins-cache vlc://quit"
  437.   CreateShortCut "$SMPROGRAMSVideoLANDocumentation.lnk" 
  438.     "$INSTDIRDocumentation.url"
  439.   CreateShortCut "$SMPROGRAMSVideoLANRelease Notes.lnk" 
  440.     "$INSTDIRNEWS.txt" ""
  441.   CreateShortCut "$SMPROGRAMSVideoLAN${PRODUCT_GROUP} Website.lnk" 
  442.     "$INSTDIR${PRODUCT_GROUP} Website.url"
  443.   CreateShortCut "$SMPROGRAMSVideoLANVLC media player.lnk" 
  444.     "$INSTDIRvlc.exe" ""
  445. SectionEnd
  446. Section $Name_Section02b SEC02b
  447.   SectionIn 1 2 3
  448.   CreateShortCut "$DESKTOPVLC media player.lnk" 
  449.     "$INSTDIRvlc.exe" ""
  450. SectionEnd
  451. !ifdef INSTALL_MOZILLA
  452. Section /o $Name_Section03 SEC03
  453.   SectionIn 3
  454.   SetOutPath "$INSTDIR"
  455.   !insertmacro OpenUninstallLog
  456.   !insertmacro InstallFile mozillanpvlc.dll
  457.   !insertmacro InstallFile mozillanpvlc.dll.manifest
  458.   !insertmacro CloseUninstallLog
  459.   !define Moz "SOFTWAREMozillaPlugins@videolan.org/vlc,version=${VERSION}"
  460.   WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
  461.   WriteRegStr HKLM ${Moz} "Path" "$INSTDIRnpvlc.dll"
  462.   WriteRegStr HKLM ${Moz} "Product" "VLC media player"
  463.   WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
  464.   WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
  465.  ; for very old version of mozilla, these lines may be needed
  466.  ;Push $R0
  467.  ;Push $R1
  468.  ;Push $R2
  469.  ;!define Index 'Line${__LINE__}'
  470.  ;StrCpy $R1 "0"
  471.  ;"${Index}-Loop:"
  472.  ;  ; Check for Key
  473.  ;  EnumRegKey $R0 HKLM "SOFTWAREMozilla" "$R1"
  474.  ;  StrCmp $R0 "" "${Index}-End"
  475.  ;  IntOp $R1 $R1 + 1
  476.  ;  ReadRegStr $R2 HKLM "SOFTWAREMozilla$R0Extensions" "Plugins"
  477.  ;  StrCmp $R2 "" "${Index}-Loop" ""
  478.  ;  CopyFiles "$INSTDIRnpvlc.dll" "$R2"
  479.  ;  !ifdef LIBVLC_DLL
  480.  ;  CopyFiles ${LIBVLC_DLL} "$R2"
  481.  ;  !endif
  482.  ;  !ifdef LIBVLC_CONTROL_DLL
  483.  ;  CopyFiles ${LIBVLC_CONTROL_DLL} "$R2"
  484.  ;  !endif
  485.  ;  Goto "${Index}-Loop"
  486.  ;"${Index}-End:"
  487.  ;!undef Index
  488. SectionEnd
  489. !endif
  490. !ifdef INSTALL_ACTIVEX
  491. Section $Name_Section04 SEC04
  492.   SectionIn 3
  493.   SetOutPath "$INSTDIR"
  494.   !insertmacro OpenUninstallLog
  495.   !insertmacro InstallFile activexaxvlc.dll
  496.   !insertmacro InstallFile activexaxvlc.dll.manifest
  497.   !insertmacro CloseUninstallLog
  498.   RegDLL "$INSTDIRaxvlc.dll"
  499. SectionEnd
  500. !endif
  501. Section $Name_Section05 SEC05
  502.   SectionIn 1 2 3
  503.   WriteRegStr HKCR "AudioCDshellPlayWithVLC" "" $ContextMenuEntry_PlayWith
  504.   WriteRegStr HKCR "AudioCDshellPlayWithVLCcommand" "" 
  505.     '"$INSTDIRvlc.exe" --started-from-file cdda://%1'
  506.   WriteRegStr HKCR "DVDshellPlayWithVLC" "" $ContextMenuEntry_PlayWith
  507.   WriteRegStr HKCR "DVDshellPlayWithVLCcommand" "" 
  508.     '"$INSTDIRvlc.exe" --started-from-file dvd://%1'
  509.   WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersEventHandlersPlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
  510.   WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayDVDMovieOnArrival" "Action" $Action_OnArrivalDVD
  511.   WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIRvlc.exe",0'
  512.   WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
  513.   WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayDVDMovieOnArrival" "InvokeVerb" "play"
  514.   WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"
  515.   WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersEventHandlersPlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
  516.   WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayCDAudioOnArrival" "Action" $Action_OnArrivalAudioCD
  517.   WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIRvlc.exe",0'
  518.   WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
  519.   WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayCDAudioOnArrival" "InvokeVerb" "play"
  520.   WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
  521.   WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
  522.   WriteRegStr HKCR "VLC.DVDMovieshell" "" "Open"
  523.   WriteRegStr HKCR "VLC.DVDMovieshellOpencommand" "" 
  524.     '"$INSTDIRvlc.exe" --started-from-file dvd://%1'
  525.   WriteRegStr HKCR "VLC.DVDMovieDefaultIcon" "" '"$INSTDIRvlc.exe",0'
  526.   WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
  527.   WriteRegStr HKCR "VLC.CDAudioshell" "" "Open"
  528.   WriteRegStr HKCR "VLC.CDAudioshellOpencommand" "" 
  529.     '"$INSTDIRvlc.exe" --started-from-file cdda://%1'
  530.   WriteRegStr HKCR "VLC.CDAudioDefaultIcon" "" '"$INSTDIRvlc.exe",0'
  531. SectionEnd
  532. SectionGroup /e !$Name_Section06 SEC06
  533.   SectionGroup $Name_SectionGroupAudio
  534.     !insertmacro MacroAudioExtensions RegisterExtensionSection
  535.   SectionGroupEnd
  536.   SectionGroup $Name_SectionGroupVideo
  537.     !insertmacro MacroVideoExtensions RegisterExtensionSection
  538.   SectionGroupEnd
  539.   SectionGroup $Name_SectionGroupOther
  540.     !insertmacro MacroOtherExtensions RegisterExtensionSection
  541.   SectionGroupEnd
  542. SectionGroupEnd
  543. Section $Name_Section07 SEC07
  544.   SectionIn 1 3
  545.   !insertmacro MacroAllExtensions AddContextMenu
  546.   !insertmacro AddContextMenuExt "Directory"
  547. SectionEnd
  548. Section $Name_Section08 SEC08
  549.   !insertmacro delprefs
  550. SectionEnd
  551. ; Installer section descriptions
  552. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  553.   !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $Desc_Section01
  554.   !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} $Desc_Section02a
  555.   !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} $Desc_Section02b
  556. @BUILD_MOZILLA_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $Desc_Section03
  557. @BUILD_ACTIVEX_TRUE@ !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $Desc_Section04
  558.   !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $Desc_Section05
  559.   !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $Desc_Section06
  560.   !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $Desc_Section07
  561.   !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $Desc_Section08
  562. !insertmacro MUI_FUNCTION_DESCRIPTION_END
  563. ;;; Start function
  564. Function .onInit
  565.   !insertmacro MUI_LANGDLL_DISPLAY
  566.   !include "languagesenglish.nsh"
  567.   StrCmp $LANGUAGE ${LANG_FRENCH} French 0
  568.   StrCmp $LANGUAGE ${LANG_GERMAN} German 0
  569.   StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
  570.   StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
  571.   StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
  572.   StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
  573.   StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
  574.   StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
  575.   StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
  576.   StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
  577.   StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
  578.   StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
  579. ;  StrCmp $LANGUAGE ${LANG_BENGALI} Bengali 0
  580. ;  StrCmp $LANGUAGE ${LANG_PUNJABI} Punjabi 0
  581. ;  StrCmp $LANGUAGE ${LANG_SLOVENIAN} Slovenian 0
  582.   StrCmp $LANGUAGE ${LANG_SPANISH} Spanish 0
  583.   StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
  584.   French:
  585.   !include "languagesfrench.nsh"
  586.   Goto EndLanguageCmp
  587.   German:
  588.   !include "languagesgerman.nsh"
  589.   Goto EndLanguageCmp
  590.   Italian:
  591.   !include "languagesitalian.nsh"
  592.   Goto EndLanguageCmp
  593.   Hungarian:
  594.   !include "languageshungarian.nsh"
  595.   Goto EndLanguageCmp
  596.   Romanian:
  597.   !include "languagesromanian.nsh"
  598.   Goto EndLanguageCmp
  599.   Catalan:
  600.   !include "languagescatalan.nsh"
  601.   Goto EndLanguageCmp
  602.   Bulgarian:
  603.   !include "languagesbulgarian.nsh"
  604.   Goto EndLanguageCmp
  605.   Slovak:
  606.   !include "languagesslovak.nsh"
  607.   Goto EndLanguageCmp
  608.   Polish:
  609.   !include "languagespolish.nsh"
  610.   Goto EndLanguageCmp
  611.   Dutch:
  612.   !include "languagesdutch.nsh"
  613.   Goto EndLanguageCmp
  614.   Schinese:
  615.   !include "languagesschinese.nsh"
  616.   Goto EndLanguageCmp
  617.   Finnish:
  618.   !include "languagesfinnish.nsh"
  619.   Goto EndLanguageCmp
  620.   Bengali:
  621.   !include "languagesbengali.nsh"
  622.   Goto EndLanguageCmp
  623.   Punjabi:
  624.   !include "languagespunjabi.nsh"
  625.   Goto EndLanguageCmp
  626.   Slovenian:
  627.   !include "languagesslovenian.nsh"
  628.   Goto EndLanguageCmp
  629.   Spanish:
  630.   !include "languagesspanish.nsh"
  631.   Goto EndLanguageCmp
  632.   Brazilian:
  633.   !include "languagesbrazilian_portuguese.nsh"
  634.   EndLanguageCmp:
  635.   ReadRegStr $R0  ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" 
  636.   "UninstallString"
  637.   StrCmp $R0 "" done
  638.   MessageBox MB_YESNO|MB_ICONEXCLAMATION $Message_AlreadyInstalled IDNO done
  639.   ;Run the uninstaller
  640.   ;uninst:
  641.     ClearErrors
  642.     ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
  643.   done:
  644. FunctionEnd
  645. ;; End function
  646. Section -Post
  647.   WriteUninstaller "$INSTDIRuninstall.exe"
  648.   WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
  649.   WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
  650.   WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIRvlc.exe"
  651.   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" 
  652.     "DisplayName" "$(^Name)"
  653.   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" 
  654.     "UninstallString" "$INSTDIRuninstall.exe"
  655.   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" 
  656.     "InstallLocation" "$INSTDIR"
  657.   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" 
  658.     "DisplayIcon" "$INSTDIRvlc.exe"
  659.   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" 
  660.     "DisplayVersion" "${PRODUCT_VERSION}"
  661.   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" 
  662.     "URLInfoAbout" "${PRODUCT_WEB_SITE}"
  663.   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" 
  664.     "Publisher" "${PRODUCT_PUBLISHER}"
  665.   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" 
  666.     "VersionMajor"  "@VERSION_MAJOR@"
  667.   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" 
  668.     "VersionMinor" "@VERSION_MINOR@"
  669. SectionEnd
  670. ;;;;;;;;;;;;;;;;;;;;;;;;
  671. ; Uninstaller sections ;
  672. ;;;;;;;;;;;;;;;;;;;;;;;;
  673. ; TrimNewlines (copied from NSIS documentation)
  674. ; input, top of stack  (e.g. whatever$r$n)
  675. ; output, top of stack (replaces, with e.g. whatever)
  676. ; modifies no other variables.
  677. Function un.TrimNewlines
  678.  Exch $R0
  679.  Push $R1
  680.  Push $R2
  681.  StrCpy $R1 0
  682.  loop:
  683.    IntOp $R1 $R1 - 1
  684.    StrCpy $R2 $R0 1 $R1
  685.    StrCmp $R2 "$r" loop
  686.    StrCmp $R2 "$n" loop
  687.    IntOp $R1 $R1 + 1
  688.    IntCmp $R1 0 no_trim_needed
  689.    StrCpy $R0 $R0 $R1
  690.  no_trim_needed:
  691.    Pop $R2
  692.    Pop $R1
  693.    Exch $R0
  694. FunctionEnd
  695. Function un.RemoveEmptyDirs
  696.   Pop $9
  697.   !define Index 'Line${__LINE__}'
  698.   FindFirst $0 $1 "$INSTDIR$9*"
  699.   StrCmp $0 "" "${Index}-End"
  700.   "${Index}-Loop:"
  701.     StrCmp $1 "" "${Index}-End"
  702.     StrCmp $1 "." "${Index}-Next"
  703.     StrCmp $1 ".." "${Index}-Next"
  704.       Push $0
  705.       Push $1
  706.       Push $9
  707.       Push "$9$1"
  708.       Call un.RemoveEmptyDirs
  709.       Pop $9
  710.       Pop $1
  711.       Pop $0
  712.     "${Index}-Remove:"
  713.     RMDir "$INSTDIR$9$1"
  714.     "${Index}-Next:"
  715.     FindNext $0 $1
  716.     Goto "${Index}-Loop"
  717.   "${Index}-End:"
  718.   FindClose $0
  719.   !undef Index
  720. FunctionEnd
  721. Section "un.$Name_Section91" SEC91
  722.   SectionIn 1 2 3 RO
  723.   SetShellVarContext all
  724.   !insertmacro MacroAllExtensions DeleteContextMenu
  725.   !insertmacro MacroAllExtensions UnRegisterExtensionSection
  726.   !insertmacro DeleteContextMenuExt "Directory"
  727.   ;remove activex plugin
  728.   UnRegDLL "$INSTDIRaxvlc.dll"
  729.   Delete /REBOOTOK "$INSTDIRaxvlc.dll"
  730.   Delete /REBOOTOK "$INSTDIRaxvlc.dll.manifest"
  731.   ;remove mozilla plugin
  732.   Push $R0
  733.   Push $R1
  734.   Push $R2
  735.   !define Index 'Line${__LINE__}'
  736.   StrCpy $R1 "0"
  737.   "${Index}-Loop:"
  738.     ; Check for Key
  739.     EnumRegKey $R0 HKLM "SOFTWAREMozilla" "$R1"
  740.     StrCmp $R0 "" "${Index}-End"
  741.     IntOp $R1 $R1 + 1
  742.     ReadRegStr $R2 HKLM "SOFTWAREMozilla$R0Extensions" "Plugins"
  743.     StrCmp $R2 "" "${Index}-Loop" ""
  744.     ; old files (0.8.5 and before) that may be lying around
  745.     Delete /REBOOTOK "$R2npvlc.dll"
  746.     Delete /REBOOTOK "$R2libvlc.dll"
  747.     Delete /REBOOTOK "$R2vlcintf.xpt"
  748.     Goto "${Index}-Loop"
  749.   "${Index}-End:"
  750.   !undef Index
  751.   Delete /REBOOTOK "$INSTDIRnpvlc.dll"
  752.   Delete /REBOOTOK "$INSTDIRnpvlc.dll.manifest"
  753.   RMDir "$SMPROGRAMSVideoLAN"
  754.   RMDir /r $SMPROGRAMSVideoLAN
  755.   FileOpen $UninstallLog "$INSTDIRuninstall.log" r
  756.   UninstallLoop:
  757.     ClearErrors
  758.     FileRead $UninstallLog $R0
  759.     IfErrors UninstallEnd
  760.     Push $R0
  761.     Call un.TrimNewLines
  762.     Pop $R0
  763.     Delete "$INSTDIR$R0"
  764.     Goto UninstallLoop
  765.   UninstallEnd:
  766.   FileClose $UninstallLog
  767.   Delete "$INSTDIRuninstall.log"
  768.   Delete "$INSTDIRuninstall.exe"
  769.   Push ""
  770.   Call un.RemoveEmptyDirs
  771.   RMDir "$INSTDIR"
  772.   DeleteRegKey HKLM SoftwareVideoLAN
  773.   DeleteRegKey HKCR Applicationsvlc.exe
  774.   DeleteRegKey HKCR AudioCDshellPlayWithVLC
  775.   DeleteRegKey HKCR DVDshellPlayWithVLC
  776.   DeleteRegValue HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersEventHandlersPlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
  777.   DeleteRegKey HKLM SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayDVDMovieOnArrival
  778.   DeleteRegValue HKLM "SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersEventHandlersPlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
  779.   DeleteRegKey HKLM SoftwareMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersVLCPlayCDAudioOnArrival
  780.   DeleteRegKey HKLM SoftwareClientsMediaVLC
  781.   DeleteRegKey HKCR "VLC.MediaFile"
  782.   DeleteRegKey HKLM 
  783.     "SOFTWAREMozillaPlugins@videolan.org/vlc,version=${VERSION}"
  784.   DeleteRegKey HKLM 
  785.     "SoftwareMicrosoftWindowsCurrentVersionUninstall${PRODUCT_NAME}"
  786.   Delete "$DESKTOPVLC media player.lnk"
  787.   DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
  788.   DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
  789.   SetAutoClose true
  790. SectionEnd
  791. Section /o "un.$Name_Section92" SEC92
  792.   !insertmacro delprefs
  793. SectionEnd
  794. ; Uninstaller section descriptions
  795. !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
  796.   !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} $Desc_Section91
  797.   !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} $Desc_Section92
  798. !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
  799. ;Function un.onUninstSuccess
  800. ;  HideWindow
  801. ;  MessageBox MB_ICONINFORMATION|MB_OK 
  802. ;    "$(^Name) was successfully removed from your computer."
  803. ;FunctionEnd
  804. Function un.onInit
  805.   !insertmacro MUI_UNGETLANGUAGE
  806.   
  807.   !include "languagesenglish.nsh"
  808.   StrCmp $LANGUAGE ${LANG_FRENCH} French 0
  809.   StrCmp $LANGUAGE ${LANG_GERMAN} German 0
  810.   StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
  811.   StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
  812.   StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
  813.   StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
  814.   StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
  815.   StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
  816.   StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
  817.   StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
  818.   StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
  819.   StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
  820. ;  StrCmp $LANGUAGE ${LANG_BENGALI} Bengali 0
  821. ;  StrCmp $LANGUAGE ${LANG_PUNJABI} Punjabi 0
  822. ;  StrCmp $LANGUAGE ${LANG_SLOVENIAN} Slovenian 0
  823.   StrCmp $LANGUAGE ${LANG_SPANISH} Spanish 0
  824.   StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
  825.   French:
  826.   !include "languagesfrench.nsh"
  827.   Goto EndLanguageCmp
  828.   German:
  829.   !include "languagesgerman.nsh"
  830.   Goto EndLanguageCmp
  831.   Italian:
  832.   !include "languagesitalian.nsh"
  833.   Goto EndLanguageCmp
  834.   Hungarian:
  835.   !include "languageshungarian.nsh"
  836.   Goto EndLanguageCmp
  837.   Romanian:
  838.   !include "languagesromanian.nsh"
  839.   Goto EndLanguageCmp
  840.   Catalan:
  841.   !include "languagescatalan.nsh"
  842.   Goto EndLanguageCmp
  843.   Bulgarian:
  844.   !include "languagesbulgarian.nsh"
  845.   Goto EndLanguageCmp
  846.   Slovak:
  847.   !include "languagesslovak.nsh"
  848.   Goto EndLanguageCmp
  849.   Polish:
  850.   !include "languagespolish.nsh"
  851.   Goto EndLanguageCmp
  852.   Dutch:
  853.   !include "languagesdutch.nsh"
  854.   Goto EndLanguageCmp
  855.   Schinese:
  856.   !include "languagesschinese.nsh"
  857.   Goto EndLanguageCmp
  858.   Finnish:
  859.   !include "languagesfinnish.nsh"
  860.   Goto EndLanguageCmp
  861.   Bengali:
  862.   !include "languagesbengali.nsh"
  863.   Goto EndLanguageCmp
  864.   Punjabi:
  865.   !include "languagespunjabi.nsh"
  866.   Goto EndLanguageCmp
  867.   Slovenian:
  868.   !include "languagesslovenian.nsh"
  869.   Goto EndLanguageCmp
  870.   Spanish:
  871.   !include "languagesspanish.nsh"
  872.   Goto EndLanguageCmp
  873.   Brazilian:
  874.   !include "languagesbrazilian_portuguese.nsh"
  875.   EndLanguageCmp:
  876.   
  877. FunctionEnd