Changeset 35bb5df5bfa263b9865b8b8c9675b39fd08d7f9c

Show
Ignore:
Timestamp:
04/06/08 06:32:52 (3 months ago)
Author:
Jean-Baptiste Kempf <jb@altair.videolan.org>
git-committer:
Jean-Baptiste Kempf <jb@altair.videolan.org> 1207456372 +0200
git-parent:

[8501e4a23824813d95c036b398f89524245b55c5]

git-author:
Jean-Baptiste Kempf <jb@altair.videolan.org> 1207456314 +0200
Message:

Windows Installer improvements.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • extras/package/win32/vlc.win32.nsi.in

    r19699d2 r35bb5df  
    55 
    66!define PRODUCT_NAME "VLC media player" 
    7 !define PRODUCT_VERSION '${VERSION}
     7!define PRODUCT_VERSION '0.9.0-git
    88!define PRODUCT_GROUP "VideoLAN" 
    99!define PRODUCT_PUBLISHER "VideoLAN Team" 
     
    3434SetCompressor /SOLID lzma 
    3535!endif 
     36 
    3637;ShowInstDetails show 
    3738;ShowUnInstDetails show 
     
    108109  !insertmacro MUI_LANGUAGE "Czech" 
    109110 
    110 !insertmacro MUI_RESERVEFILE_LANGDLL 
    111  
    112 ; Reserve files 
     111; Reserve files for solid compression 
     112  !insertmacro MUI_RESERVEFILE_LANGDLL 
    113113  !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS 
    114114 
    115115; MUI end ------ 
    116116 
    117 ;;;;;;;;;;;;;;;;;;; 
    118 ; Extension lists ; 
    119 ;;;;;;;;;;;;;;;;;;; 
     117;;;;;;;;;;;;;;;;;;;;;;; 
     118; Macro and Functions ; 
     119;;;;;;;;;;;;;;;;;;;;;;; 
     120 
     121;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
     122; 1. File type associations ; 
     123;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
     124 
     125;; Function that register one extension for VLC 
     126Function RegisterExtension 
     127  ; back up old value for extension $R0 (eg. ".opt") 
     128  ReadRegStr $1 HKCR "$R0" "" 
     129  StrCmp $1 "" NoBackup 
     130    StrCmp $1 "VLC$R0" "NoBackup" 
     131    WriteRegStr HKCR "$R0" "VLC.backup" $1 
     132NoBackup: 
     133  WriteRegStr HKCR "$R0" "" "VLC$R0" 
     134  ReadRegStr $0 HKCR "VLC$R0" "" 
     135  WriteRegStr HKCR "VLC$R0" "" "VLC media file ($R0)" 
     136  WriteRegStr HKCR "VLC$R0\shell" "" "Play" 
     137  WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"' 
     138  WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' 
     139 
     140;;; Vista Only part 
     141  ; Vista detection 
     142  ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion 
     143  StrCpy $R2 $R1 3 
     144  StrCmp $R2 '6.0' ForVista ToEnd 
     145ForVista: 
     146  WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0" 
     147 
     148ToEnd: 
     149FunctionEnd 
     150 
     151;; Function that removes one extension that VLC owns. 
     152Function un.RegisterExtension 
     153  ;start of restore script 
     154  ReadRegStr $1 HKCR "$R0" "" 
     155  StrCmp $1 "VLC$R0" 0 NoOwn ; only do this if we own it 
     156    ; Read the old value from Backup 
     157    ReadRegStr $1 HKCR "$R0" "VLC.backup" 
     158    StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key 
     159      DeleteRegKey HKCR "$R0" 
     160    Goto NoOwn 
     161Restore: 
     162      WriteRegStr HKCR "$R0" "" $1 
     163      DeleteRegValue HKCR "$R0" "VLC.backup" 
     164NoOwn: 
     165    DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings 
     166    DeleteRegKey HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations\VLC$R0" ; for vista 
     167FunctionEnd 
     168 
     169!macro RegisterExtensionSection EXT 
     170  Section ${EXT} 
     171    SectionIn 1 3 
     172    Push $R0 
     173    StrCpy $R0 ${EXT} 
     174    Call RegisterExtension 
     175    Pop $R0 
     176  SectionEnd 
     177!macroend 
     178 
     179!macro UnRegisterExtensionSection EXT 
     180  Push $R0 
     181  StrCpy $R0 ${EXT} 
     182  Call un.RegisterExtension 
     183  Pop $R0 
     184!macroend 
     185 
     186!macro WriteRegStrSupportedTypes EXT 
     187  WriteRegStr HKCR Applications\vlc.exe\SupportedTypes ${EXT} "" 
     188!macroend 
     189 
     190;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
     191; Extension lists  Macros                    ; 
     192; Those macros calls the previous functions  ; 
     193;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
    120194 
    121195!macro MacroAudioExtensions _action 
     
    167241!macroend 
    168242 
     243; One macro to rule them all 
    169244!macro MacroAllExtensions _action 
    170245  !insertmacro MacroAudioExtensions ${_action} 
     
    173248!macroend 
    174249 
    175 ;;;;;;;;;;;;;;;;;;;;;;;;;; 
    176 ; File type associations ; 
    177 ;;;;;;;;;;;;;;;;;;;;;;;;;; 
    178  
    179 Function RegisterExtension 
    180   ; back up old value for extension $R0 (eg. ".opt") 
    181   ReadRegStr $1 HKCR "$R0" "" 
    182   StrCmp $1 "" NoBackup 
    183     StrCmp $1 "VLC$R0" "NoBackup" 
    184     WriteRegStr HKCR "$R0" "VLC.backup" $1 
    185 NoBackup: 
    186   WriteRegStr HKCR "$R0" "" "VLC$R0" 
    187   ReadRegStr $0 HKCR "VLC$R0" "" 
    188   WriteRegStr HKCR "VLC$R0" "" "VLC media file ($R0)" 
    189   WriteRegStr HKCR "VLC$R0\shell" "" "Play" 
    190   WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"' 
    191   WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' 
    192  
    193   ; Vista detection 
    194   ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion 
    195   StrCpy $R2 $R1 3 
    196   StrCmp $R2 '6.0' ForVista ToEnd 
    197 ForVista: 
    198   WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0" 
    199 ToEnd: 
    200  
    201 FunctionEnd 
    202  
    203 Function un.RegisterExtension 
    204   ;start of restore script 
    205   ReadRegStr $1 HKCR "$R0" "" 
    206   StrCmp $1 "VLC$R0" 0 NoOwn ; only do this if we own it 
    207     ReadRegStr $1 HKCR "$R0" "VLC.backup" 
    208     StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key 
    209       DeleteRegKey HKCR "$R0" 
    210     Goto NoOwn 
    211 Restore: 
    212       WriteRegStr HKCR "$R0" "" $1 
    213       DeleteRegValue HKCR "$R0" "VLC.backup" 
    214 NoOwn: 
    215     DeleteRegKey HKCR "VLC$R0" ;Delete key with association settings 
    216 FunctionEnd 
    217  
    218 !macro RegisterExtensionSection EXT 
    219   Section ${EXT} 
    220     SectionIn 1 3 
    221     Push $R0 
    222     StrCpy $R0 ${EXT} 
    223     Call RegisterExtension 
    224     Pop $R0 
    225   SectionEnd 
    226 !macroend 
    227  
    228 !macro UnRegisterExtensionSection EXT 
    229   Push $R0 
    230   StrCpy $R0 ${EXT} 
    231   Call un.RegisterExtension 
    232   Pop $R0 
    233 !macroend 
    234  
    235 !macro WriteRegStrSupportedTypes EXT 
    236   WriteRegStr HKCR Applications\vlc.exe\SupportedTypes ${EXT} "" 
    237 !macroend 
    238  
    239 ;;;;;;;;;;;;;;;;;;;;;;;; 
    240 ; Context menu entries ; 
    241 ;;;;;;;;;;;;;;;;;;;;;;;; 
    242  
     250;;;;;;;;;;;;;;;;;;;;;;;;;;; 
     251; 2. Context menu entries ; 
     252;;;;;;;;;;;;;;;;;;;;;;;;;;; 
     253 
     254; Generic function for adding the context menu for one ext. 
    243255!macro AddContextMenuExt EXT 
    244256  WriteRegStr HKCR ${EXT}\shell\PlayWithVLC "" "Play with VLC media player" 
     
    268280!macroend 
    269281 
    270 ;;;;;;;;;;;;;;;;;;;;;;;;;; 
    271 ; Delete prefs and cache ; 
    272 ;;;;;;;;;;;;;;;;;;;;;;;;;; 
     282;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
     283; 3. Delete prefs and cache ; 
     284;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
    273285 
    274286!macro delprefs 
     
    291303!macroend 
    292304 
     305;;;;;;;;;;;;;;; 
     306; 4. Logging  ; 
     307;;;;;;;;;;;;;;; 
    293308Var UninstallLog 
    294  
    295309!macro OpenUninstallLog 
    296310  FileOpen $UninstallLog "$INSTDIR\uninstall.log" a 
     
    303317!macroend 
    304318 
     319;;;;;;;;;;;;;;;;;;;; 
     320; 5. Installations ; 
     321;;;;;;;;;;;;;;;;;;;; 
    305322!macro InstallFile FILEREGEX 
    306323  File "${FILEREGEX}" 
     
    348365  !undef Index 
    349366FunctionEnd 
     367;;; End of Macros 
    350368 
    351369 
    352370;;;;;;;;;;;;;;;;;;;;;; 
    353371; Installer sections ; 
     372; The CORE of the    ; 
     373; installer          ; 
    354374;;;;;;;;;;;;;;;;;;;;;; 
    355375 
     
    361381  !insertmacro OpenUninstallLog 
    362382 
     383  ; VLC.exe, libvlc.dll 
    363384  !insertmacro InstallFile vlc.exe 
    364385  !insertmacro InstallFile vlc.exe.manifest 
    365386  !ifdef LIBVLC_DLL 
    366   !insertmacro InstallFile ${LIBVLC_DLL} 
     387      !insertmacro InstallFile ${LIBVLC_DLL} 
    367388  !endif 
    368389  !ifdef LIBVLC_CONTROL_DLL 
    369   !insertmacro InstallFile ${LIBVLC_CONTROL_DLL} 
     390      !insertmacro InstallFile ${LIBVLC_CONTROL_DLL} 
    370391  !endif 
     392 
     393  ; Text files 
    371394  !insertmacro InstallFile *.txt 
    372395 
     396  ; Subfolders 
    373397  !insertmacro InstallFolder plugins 
    374398  !insertmacro InstallFolder locale 
     
    377401  !insertmacro InstallFolder http 
    378402  !insertmacro InstallFolder share 
    379  
     403  ;!insertmacro InstallFolder scripts 
     404 
     405  ; URLs 
    380406  WriteIniStr "$INSTDIR\${PRODUCT_GROUP} Website.url" "InternetShortcut" "URL" \ 
    381407    "${PRODUCT_WEB_SITE}" 
     
    384410    "${PRODUCT_WEB_SITE}/doc/" 
    385411  FileWrite $UninstallLog "Documentation.url$\r$\n" 
     412  WriteIniStr "$INSTDIR\New_Skins.url" "InternetShortcut" "URL" \ 
     413    "${PRODUCT_WEB_SITE}/vlc/skins.php" 
     414  FileWrite $UninstallLog "New_Skins.url$\r$\n" 
    386415 
    387416  !insertmacro CloseUninstallLog 
     
    394423    '$INSTDIR\vlc.exe --started-from-file "%1"' 
    395424  !insertmacro MacroAllExtensions WriteRegStrSupportedTypes 
    396  
    397   WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" "Play with VLC media player" 
    398   WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \ 
    399     "$INSTDIR\vlc.exe --started-from-file cdda:%1" 
    400   WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" "Play with VLC media player" 
    401   WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \ 
    402     "$INSTDIR\vlc.exe --started-from-file dvd:%1" 
    403  
    404   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" "" 
    405   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" "Play DVD movie" 
    406   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0' 
    407   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie" 
    408   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play" 
    409   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player" 
    410  
    411   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" "" 
    412   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" "Play CD audio" 
    413   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0' 
    414   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio" 
    415   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play" 
    416   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player" 
    417   WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie" 
    418   WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Play" 
    419   WriteRegStr HKCR "VLC.DVDMovie\shell\Play\command" "" \ 
    420     '$INSTDIR\vlc.exe --started-from-file dvd:%1' 
    421   WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' 
    422   WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio" 
    423   WriteRegStr HKCR "VLC.CDAudio\shell" "" "Play" 
    424   WriteRegStr HKCR "VLC.CDAudio\shell\Play\command" "" \ 
    425     '$INSTDIR\vlc.exe --started-from-file cdda:%1' 
    426   WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' 
    427  
     425   
     426; Vista Registration 
    428427  ; Vista detection 
    429428  ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion 
     
    437436 
    438437  lbl_done: 
    439  
    440438SectionEnd 
    441439 
     
    541539SectionEnd 
    542540 
     541Section "Discs Playback" SEC05 
     542  SectionIn 1 2 3 
     543  WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" "Play with VLC media player" 
     544  WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \ 
     545    "$INSTDIR\vlc.exe --started-from-file cdda:%1" 
     546  WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" "Play with VLC media player" 
     547  WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \ 
     548    "$INSTDIR\vlc.exe --started-from-file dvd:%1" 
     549 
     550  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" "" 
     551  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" "Play DVD movie" 
     552  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0' 
     553  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeProgID" "VLC.DVDMovie" 
     554  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "InvokeVerb" "play" 
     555  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Provider" "VideoLAN VLC media player" 
     556 
     557  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" "" 
     558  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" "Play CD audio" 
     559  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe",0' 
     560  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio" 
     561  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play" 
     562  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player" 
     563  WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie" 
     564  WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Play" 
     565  WriteRegStr HKCR "VLC.DVDMovie\shell\Play\command" "" \ 
     566    '$INSTDIR\vlc.exe --started-from-file dvd:%1' 
     567  WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' 
     568  WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio" 
     569  WriteRegStr HKCR "VLC.CDAudio\shell" "" "Play" 
     570  WriteRegStr HKCR "VLC.CDAudio\shell\Play\command" "" \ 
     571    '$INSTDIR\vlc.exe --started-from-file cdda:%1' 
     572  WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' 
     573 
     574SectionEnd 
     575 
    543576SectionGroup "File type associations" SEC06 
    544577  SectionGroup "Audio Files" 
     
    553586SectionGroupEnd 
    554587 
    555 Section /o "Context Menus" SEC05 
     588Section "Context Menus" SEC07 
    556589  SectionIn 3 
    557590  !insertmacro MacroAllExtensions AddContextMenu 
     
    559592SectionEnd 
    560593 
    561 Section /o "Delete preferences and cache" SEC07 
     594Section /o "Delete preferences and cache" SEC08 
    562595  !insertmacro delprefs 
    563596SectionEnd 
     
    576609    "The VLC ActiveX plugin" 
    577610  !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} \ 
    578     "Add context menu items ('Play With VLC' and 'Add To VLC's Playlist')
     611    "DVD and CD playback registration
    579612  !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} \ 
    580613    "Sets VLC media player as the default application for the specified file type" 
    581614  !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} \ 
     615    "Add context menu items ('Play With VLC' and 'Add To VLC's Playlist')" 
     616  !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} \ 
    582617    "Deletes VLC media player preferences and cache files leftover from previous installations" 
    583618!insertmacro MUI_FUNCTION_DESCRIPTION_END 
    584619 
     620;;; Start function 
    585621Function .onInit 
    586622  ReadRegStr $R0  ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" \ 
     
    601637 
    602638  ;Win98 detection 
    603   ReadRegStr $R0 HKLM \ 
    604   "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber 
    605   StrCmp $R0 '4.9' lbl_win98 
     639  ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber 
     640  StrCmp $R0 "4.9" lbl_win98 
    606641 
    607642  lbl_win98: 
     
    610645FunctionEnd 
    611646 
     647;; End function 
    612648Section -Post 
    613649  WriteUninstaller "$INSTDIR\uninstall.exe"