Created
June 13, 2018 04:30
-
-
Save sanjeetsuhag/8d8963e5c45ffa00cc61eccb3154f476 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Name "HardwareFilterSample" | |
OutFile "installer.exe" | |
!include "StrFunc.nsh" | |
${StrRep} | |
Section | |
nsExec::ExecToStack '"C:\Windows\System32\wbem\wmic.exe" bios get serialnumber' | |
Pop $0 | |
Pop $1 | |
${StrRep} $1 $1 "SerialNumber" "" | |
${StrRep} $1 $1 " " "" | |
DetailPrint '"BIOS: $1' | |
nsExec::ExecToStack '"C:\Windows\System32\wbem\wmic.exe" baseboard get serialnumber' | |
Pop $0 | |
Pop $1 | |
${StrRep} $1 $1 "SerialNumber" "" | |
${StrRep} $1 $1 " " "" | |
DetailPrint '"Motherboard: $1' | |
nsExec::ExecToStack '"C:\Windows\System32\wbem\wmic.exe" nic get macaddress' | |
Pop $0 | |
Pop $1 | |
${StrRep} $1 $1 "MACAddress" "" | |
DetailPrint '"MAC Address: $1"' | |
nsExec::ExecToLog '"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" gwmi Win32_USBControllerDevice |%{[wmi]($_.Dependent)} | Sort Manufacturer,Description,DeviceID | Ft -GroupBy Manufacturer Description,Service,DeviceID' | |
SectionEnd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment