We are working on converting the wiki to a static website controlled by markdown files in https://github.com/nsis-community. You can already see there how plug-ins will be posted. The end-user interface will still be a website but with a fresh coat of paint. Come meet us at Discord to talk about it.

Detect the DirectX's version installed

From NSIS Wiki
Jump to navigationJump to search
Author: Joel (talk, contrib)


Description

This will detect the current installed version of the DirectX. Hope that will work with v7 and lower. Bugs? PM

The Script

OutFile "DirectX.exe"
Name "Detect DirectX version"
Caption "Detect DirectX version"
XPStyle "on"
 
Function .onInit
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\DirectX" "Version"
StrCpy $1 $0 5 2
StrCpy $0 $1 1
StrCmp $0 "0" 0 +2
StrCpy $1 $1 "" 1 ; Remove leading 0
MessageBox MB_OK $1
Quit
FunctionEnd
 
Section "-boo"
;
SectionEnd

Thanks KichiK for the "StrCpy" idea :p