xref: /aosp_15_r20/external/scapy/.appveyor/InstallNpcap.ps1 (revision 7dc08ffc4802948ccbc861daaf1e81c405c2c4bd)
1*7dc08ffcSJunyu Lai # Config
2*7dc08ffcSJunyu Lai $urlPath = "https://nmap.org/npcap/dist/npcap-0.90.exe"
3*7dc08ffcSJunyu Lai $checksum = "0477a42a9c54f31a7799fb3ee0537826041730f462abfc066fe36d81c50721a7"
4*7dc08ffcSJunyu Lai 
5*7dc08ffcSJunyu Lai ############
6*7dc08ffcSJunyu Lai ############
7*7dc08ffcSJunyu Lai # Download the file
8*7dc08ffcSJunyu Lai wget $urlPath -UseBasicParsing -OutFile $PSScriptRoot"\npcap.exe"
9*7dc08ffcSJunyu Lai # Now let's check its checksum
10*7dc08ffcSJunyu Lai $_chksum = $(CertUtil -hashfile $PSScriptRoot"\npcap.exe" SHA256)[1] -replace " ",""
11*7dc08ffcSJunyu Lai if ($_chksum -ne $checksum){
12*7dc08ffcSJunyu Lai     echo "Checksums does NOT match !"
13*7dc08ffcSJunyu Lai     exit
14*7dc08ffcSJunyu Lai } else {
15*7dc08ffcSJunyu Lai     echo "Checksums matches !"
16*7dc08ffcSJunyu Lai }
17*7dc08ffcSJunyu Lai # Run installer
18*7dc08ffcSJunyu Lai Start-Process $PSScriptRoot"\npcap.exe" -ArgumentList "/loopback_support=yes /S" -wait
19*7dc08ffcSJunyu Lai echo "Npcap installation completed"