Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1449bb059b | ||
|
|
e006bfd613 |
+1
-1
@@ -18,4 +18,4 @@ runs:
|
|||||||
- name: Collect dependencies
|
- name: Collect dependencies
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
"${{ github.action_path }}\collect.ps1" -Executable "${{ inputs.executable }}" -Output "${{ inputs.output }}"
|
& "${{ github.action_path }}\collect.ps1" -Executable "${{ inputs.executable }}" -Output "${{ inputs.output }}"
|
||||||
+37
-2
@@ -14,6 +14,42 @@ if (-not (Test-Path $Executable)) {
|
|||||||
|
|
||||||
New-Item -ItemType Directory -Force -Path $Output | Out-Null
|
New-Item -ItemType Directory -Force -Path $Output | Out-Null
|
||||||
|
|
||||||
|
$vswherePath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
|
||||||
|
|
||||||
|
if (-not (Test-Path $vswherePath)) {
|
||||||
|
throw "Could not locate vswhere.exe. Verify that Visual Studio or Visual Studio Build Tools is installed."
|
||||||
|
}
|
||||||
|
|
||||||
|
$visualStudioPath = & $vswherePath `
|
||||||
|
-latest `
|
||||||
|
-products * `
|
||||||
|
-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
|
||||||
|
-property installationPath
|
||||||
|
|
||||||
|
if (-not $visualStudioPath) {
|
||||||
|
throw "Could not locate a Visual Studio installation with the MSVC C++ tools installed."
|
||||||
|
}
|
||||||
|
|
||||||
|
$toolsetVersionPath = Join-Path `
|
||||||
|
$visualStudioPath `
|
||||||
|
"VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt"
|
||||||
|
|
||||||
|
if (-not (Test-Path $toolsetVersionPath)) {
|
||||||
|
throw "Could not locate the MSVC toolset version file."
|
||||||
|
}
|
||||||
|
|
||||||
|
$toolsetVersion = (Get-Content $toolsetVersionPath -Raw).Trim()
|
||||||
|
|
||||||
|
$dumpbinPath = Join-Path `
|
||||||
|
$visualStudioPath `
|
||||||
|
"VC\Tools\MSVC\$toolsetVersion\bin\Hostx64\x64\dumpbin.exe"
|
||||||
|
|
||||||
|
if (-not (Test-Path $dumpbinPath)) {
|
||||||
|
throw "Could not locate dumpbin.exe at: $dumpbinPath"
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "Using dumpbin: $dumpbinPath"
|
||||||
|
|
||||||
$windowsDirectories = @(
|
$windowsDirectories = @(
|
||||||
$env:WINDIR,
|
$env:WINDIR,
|
||||||
(Join-Path $env:WINDIR "System32"),
|
(Join-Path $env:WINDIR "System32"),
|
||||||
@@ -66,13 +102,12 @@ function Copy-Dependencies {
|
|||||||
|
|
||||||
$binaryDirectory = Split-Path -Parent $Binary
|
$binaryDirectory = Split-Path -Parent $Binary
|
||||||
|
|
||||||
$dependencies = dumpbin /DEPENDENTS $Binary |
|
$dependencies = & $dumpbinPath /DEPENDENTS $Binary |
|
||||||
Select-String '^\s+.*\.dll$' |
|
Select-String '^\s+.*\.dll$' |
|
||||||
ForEach-Object { $_.Line.Trim() } |
|
ForEach-Object { $_.Line.Trim() } |
|
||||||
Sort-Object -Unique
|
Sort-Object -Unique
|
||||||
|
|
||||||
foreach ($dll in $dependencies) {
|
foreach ($dll in $dependencies) {
|
||||||
|
|
||||||
$key = $dll.ToLowerInvariant()
|
$key = $dll.ToLowerInvariant()
|
||||||
|
|
||||||
if ($processed.ContainsKey($key)) {
|
if ($processed.ContainsKey($key)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user