vlc.win32.nsi.in 34.6 KB
Newer Older
1 2 3 4 5
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; NSIS installer script for vlc ;
; (http://nsis.sourceforge.net) ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

6 7
!include "languages\declaration.nsh"

8
!define PRODUCT_NAME "VLC media player"
Christophe Mutricy's avatar
Christophe Mutricy committed
9
!define VERSION @VERSION@
10
!define PRODUCT_VERSION @VERSION@
11
!define PRODUCT_GROUP "VideoLAN"
12 13
!define PRODUCT_PUBLISHER "VideoLAN"
!define PRODUCT_WEB_SITE "http://www.videolan.org/"
14 15 16 17 18 19 20 21 22
!define PRODUCT_DIR_REGKEY "Software\VideoLAN\VLC"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define PRODUCT_ID "{ea92ef52-afe4-4212-bacb-dfe9fca94cd6}"

!define MUI_LANGDLL_REGISTRY_ROOT "HKLM"
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_DIR_REGKEY}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Language"

23
!define INSTALL_ACTIVEX
24
!define INSTALL_MOZILLA
25

26 27 28 29
;;;;;;;;;;;;;;;;;;;;;;;;;
; General configuration ;
;;;;;;;;;;;;;;;;;;;;;;;;;

30
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
31 32
@HAVE_WIN64_FALSE@ OutFile ..\vlc-${VERSION}-win32.exe
@HAVE_WIN64_TRUE@  OutFile ..\vlc-${VERSION}-win64.exe
33
InstallDir "$@PROGRAMFILES@\VideoLAN\VLC"
34 35 36 37 38 39 40 41 42 43
!ifdef NSIS_LZMA_COMPRESS_WHOLE
SetCompressor lzma
!else
SetCompressor /SOLID lzma
!endif

SetOverwrite ifnewer
CRCCheck on
BrandingText "${PRODUCT_GROUP} ${PRODUCT_NAME}"

44 45 46
InstType $Name_InstTypeRecommended
InstType $Name_InstTypeMinimum
InstType $Name_InstTypeFull
47

48
RequestExecutionLevel user
Eric Lassauge's avatar
Eric Lassauge committed
49 50
!addincludedir NSIS
!addplugindir NSIS
51
!include UAC.nsh
52
!include WinVer.nsh
53

54 55 56 57 58 59 60 61 62
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; NSIS Modern User Interface configuration ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; MUI 1.67 compatible ------
  !include "MUI.nsh"

; MUI Settings
  !define MUI_ABORTWARNING
63 64
  !define MUI_ICON "vlc.ico"
  !define MUI_UNICON "vlc.ico"
65 66 67 68 69 70 71
  !define MUI_COMPONENTSPAGE_SMALLDESC

; Installer pages
  ; Welcome page
    !define MUI_WELCOMEPAGE_TITLE_3LINES
    !insertmacro MUI_PAGE_WELCOME
  ; License page
72
    !define MUI_LICENSEPAGE_BUTTON $(^NextBtn)
Christophe Mutricy's avatar
Typo  
Christophe Mutricy committed
73
    !define MUI_LICENSEPAGE_TEXT_BOTTOM $License_NextText
74 75 76 77 78 79 80 81
    !insertmacro MUI_PAGE_LICENSE "COPYING.txt"
  ; Components page
    !insertmacro MUI_PAGE_COMPONENTS
  ; Directory page
    !insertmacro MUI_PAGE_DIRECTORY
  ; Instfiles page
    !insertmacro MUI_PAGE_INSTFILES
  ; Finish page
82
    !define MUI_FINISHPAGE_LINK $Link_VisitWebsite
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
    !define MUI_FINISHPAGE_LINK_LOCATION "http://www.videolan.org/vlc/"
    !define MUI_FINISHPAGE_NOREBOOTSUPPORT
    !insertmacro MUI_PAGE_FINISH

; Uninstaller pages
    !insertmacro MUI_UNPAGE_CONFIRM
    !insertmacro MUI_UNPAGE_COMPONENTS
    !insertmacro MUI_UNPAGE_INSTFILES
    !insertmacro MUI_UNPAGE_FINISH

; Language files
  !insertmacro MUI_LANGUAGE "English" # first language is the default language
  !insertmacro MUI_LANGUAGE "French"
  !insertmacro MUI_LANGUAGE "German"
  !insertmacro MUI_LANGUAGE "Spanish"
  !insertmacro MUI_LANGUAGE "SimpChinese"
  !insertmacro MUI_LANGUAGE "TradChinese"
  !insertmacro MUI_LANGUAGE "Japanese"
  !insertmacro MUI_LANGUAGE "Korean"
  !insertmacro MUI_LANGUAGE "Italian"
  !insertmacro MUI_LANGUAGE "Dutch"
  !insertmacro MUI_LANGUAGE "Danish"
  !insertmacro MUI_LANGUAGE "Swedish"
  !insertmacro MUI_LANGUAGE "Norwegian"
  !insertmacro MUI_LANGUAGE "Finnish"
  !insertmacro MUI_LANGUAGE "Greek"
  !insertmacro MUI_LANGUAGE "Russian"
  !insertmacro MUI_LANGUAGE "Portuguese"
111
  !insertmacro MUI_LANGUAGE "PortugueseBR"
112 113 114 115
  !insertmacro MUI_LANGUAGE "Arabic"
  !insertmacro MUI_LANGUAGE "Polish"
  !insertmacro MUI_LANGUAGE "Romanian"
  !insertmacro MUI_LANGUAGE "Slovak"
Pierre Ynard's avatar
Pierre Ynard committed
116
  !insertmacro MUI_LANGUAGE "Serbian"
117
  !insertmacro MUI_LANGUAGE "Czech"
118
  !insertmacro MUI_LANGUAGE "Hungarian"
119 120
  !insertmacro MUI_LANGUAGE "Catalan"
  !insertmacro MUI_LANGUAGE "Bulgarian"
Mihkel's avatar
Mihkel committed
121
  !insertmacro MUI_LANGUAGE "Estonian"
122
  !insertmacro MUI_LANGUAGE "Lithuanian"
123
  !insertmacro MUI_LANGUAGE "Basque"
124 125 126 127 128 129 130 131 132 133 134

; Reserve files for solid compression
  !insertmacro MUI_RESERVEFILE_LANGDLL
  !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS

; MUI end ------

;;;;;;;;;;;;;;;;;;;;;;;
; Macro and Functions ;
;;;;;;;;;;;;;;;;;;;;;;;

135 136 137
!include helpers/extensions.nsh
Var UninstallLog
!include helpers/install.nsh
138 139

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
140
; Delete prefs Macro        ;
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

!macro delprefs
  StrCpy $0 0
  !define Index 'Line${__LINE__}'
  "${Index}-Loop:"
  ; FIXME
  ; this will loop through all the logged users and "virtual" windows users
  ; (it looks like users are only present in HKEY_USERS when they are logged in)
    ClearErrors
    EnumRegKey $1 HKU "" $0
    StrCmp $1 "" "${Index}-End"
    IntOp $0 $0 + 1
    ReadRegStr $2 HKU "$1\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" AppData
    StrCmp $2 "" "${Index}-Loop"
    RMDir /r "$2\vlc"
    Goto "${Index}-Loop"
  "${Index}-End:"
  !undef Index
!macroend

;;;;;;;;;;;;;;;;;;;;;;
; Installer sections ;
; The CORE of the    ;
; installer          ;
;;;;;;;;;;;;;;;;;;;;;;
167

168
Section $Name_Section01 SEC01
169 170 171 172 173 174 175 176 177
  SectionIn 1 2 3 RO
  SetShellVarContext all
  SetOutPath "$INSTDIR"

  !insertmacro OpenUninstallLog

  ; VLC.exe, libvlc.dll
  !insertmacro InstallFile vlc.exe
  !insertmacro InstallFile vlc.exe.manifest
178
  !insertmacro InstallFile vlc-cache-gen.exe
179 180 181

  ; All dlls
  !insertmacro InstallFile *.dll
182 183 184 185 186 187 188

  ; Text files
  !insertmacro InstallFile *.txt

  ; Subfolders
  !insertmacro InstallFolder plugins
  !insertmacro InstallFolder locale
Rafaël Carré's avatar
Rafaël Carré committed
189
  !insertmacro InstallFolder sdk
190 191
@BUILD_SKINS_TRUE@   !insertmacro InstallFolder skins
@BUILD_LUA_TRUE@     !insertmacro InstallFolder lua
192 193

  ; Generate the cache and add it to uninstall.log
194
  ExecWait "$INSTDIR\vlc-cache-gen.exe $INSTDIR\plugins"
195 196 197 198
  FindFirst $0 $1 "$INSTDIR\plugins\*.dat"
  FileWrite $UninstallLog "plugins\$1$\r$\n"
  FindClose $0

199

200
  ; URLs
201
  WriteIniStr "$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
202
  FileWrite $UninstallLog "${PRODUCT_GROUP} Website.url$\r$\n"
203
  WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}/doc/"
204
  FileWrite $UninstallLog "Documentation.url$\r$\n"
205
  WriteIniStr "$INSTDIR\New_Skins.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}/vlc/skins.php"
206 207 208 209
  FileWrite $UninstallLog "New_Skins.url$\r$\n"

  !insertmacro CloseUninstallLog

210
  ; Add VLC to "recommended programs" for the following extensions
211 212
  WriteRegStr HKCR Applications\vlc.exe "" ""
  WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"
Kaarlo Raiha's avatar
Kaarlo Raiha committed
213
  WriteRegStr HKCR Applications\vlc.exe\shell\Open "" $ContextMenuEntry_PlayWith
214
  WriteRegStr HKCR Applications\vlc.exe\shell\Open\command "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'
215
  !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
216

217 218
; Windows default programs Registration
  ; Vista and above detection
219
  ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
220 221
  StrCpy $R1 $R0 1
  StrCmp $R1 '6' lbl_vista lbl_done
222 223 224 225 226

  lbl_vista:
  WriteRegStr HKLM "Software\RegisteredApplications" "VLC" "Software\Clients\Media\VLC\Capabilities"
  WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationName" "VLC media player"
  WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"
227 228 229 230 231
  WriteRegStr HKLM "Software\Clients\Media\VLC" "" "VLC media player"
  WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "HideIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /HideIcons /S"
  WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ShowIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /ShowIcons /S"
  WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ReinstallCommand" "$\"$INSTDIR\spad-setup.exe$\" /Reinstall /S"
  WriteRegDWORD HKLM "Software\Clients\Media\VLC\InstallInfo" "IconsVisible" 0x001
232 233 234 235

  lbl_done:
SectionEnd

236
Section $Name_Section02a SEC02a
237 238
  SectionIn 1 2 3
  CreateDirectory "$SMPROGRAMS\VideoLAN"
239 240 241
  CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player.lnk" \
    "$INSTDIR\vlc.exe" ""
  CreateShortCut "$SMPROGRAMS\VideoLAN\VLC media player skinned.lnk" \
242
    "$INSTDIR\vlc.exe" "-Iskins"
243 244 245 246 247 248
  CreateShortCut "$SMPROGRAMS\VideoLAN\Documentation.lnk" \
    "$INSTDIR\Documentation.url"
  CreateShortCut "$SMPROGRAMS\VideoLAN\Release Notes.lnk" \
    "$INSTDIR\NEWS.txt" ""
  CreateShortCut "$SMPROGRAMS\VideoLAN\${PRODUCT_GROUP} Website.lnk" \
    "$INSTDIR\${PRODUCT_GROUP} Website.url"
249 250
  CreateShortCut "$SMPROGRAMS\VideoLAN\Reset VLC media player preferences and cache files.lnk" \
    "$INSTDIR\vlc.exe" "--reset-config --reset-plugins-cache vlc://quit"
251 252
SectionEnd

253
Section $Name_Section02b SEC02b
254 255 256 257 258
  SectionIn 1 2 3
  CreateShortCut "$DESKTOP\VLC media player.lnk" \
    "$INSTDIR\vlc.exe" ""
SectionEnd

259
SectionGroup /e !$Name_Section34
260
!ifdef INSTALL_MOZILLA
261
Section $Name_Section03 SEC03
262
  SectionIn 1 3
263 264 265

  SetOutPath "$INSTDIR"
  !insertmacro OpenUninstallLog
266 267
  !insertmacro InstallFile npvlc.dll
  !insertmacro InstallFile npvlc.dll.manifest
268 269 270 271 272 273 274 275 276
  !insertmacro CloseUninstallLog

  !define Moz "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"
  WriteRegStr HKLM ${Moz} "Description" "VLC Multimedia Plugin"
  WriteRegStr HKLM ${Moz} "Path" "$INSTDIR\npvlc.dll"
  WriteRegStr HKLM ${Moz} "Product" "VLC media player"
  WriteRegStr HKLM ${Moz} "Vendor" "VideoLAN"
  WriteRegStr HKLM ${Moz} "Version" "${VERSION}"
SectionEnd
277
!endif
278

279
!ifdef INSTALL_ACTIVEX
280
Section $Name_Section04 SEC04
281
  SectionIn 1 3
282

283 284
  SetOutPath "$INSTDIR"
  !insertmacro OpenUninstallLog
285 286
  !insertmacro InstallFile axvlc.dll
  !insertmacro InstallFile axvlc.dll.manifest
287 288 289
  !insertmacro CloseUninstallLog
  RegDLL "$INSTDIR\axvlc.dll"
SectionEnd
290
!endif
291
SectionGroupEnd
292

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
293

294
Section $Name_Section05 SEC05
295
  SectionIn 1 2 3
296
  WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
297
  WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \
298
    '"$INSTDIR\vlc.exe" --started-from-file cdda:///%1'
299
  WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" $ContextMenuEntry_PlayWith
300
  WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \
301
    '"$INSTDIR\vlc.exe" --started-from-file dvd:///%1'
302 303

  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""
304
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" $Action_OnArrivalDVD
305 306
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie"
307
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "Open"
308 309 310
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player"

  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""
311
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" $Action_OnArrivalAudioCD
312 313
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"
314
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "Open"
315
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351

  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayVideoCDMovieOnArrival" "VLCPlayVCDMovieOnArrival" ""
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "Action" $Action_OnArrivalVCDMovie
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "InvokeProgID" "VLC.VCDMovie"
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "InvokeVerb" "Open"
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival" "Provider" "VideoLAN VLC media player"

  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlaySuperVideoCDMovieOnArrival" "VLCPlaySVCDMovieOnArrival" ""
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "Action" $Action_OnArrivalSVCDMovie
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "InvokeProgID" "VLC.SVCDMovie"
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "InvokeVerb" "Open"
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival" "Provider" "VideoLAN VLC media player"

  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDAudioOnArrival" "VLCPlayDVDAudioOnArrival" ""
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "Action" $Action_OnArrivalDVDAudio
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "InvokeProgID" "VLC.OPENFolder"
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "InvokeVerb" "Open"
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival" "Provider" "VideoLAN VLC media player"

  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayVideoFilesOnArrival" "VLCPlayVideoFilesOnArrival" ""
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "Action" $Action_OnArrivalVideoFiles
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "InvokeProgID" "VLC.OPENFolder"
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "InvokeVerb" "Open"
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival" "Provider" "VideoLAN VLC media player"

  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayMusicFilesOnArrival" "VLCPlayMusicFilesOnArrival" ""
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "Action" $Action_OnArrivalMusicFiles
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0'
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "InvokeProgID" "VLC.OPENFolder"
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "InvokeVerb" "Open"
  WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival" "Provider" "VideoLAN VLC media player"

352
  WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"
Kaarlo Raiha's avatar
Kaarlo Raiha committed
353 354
  WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Open"
  WriteRegStr HKCR "VLC.DVDMovie\shell\Open\command" "" \
355
    '"$INSTDIR\vlc.exe" --started-from-file dvd:///%1'
356
  WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
357

358
  WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"
Kaarlo Raiha's avatar
Kaarlo Raiha committed
359 360
  WriteRegStr HKCR "VLC.CDAudio\shell" "" "Open"
  WriteRegStr HKCR "VLC.CDAudio\shell\Open\command" "" \
361
    '"$INSTDIR\vlc.exe" --started-from-file cdda:///%1'
362 363
  WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'

364 365 366
  WriteRegStr HKCR "VLC.VCDMovie" "" "VLC VCD Movie"
  WriteRegStr HKCR "VLC.VCDMovie\shell" "" "Open"
  WriteRegStr HKCR "VLC.VCDMovie\shell\Open\command" "" \
367
     '"$INSTDIR\vlc.exe" --started-from-file vcd:///%1'
368 369 370 371 372
  WriteRegStr HKCR "VLC.VCDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'

  WriteRegStr HKCR "VLC.SVCDMovie" "" "VLC SVCD Movie"
  WriteRegStr HKCR "VLC.SVCDMovie\shell" "" "Open"
  WriteRegStr HKCR "VLC.SVCDMovie\shell\Open\command" "" \
373
     '"$INSTDIR\vlc.exe" --started-from-file vcd:///%1'
374 375 376 377 378 379 380 381
  WriteRegStr HKCR "VLC.SVCDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'

  WriteRegStr HKCR "VLC.OPENFolder" "" "VLC Play content"
  WriteRegStr HKCR "VLC.OPENFolder\shell" "" "Open"
  WriteRegStr HKCR "VLC.OPENFolder\shell\Open\command" "" \
     '"$INSTDIR\vlc.exe" %1'
  WriteRegStr HKCR "VLC.OPENFolder\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'

382 383
SectionEnd

384 385 386 387 388 389 390 391 392 393

SectionGroup /e !$Name_Section06 SEC06
  SectionGroup $Name_SectionGroupAudio
    !insertmacro MacroAudioExtensions RegisterExtensionSection
  SectionGroupEnd
  SectionGroup $Name_SectionGroupVideo
    !insertmacro MacroVideoExtensions RegisterExtensionSection
  SectionGroupEnd
  SectionGroup $Name_SectionGroupOther
    !insertmacro MacroOtherExtensions RegisterExtensionSection
394
    !insertmacro MacroSkinExtensions RegisterSkinExtensionSection
395 396 397
  SectionGroupEnd
SectionGroupEnd

398
Section $Name_Section07 SEC07
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
399
  SectionIn 1 3
400 401 402 403
  !insertmacro MacroAllExtensions AddContextMenu
  !insertmacro AddContextMenuExt "Directory"
SectionEnd

404
Section /o $Name_Section08 SEC08
405 406 407 408 409
  !insertmacro delprefs
SectionEnd

; Installer section descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
410 411 412
  !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $Desc_Section01
  !insertmacro MUI_DESCRIPTION_TEXT ${SEC02a} $Desc_Section02a
  !insertmacro MUI_DESCRIPTION_TEXT ${SEC02b} $Desc_Section02b
413
!ifdef INSTALL_MOZILLA
414
  !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $Desc_Section03
415
!endif
Rafaël Carré's avatar
Rafaël Carré committed
416 417 418
!ifdef INSTALL_ACTIVEX
  !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $Desc_Section04
!endif
419 420 421 422
  !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $Desc_Section05
  !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $Desc_Section06
  !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $Desc_Section07
  !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $Desc_Section08
423 424 425 426
!insertmacro MUI_FUNCTION_DESCRIPTION_END

;;; Start function
Function .onInit
427

428 429 430 431 432 433
@HAVE_WIN64_TRUE@ !include "x64.nsh"
@HAVE_WIN64_TRUE@ ${If} ${RunningX64}
@HAVE_WIN64_TRUE@ ${Else}
@HAVE_WIN64_TRUE@    MessageBox MB_OK|MB_ICONSTOP "This version of VLC only runs on 64bits operating systems.$\nYour operating system is 32bits.$\n$\nPlease get the 32 BITS version."
@HAVE_WIN64_TRUE@    Quit
@HAVE_WIN64_TRUE@ ${Endif}
434 435 436 437 438 439 440 441
${If} ${AtLeastWinXP}
    ${If} ${IsWinXP}
    ${AndIf} ${AtMostServicePack} 1
        Goto WinTooOld
    ${Endif}
${Else}
    Goto WinTooOld
${Endif}
442

443
@HAVE_WIN64_TRUE@ SetRegView 64
Rafaël Carré's avatar
Rafaël Carré committed
444 445
ReadRegStr $INSTDIR HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir"
StrCmp $INSTDIR "" 0 UAC_Elevate
446 447
StrCpy $INSTDIR "$@PROGRAMFILES@\VideoLAN\VLC"

448 449 450 451 452 453 454 455 456 457 458 459 460 461 462
UAC_Elevate:
    UAC::RunElevated
    StrCmp 1223 $0 UAC_ElevationAborted
    StrCmp 0 $0 0 UAC_Err
    StrCmp 1 $1 0 UAC_Success
    Quit

UAC_Err:
    MessageBox mb_iconstop "Unable to elevate, error $0"
    Abort

UAC_ElevationAborted:
    MessageBox mb_iconstop "This installer requires admin access, aborting!"
    Abort

463 464 465 466
WinTooOld:
    MessageBox MB_OK|MB_ICONSTOP "This version of VLC only runs on Windows XP SP2 and newer."
    Quit

467 468 469 470 471
UAC_Success:
    StrCmp 1 $3 +4
    StrCmp 3 $1 0 UAC_ElevationAborted
    MessageBox mb_iconstop "This installer requires admin access, try again"
    goto UAC_Elevate
472
  !insertmacro MUI_LANGDLL_DISPLAY
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
473

474
  !include "languages\english.nsh"
475
  StrCmp $LANGUAGE ${LANG_FRENCH} French 0
476
  StrCmp $LANGUAGE ${LANG_GERMAN} German 0
477 478 479
  StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
  StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
  StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
480 481 482
  StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
  StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
  StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
483 484
  StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
  StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
485
  StrCmp $LANGUAGE ${LANG_DANISH} Danish 0
486
  StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
487
  StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
488
  StrCmp $LANGUAGE ${LANG_JAPANESE} Japanese 0
489 490 491 492
;  StrCmp $LANGUAGE ${LANG_BENGALI} Bengali 0
;  StrCmp $LANGUAGE ${LANG_PUNJABI} Punjabi 0
;  StrCmp $LANGUAGE ${LANG_SLOVENIAN} Slovenian 0
  StrCmp $LANGUAGE ${LANG_SPANISH} Spanish 0
493
  StrCmp $LANGUAGE ${LANG_ESTONIAN} Estonian 0
494
  StrCmp $LANGUAGE ${LANG_LITHUANIAN} Lithuanian 0
495
  StrCmp $LANGUAGE ${LANG_BASQUE} Basque 0
496
  StrCmp $LANGUAGE ${LANG_SERBIAN} Serbian 0
Christophe Mutricy's avatar
Typo  
Christophe Mutricy committed
497
  StrCmp $LANGUAGE ${LANG_RUSSIAN} Russian 0
498 499 500
  StrCmp $LANGUAGE ${LANG_HEBREW} Hebrew 0
  StrCmp $LANGUAGE ${LANG_GALICIAN} Galician 0
  StrCmp $LANGUAGE ${LANG_SWEDISH} Swedish 0
501
  StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
502 503
  French:
  !include "languages\french.nsh"
504
  Goto EndLanguageCmp
505 506 507
  German:
  !include "languages\german.nsh"
  Goto EndLanguageCmp
508 509 510 511 512 513 514 515 516
  Italian:
  !include "languages\italian.nsh"
  Goto EndLanguageCmp
  Hungarian:
  !include "languages\hungarian.nsh"
  Goto EndLanguageCmp
  Romanian:
  !include "languages\romanian.nsh"
  Goto EndLanguageCmp
517 518 519 520 521 522 523 524 525
  Catalan:
  !include "languages\catalan.nsh"
  Goto EndLanguageCmp
  Bulgarian:
  !include "languages\bulgarian.nsh"
  Goto EndLanguageCmp
  Slovak:
  !include "languages\slovak.nsh"
  Goto EndLanguageCmp
526 527 528 529 530 531
  Polish:
  !include "languages\polish.nsh"
  Goto EndLanguageCmp
  Dutch:
  !include "languages\dutch.nsh"
  Goto EndLanguageCmp
532 533 534
  Danish:
  !include "languages\danish.nsh"
  Goto EndLanguageCmp
535 536 537
  Schinese:
  !include "languages\schinese.nsh"
  Goto EndLanguageCmp
538 539
  Finnish:
  !include "languages\finnish.nsh"
540
  Goto EndLanguageCmp
541 542 543
  Japanese:
  !include "languages\japanese.nsh"
  Goto EndLanguageCmp
544 545 546 547 548 549 550 551 552 553 554 555
  Bengali:
  !include "languages\bengali.nsh"
  Goto EndLanguageCmp
  Punjabi:
  !include "languages\punjabi.nsh"
  Goto EndLanguageCmp
  Slovenian:
  !include "languages\slovenian.nsh"
  Goto EndLanguageCmp
  Spanish:
  !include "languages\spanish.nsh"
  Goto EndLanguageCmp
Mihkel's avatar
Mihkel committed
556 557 558
  Estonian:
  !include "languages\estonian.nsh"
  Goto EndLanguageCmp
559 560 561
  Lithuanian:
  !include "languages\lithuanian.nsh"
  Goto EndLanguageCmp
562 563 564
  Basque:
  !include "languages\basque.nsh"
  Goto EndLanguageCmp
565 566 567
  Serbian:
  !include "languages\serbian.nsh"
  Goto EndLanguageCmp
568 569 570
  Russian:
  !include "languages\Russian.nsh"
  Goto EndLanguageCmp
571 572 573 574 575 576 577 578 579
  Hebrew:
  !include "languages\hebrew.nsh"
  Goto EndLanguageCmp
  Galician:
  !include "languages\galician.nsh"
  Goto EndLanguageCmp
  Swedish:
  !include "languages\swedish.nsh"
  Goto EndLanguageCmp
580 581
  Brazilian:
  !include "languages\brazilian_portuguese.nsh"
582 583
  EndLanguageCmp:

584 585 586
  ReadRegStr $R0  ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
  "UninstallString"
  StrCmp $R0 "" done
Jean-Paul Saman's avatar
Jean-Paul Saman committed
587

588
  MessageBox MB_YESNO|MB_ICONEXCLAMATION $Message_AlreadyInstalled /SD IDNO IDNO done
Jean-Paul Saman's avatar
Jean-Paul Saman committed
589

590 591 592 593 594
  ;Run the uninstaller
  ;uninst:
    ClearErrors
    ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
  done:
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
595

596 597
FunctionEnd

598 599 600 601 602 603 604
Function .OnInstFailed
    UAC::Unload
FunctionEnd

Function .OnInstSuccess
    UAC::Unload
FunctionEnd
605

606 607 608 609 610 611 612 613 614 615 616
;; End function
Section -Post
  WriteUninstaller "$INSTDIR\uninstall.exe"
  WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "InstallDir" $INSTDIR
  WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Version" "${VERSION}"
  WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\vlc.exe"

  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
    "DisplayName" "$(^Name)"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
    "UninstallString" "$INSTDIR\uninstall.exe"
617 618
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
    "InstallLocation" "$INSTDIR"
619 620 621 622 623 624 625 626
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
    "DisplayIcon" "$INSTDIR\vlc.exe"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
    "DisplayVersion" "${PRODUCT_VERSION}"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
    "URLInfoAbout" "${PRODUCT_WEB_SITE}"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
    "Publisher" "${PRODUCT_PUBLISHER}"
627 628 629 630
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
    "VersionMajor"  "@VERSION_MAJOR@"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \
    "VersionMinor" "@VERSION_MINOR@"
631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646
SectionEnd

;;;;;;;;;;;;;;;;;;;;;;;;
; Uninstaller sections ;
;;;;;;;;;;;;;;;;;;;;;;;;

; TrimNewlines (copied from NSIS documentation)
; input, top of stack  (e.g. whatever$\r$\n)
; output, top of stack (replaces, with e.g. whatever)
; modifies no other variables.

Function un.TrimNewlines
 Exch $R0
 Push $R1
 Push $R2
 StrCpy $R1 0
647

648 649 650 651 652 653 654 655
 loop:
   IntOp $R1 $R1 - 1
   StrCpy $R2 $R0 1 $R1
   StrCmp $R2 "$\r" loop
   StrCmp $R2 "$\n" loop
   IntOp $R1 $R1 + 1
   IntCmp $R1 0 no_trim_needed
   StrCpy $R0 $R0 $R1
656

657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689
 no_trim_needed:
   Pop $R2
   Pop $R1
   Exch $R0
FunctionEnd

Function un.RemoveEmptyDirs
  Pop $9
  !define Index 'Line${__LINE__}'
  FindFirst $0 $1 "$INSTDIR$9*"
  StrCmp $0 "" "${Index}-End"
  "${Index}-Loop:"
    StrCmp $1 "" "${Index}-End"
    StrCmp $1 "." "${Index}-Next"
    StrCmp $1 ".." "${Index}-Next"
      Push $0
      Push $1
      Push $9
      Push "$9$1\"
      Call un.RemoveEmptyDirs
      Pop $9
      Pop $1
      Pop $0
    "${Index}-Remove:"
    RMDir "$INSTDIR$9$1"
    "${Index}-Next:"
    FindNext $0 $1
    Goto "${Index}-Loop"
  "${Index}-End:"
  FindClose $0
  !undef Index
FunctionEnd

690
Section "un.$Name_Section91" SEC91
691 692 693 694 695
  SectionIn 1 2 3 RO
  SetShellVarContext all

  !insertmacro MacroAllExtensions DeleteContextMenu
  !insertmacro MacroAllExtensions UnRegisterExtensionSection
696
  !insertmacro MacroSkinExtensions UnRegisterExtensionSection
697 698 699 700 701
  !insertmacro DeleteContextMenuExt "Directory"

  ;remove activex plugin
  UnRegDLL "$INSTDIR\axvlc.dll"
  Delete /REBOOTOK "$INSTDIR\axvlc.dll"
702
  Delete /REBOOTOK "$INSTDIR\axvlc.dll.manifest"
703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729

  ;remove mozilla plugin
  Push $R0
  Push $R1
  Push $R2

  !define Index 'Line${__LINE__}'
  StrCpy $R1 "0"

  "${Index}-Loop:"

    ; Check for Key
    EnumRegKey $R0 HKLM "SOFTWARE\Mozilla" "$R1"
    StrCmp $R0 "" "${Index}-End"
    IntOp $R1 $R1 + 1
    ReadRegStr $R2 HKLM "SOFTWARE\Mozilla\$R0\Extensions" "Plugins"
    StrCmp $R2 "" "${Index}-Loop" ""

    ; old files (0.8.5 and before) that may be lying around
    Delete /REBOOTOK "$R2\npvlc.dll"
    Delete /REBOOTOK "$R2\libvlc.dll"
    Delete /REBOOTOK "$R2\vlcintf.xpt"
    Goto "${Index}-Loop"

  "${Index}-End:"
  !undef Index
  Delete /REBOOTOK "$INSTDIR\npvlc.dll"
730
  Delete /REBOOTOK "$INSTDIR\npvlc.dll.manifest"
731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761

  RMDir "$SMPROGRAMS\VideoLAN"
  RMDir /r $SMPROGRAMS\VideoLAN

  FileOpen $UninstallLog "$INSTDIR\uninstall.log" r
  UninstallLoop:
    ClearErrors
    FileRead $UninstallLog $R0
    IfErrors UninstallEnd
    Push $R0
    Call un.TrimNewLines
    Pop $R0
    Delete "$INSTDIR\$R0"
    Goto UninstallLoop
  UninstallEnd:
  FileClose $UninstallLog
  Delete "$INSTDIR\uninstall.log"
  Delete "$INSTDIR\uninstall.exe"
  Push "\"
  Call un.RemoveEmptyDirs
  RMDir "$INSTDIR"

  DeleteRegKey HKLM Software\VideoLAN

  DeleteRegKey HKCR Applications\vlc.exe
  DeleteRegKey HKCR AudioCD\shell\PlayWithVLC
  DeleteRegKey HKCR DVD\shell\PlayWithVLC
  DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival"
  DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival
  DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"
  DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival
762 763 764 765 766 767 768 769 770 771 772
  DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayVideoCDMovieOnArrival" "VLCPlayVCDMovieOnArrival"
  DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVCDMovieOnArrival
  DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlaySuperVideoCDMovieOnArrival" "VLCPlaySVCDMovieOnArrival"
  DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlaySVCDMovieOnArrival
  DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDAudioOnArrival" "VLCPlayDVDAudioOnArrival"
  DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDAudioOnArrival
  DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayVideoFilesOnArrival" "VLCPlayVideoFilesOnArrival"
  DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayVideoFilesOnArrival
  DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayMusicFilesOnArrival" "VLCPlayMusicFilesOnArrival"
  DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayMusicFilesOnArrival

773
  DeleteRegKey HKLM Software\Clients\Media\VLC
774
  DeleteRegValue HKLM "Software\RegisteredApplications" "VLC"
775
  DeleteRegKey HKCR "VLC.MediaFile"
776 777 778 779 780 781
  DeleteRegKey HKCR "VLC.DVDMovie"
  DeleteRegKey HKCR "VLC.CDAudio"
  DeleteRegKey HKCR "VLC.VCDMovie"
  DeleteRegKey HKCR "VLC.SVCDMovie"
  DeleteRegKey HKCR "VLC.OPENFolder"

782 783 784 785 786 787 788 789 790 791 792 793 794 795

  DeleteRegKey HKLM \
    "SOFTWARE\MozillaPlugins\@videolan.org/vlc,version=${VERSION}"

  DeleteRegKey HKLM \
    "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"

  Delete "$DESKTOP\VLC media player.lnk"

  DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
  DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
  SetAutoClose true
SectionEnd

796
Section /o "un.$Name_Section92" SEC92
797 798 799 800 801
  !insertmacro delprefs
SectionEnd

; Uninstaller section descriptions
!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
802 803
  !insertmacro MUI_DESCRIPTION_TEXT ${SEC91} $Desc_Section91
  !insertmacro MUI_DESCRIPTION_TEXT ${SEC92} $Desc_Section92
804 805
!insertmacro MUI_UNFUNCTION_DESCRIPTION_END

806 807 808 809 810 811 812 813
Function un.OnUnInstFailed
    UAC::Unload
FunctionEnd

Function un.OnUnInstSuccess
    UAC::Unload
    Delete "$INSTDIR\UAC.dll"
FunctionEnd
814 815

Function un.onInit
816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837

UAC_Elevate:
    UAC::RunElevated
    StrCmp 1223 $0 UAC_ElevationAborted
    StrCmp 0 $0 0 UAC_Err
    StrCmp 1 $1 0 UAC_Success
    Quit

UAC_Err:
    MessageBox mb_iconstop "Unable to elevate, error $0"
    Abort

UAC_ElevationAborted:
    MessageBox mb_iconstop "This installer requires admin access, aborting!"
    Abort

UAC_Success:
    StrCmp 1 $3 +4
    StrCmp 3 $1 0 UAC_ElevationAborted
    MessageBox mb_iconstop "This installer requires admin access, try again"
    goto UAC_Elevate

838
  !insertmacro MUI_UNGETLANGUAGE
839

840
  !include "languages\english.nsh"
841
  StrCmp $LANGUAGE ${LANG_FRENCH} French 0
842
  StrCmp $LANGUAGE ${LANG_GERMAN} German 0
843 844 845
  StrCmp $LANGUAGE ${LANG_ITALIAN} Italian 0
  StrCmp $LANGUAGE ${LANG_HUNGARIAN} Hungarian 0
  StrCmp $LANGUAGE ${LANG_ROMANIAN} Romanian 0
846 847 848
  StrCmp $LANGUAGE ${LANG_CATALAN} Catalan 0
  StrCmp $LANGUAGE ${LANG_BULGARIAN} Bulgarian 0
  StrCmp $LANGUAGE ${LANG_SLOVAK} Slovak 0
849 850
  StrCmp $LANGUAGE ${LANG_POLISH} Polish 0
  StrCmp $LANGUAGE ${LANG_DUTCH} Dutch 0
851
  StrCmp $LANGUAGE ${LANG_DANISH} Danish 0
852
  StrCmp $LANGUAGE ${LANG_SIMPCHINESE} SChinese 0
853
  StrCmp $LANGUAGE ${LANG_FINNISH} Finnish 0
854
  StrCmp $LANGUAGE ${LANG_JAPANESE} Japanese 0
855 856 857 858
;  StrCmp $LANGUAGE ${LANG_BENGALI} Bengali 0
;  StrCmp $LANGUAGE ${LANG_PUNJABI} Punjabi 0
;  StrCmp $LANGUAGE ${LANG_SLOVENIAN} Slovenian 0
  StrCmp $LANGUAGE ${LANG_SPANISH} Spanish 0
Mihkel's avatar
Mihkel committed
859
  StrCmp $LANGUAGE ${LANG_ESTONIAN} Estonian 0
860
  StrCmp $LANGUAGE ${LANG_LITHUANIAN} Lithuanian 0
861
  StrCmp $LANGUAGE ${LANG_BASQUE} Basque 0
862 863
  StrCmp $LANGUAGE ${LANG_SERBIAN} Serbian 0
  StrCmp $LANGUAGE ${LANG_RUSSIAN} Russian 0
864 865 866
  StrCmp $LANGUAGE ${LANG_HEBREW} Hebrew 0
  StrCmp $LANGUAGE ${LANG_GALICIAN} Galician 0
  StrCmp $LANGUAGE ${LANG_SWEDISH} Swedish 0
867
  StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} Brazilian EndLanguageCmp
868 869
  French:
  !include "languages\french.nsh"
870
  Goto EndLanguageCmp
871 872 873
  German:
  !include "languages\german.nsh"
  Goto EndLanguageCmp
874 875 876 877 878 879 880 881 882
  Italian:
  !include "languages\italian.nsh"
  Goto EndLanguageCmp
  Hungarian:
  !include "languages\hungarian.nsh"
  Goto EndLanguageCmp
  Romanian:
  !include "languages\romanian.nsh"
  Goto EndLanguageCmp
883 884 885 886 887 888 889 890 891
  Catalan:
  !include "languages\catalan.nsh"
  Goto EndLanguageCmp
  Bulgarian:
  !include "languages\bulgarian.nsh"
  Goto EndLanguageCmp
  Slovak:
  !include "languages\slovak.nsh"
  Goto EndLanguageCmp
892 893 894 895 896 897
  Polish:
  !include "languages\polish.nsh"
  Goto EndLanguageCmp
  Dutch:
  !include "languages\dutch.nsh"
  Goto EndLanguageCmp
898 899 900
  Danish:
  !include "languages\danish.nsh"
  Goto EndLanguageCmp
901 902 903
  Schinese:
  !include "languages\schinese.nsh"
  Goto EndLanguageCmp
904 905
  Finnish:
  !include "languages\finnish.nsh"
906
  Goto EndLanguageCmp
907 908 909
  Japanese:
  !include "languages\japanese.nsh"
  Goto EndLanguageCmp
910 911 912 913 914 915 916 917 918 919 920 921
  Bengali:
  !include "languages\bengali.nsh"
  Goto EndLanguageCmp
  Punjabi:
  !include "languages\punjabi.nsh"
  Goto EndLanguageCmp
  Slovenian:
  !include "languages\slovenian.nsh"
  Goto EndLanguageCmp
  Spanish:
  !include "languages\spanish.nsh"
  Goto EndLanguageCmp
Mihkel's avatar
Mihkel committed
922 923 924
  Estonian:
  !include "languages\estonian.nsh"
  Goto EndLanguageCmp
925 926 927
  Lithuanian:
  !include "languages\lithuanian.nsh"
  Goto EndLanguageCmp
928 929 930
  Basque:
  !include "languages\basque.nsh"
  Goto EndLanguageCmp
931 932 933
  Serbian:
  !include "languages\serbian.nsh"
  Goto EndLanguageCmp
934 935 936
  Russian:
  !include "languages\russian.nsh"
  Goto EndLanguageCmp
937 938 939 940 941 942 943 944 945
  Hebrew:
  !include "languages\hebrew.nsh"
  Goto EndLanguageCmp
  Galician:
  !include "languages\galician.nsh"
  Goto EndLanguageCmp
  Swedish:
  !include "languages\swedish.nsh"
  Goto EndLanguageCmp
946 947
  Brazilian:
  !include "languages\brazilian_portuguese.nsh"
948
  EndLanguageCmp:
949

950
FunctionEnd