diff --git a/.editorconfig b/.editorconfig index 4bb1cfa6..2315b117 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,12 +8,9 @@ indent_style = space indent_size = 4 trim_trailing_whitespace = true -[*.{ps1,rtf}] +[*.rtf] end_of_line = crlf -[*.ps1] -indent_style = tab - [{.gitignore,*.desktop}] indent_size = 0 diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 5288ed64..7560acf9 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -51,7 +51,24 @@ jobs: - name: Install dependencies if: ${{ matrix.os == 'windows' }} shell: powershell - run: .\resources\packaging\windows\scripts\npcap.ps1 -ARCH ${{ matrix.arch }} -OEM "${{ secrets.NPCAP_OEM_URL }}" + run: | + Write-Host "::group::Npcap SDK" + $ARCH = "${{ matrix.arch }}" + Invoke-WebRequest -Uri "https://npcap.com/dist/npcap-sdk-1.13.zip" -OutFile "$env:TEMP\npcap-sdk.zip" -Verbose + Expand-Archive -LiteralPath "$env:TEMP\npcap-sdk.zip" -DestinationPath "$env:TEMP\npcap-sdk" -Verbose + $LibPath = switch ($ARCH) + { + "i386" { "Lib" } + "amd64" { "Lib\x64" } + "arm64" { "Lib\ARM64" } + default { throw "$ARCH is not supported!" } + } + Add-Content -Path "$env:GITHUB_ENV" -Value "LIB=$env:TEMP\npcap-sdk\$LibPath" + Write-Host "::endgroup::" + Write-Host "::group::Npcap DLL" + Invoke-WebRequest -Uri "${{ secrets.NPCAP_OEM_URL }}" -OutFile "$env:TEMP\npcap-oem.exe" -Verbose + Start-Process -FilePath "$env:TEMP\npcap-oem.exe" -ArgumentList "/S" -Wait + Write-Host "::endgroup::" - name: Install Rust uses: actions-rs/toolchain@v1 @@ -264,7 +281,14 @@ jobs: - name: Install dependencies shell: powershell - run: .\resources\packaging\windows\scripts\wix.ps1 + run: | + Write-Host "::group::WiX Toolset" + Invoke-WebRequest ` + -Uri "https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip" ` + -OutFile "$env:TEMP\wix-binaries.zip" -Verbose + Expand-Archive -LiteralPath "$env:TEMP\wix-binaries.zip" -DestinationPath "$env:TEMP\wix" -Verbose + Set-Item -Path env:Path -Value "$env:Path;$env:TEMP\wix" + Write-Host "::endgroup::" - name: Install Rust uses: actions-rs/toolchain@v1 diff --git a/resources/packaging/windows/scripts/npcap.ps1 b/resources/packaging/windows/scripts/npcap.ps1 deleted file mode 100644 index 4b21c567..00000000 --- a/resources/packaging/windows/scripts/npcap.ps1 +++ /dev/null @@ -1,25 +0,0 @@ -[CmdletBinding()] -param ( - [Parameter(Mandatory)] - [ValidateSet("amd64", "i386", "arm64")] - [string]$ARCH, - [Parameter(Mandatory)] - [string]$OEM -) - -Write-Host "::group::Npcap SDK" -Invoke-WebRequest -Uri "https://npcap.com/dist/npcap-sdk-1.13.zip" -OutFile "$env:TEMP\\npcap-sdk.zip" -Verbose -Expand-Archive -LiteralPath "$env:TEMP\\npcap-sdk.zip" -DestinationPath "$env:TEMP\\npcap-sdk" -Verbose -$LibPath = switch ($ARCH) -{ - "amd64" { "Lib\\x64" } - "i386" { "Lib" } - "arm64" { "Lib\\ARM64" } -} -Add-Content -Path "$env:GITHUB_ENV" -Value "LIB=$env:TEMP\\npcap-sdk\\$LibPath" -Write-Host "::endgroup::" - -Write-Host "::group::Npcap DLL" -Invoke-WebRequest -Uri "$OEM" -OutFile "$env:TEMP\\npcap-oem.exe" -Verbose -Start-Process -FilePath "$env:TEMP\\npcap-oem.exe" -ArgumentList "/S" -Wait -Write-Host "::endgroup::" diff --git a/resources/packaging/windows/scripts/wix.ps1 b/resources/packaging/windows/scripts/wix.ps1 deleted file mode 100644 index 24a310d5..00000000 --- a/resources/packaging/windows/scripts/wix.ps1 +++ /dev/null @@ -1,5 +0,0 @@ -Write-Host "::group::WiX Toolset" -Invoke-WebRequest -Uri "https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip" -OutFile "$env:TEMP\\wix-binaries.zip" -Verbose -Expand-Archive -LiteralPath "$env:TEMP\\wix-binaries.zip" -DestinationPath "$env:TEMP\\wix" -Verbose -Set-Item -Path env:Path -Value "$env:Path;$env:TEMP\\wix" -Write-Host "::endgroup::"