Commit 8ad0c0a3 authored by Ludovic Fauvet's avatar Ludovic Fauvet

nsis: simplify OS detection

parent 16e99999
...@@ -19,15 +19,9 @@ NoBackup: ...@@ -19,15 +19,9 @@ NoBackup:
WriteRegStr HKCR "VLC$R0\shell\Open\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"' WriteRegStr HKCR "VLC$R0\shell\Open\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'
WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
;;; Vista Only part ${If} ${AtLeastWinVista}
; Vista and above detection
ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
StrCpy $R2 $R1 1
StrCmp $R2 '6' ForVista ToEnd
ForVista:
WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0" WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0"
${EndIf}
ToEnd:
FunctionEnd FunctionEnd
;; Function that registers one skin extension for VLC ;; Function that registers one skin extension for VLC
...@@ -46,15 +40,9 @@ NoBackup: ...@@ -46,15 +40,9 @@ NoBackup:
WriteRegStr HKCR "VLC$R0\shell\Open\command" "" '"$INSTDIR\vlc.exe" -Iskins --skins2-last "%1"' WriteRegStr HKCR "VLC$R0\shell\Open\command" "" '"$INSTDIR\vlc.exe" -Iskins --skins2-last "%1"'
WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0' WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'
;;; Vista Only part ${If} ${AtLeastWinVista}
; Vista and above detection
ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
StrCpy $R2 $R1 1
StrCmp $R2 '6' ForVista ToEnd
ForVista:
WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0" WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities\FileAssociations" "$R0" "VLC$R0"
${EndIf}
ToEnd:
FunctionEnd FunctionEnd
;; Function that removes one extension that VLC owns. ;; Function that removes one extension that VLC owns.
......
...@@ -215,13 +215,9 @@ ${MementoSection} $Name_Section01 SEC01 ...@@ -215,13 +215,9 @@ ${MementoSection} $Name_Section01 SEC01
WriteRegStr HKCR Applications\vlc.exe\shell\Open\command "" '"$INSTDIR\vlc.exe" --started-from-file "%1"' WriteRegStr HKCR Applications\vlc.exe\shell\Open\command "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'
!insertmacro MacroAllExtensions WriteRegStrSupportedTypes !insertmacro MacroAllExtensions WriteRegStrSupportedTypes
; Windows default programs Registration ; Windows default programs Registration
; Vista and above detection ; Vista and above detection
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion ${If} ${AtLeastWinVista}
StrCpy $R1 $R0 1
StrCmp $R1 '6' lbl_vista lbl_done
lbl_vista:
WriteRegStr HKLM "Software\RegisteredApplications" "VLC" "Software\Clients\Media\VLC\Capabilities" 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" "ApplicationName" "VLC media player"
WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife" WriteRegStr HKLM "Software\Clients\Media\VLC\Capabilities" "ApplicationDescription" "VLC - The video swiss knife"
...@@ -230,8 +226,7 @@ ${MementoSection} $Name_Section01 SEC01 ...@@ -230,8 +226,7 @@ ${MementoSection} $Name_Section01 SEC01
WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ShowIconsCommand" "$\"$INSTDIR\spad-setup.exe$\" /ShowIcons /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" WriteRegStr HKLM "Software\Clients\Media\VLC\InstallInfo" "ReinstallCommand" "$\"$INSTDIR\spad-setup.exe$\" /Reinstall /S"
WriteRegDWORD HKLM "Software\Clients\Media\VLC\InstallInfo" "IconsVisible" 0x001 WriteRegDWORD HKLM "Software\Clients\Media\VLC\InstallInfo" "IconsVisible" 0x001
${EndIf}
lbl_done:
${MementoSectionEnd} ${MementoSectionEnd}
${MementoSection} $Name_Section02a SEC02a ${MementoSection} $Name_Section02a SEC02a
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment