Vista registeration inside the installer... Has to be tested.
[vlc.git] / vlc.win32.nsi.in
index 15e9bf2..8a4a5dc 100644 (file)
@@ -186,6 +186,15 @@ NoBackup:
   WriteRegStr HKCR "VLC$R0\shell" "" "Play"\r
   WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'\r
   WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'\r
+\r
+  ; Vista detection\r
+  ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion\r
+  StrCpy $R2 $R1 3\r
+  StrCmp $R2 '6.0' ForVista ToEnd\r
+ForVista:\r
+  WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0"\r
+ToEnd:\r
+\r
 FunctionEnd\r
 \r
 Function un.RegisterExtension\r
@@ -413,6 +422,18 @@ Section "Media player (required)" SEC01
     '$INSTDIR\vlc.exe --started-from-file cdda:%1'\r
   WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'\r
 \r
+  ; Vista detection\r
+  ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion\r
+  StrCpy $R1 $R0 3\r
+  StrCmp $R1 '6.0' lbl_vista lbl_done\r
+\r
+  lbl_vista:\r
+  WriteRegStr HKLM "Software\RegisteredApplications" "VLC" "Software\Clients\Media\VLC\Capabilities"\r
+  WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationName" "VLC media player"\r
+  WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"\r
+\r
+  lbl_done:\r
+\r
 SectionEnd\r
 \r
 Section "Start Menu Shortcut" SEC02a\r
@@ -722,6 +743,7 @@ Section "Uninstall" SEC91
   DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival\r
   DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival"\r
   DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival\r
+  DeleteRegKey HKLM Software\Clients\Media\VLC\r
   DeleteRegKey HKCR "VLC.MediaFile"\r
 \r
   DeleteRegKey HKLM \\r