fix WindowInjection
This commit is contained in:
@@ -831,12 +831,16 @@ jobs:
|
||||
shell: pwsh
|
||||
run: |
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
Set-Location rustdesk
|
||||
|
||||
$source = ".\third-party\RustDeskTempTopMostWindow"
|
||||
|
||||
Remove-Item $source `
|
||||
-Recurse -Force -ErrorAction SilentlyContinue
|
||||
Remove-Item `
|
||||
$source `
|
||||
-Recurse `
|
||||
-Force `
|
||||
-ErrorAction SilentlyContinue
|
||||
|
||||
git clone `
|
||||
https://github.com/rustdesk-org/RustDeskTempTopMostWindow `
|
||||
@@ -846,8 +850,14 @@ jobs:
|
||||
throw "RustDeskTempTopMostWindow clone failed"
|
||||
}
|
||||
|
||||
if ($env:TOPMOST_COMMIT -ne "HEAD") {
|
||||
git -C $source checkout "$env:TOPMOST_COMMIT"
|
||||
if (
|
||||
-not [string]::IsNullOrWhiteSpace($env:TOPMOST_COMMIT) -and
|
||||
$env:TOPMOST_COMMIT -ne "HEAD"
|
||||
) {
|
||||
git `
|
||||
-C $source `
|
||||
checkout `
|
||||
"$env:TOPMOST_COMMIT"
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "RustDeskTempTopMostWindow checkout failed"
|
||||
@@ -857,9 +867,46 @@ jobs:
|
||||
$vswhere = `
|
||||
"${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
|
||||
|
||||
if (-not (Test-Path $vswhere)) {
|
||||
throw "vswhere.exe not found"
|
||||
}
|
||||
|
||||
$vsInfo = & $vswhere `
|
||||
-latest `
|
||||
-products * `
|
||||
-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
|
||||
-format json |
|
||||
ConvertFrom-Json
|
||||
|
||||
if (-not $vsInfo) {
|
||||
throw "Visual Studio C++ Build Tools not found"
|
||||
}
|
||||
|
||||
$vsPath = $vsInfo[0].installationPath
|
||||
$vsVersion = $vsInfo[0].installationVersion
|
||||
|
||||
Write-Host "Visual Studio:"
|
||||
Write-Host " Path: $vsPath"
|
||||
Write-Host " Version: $vsVersion"
|
||||
|
||||
$vsMajor = [int]($vsVersion.Split(".")[0])
|
||||
|
||||
$platformToolset = switch ($vsMajor) {
|
||||
17 { "v143" }
|
||||
16 { "v142" }
|
||||
15 { "v141" }
|
||||
|
||||
default {
|
||||
throw "Unsupported Visual Studio major version: $vsMajor"
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "PlatformToolset: $platformToolset"
|
||||
|
||||
$msbuild = & $vswhere `
|
||||
-latest `
|
||||
-products * `
|
||||
-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
|
||||
-find "MSBuild\**\Bin\MSBuild.exe" |
|
||||
Select-Object -First 1
|
||||
|
||||
@@ -867,26 +914,35 @@ jobs:
|
||||
throw "MSBuild.exe not found"
|
||||
}
|
||||
|
||||
Write-Host "MSBuild: $msbuild"
|
||||
|
||||
& $msbuild `
|
||||
"$source\WindowInjection\WindowInjection.vcxproj" `
|
||||
"-p:Configuration=Release" `
|
||||
"-p:Platform=x64" `
|
||||
"-p:PlatformToolset=$platformToolset" `
|
||||
"/p:TargetVersion=Windows10"
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "WindowInjection.dll build failed"
|
||||
}
|
||||
|
||||
$dll = "$source\WindowInjection\x64\Release\WindowInjection.dll"
|
||||
$dll = `
|
||||
"$source\WindowInjection\x64\Release\WindowInjection.dll"
|
||||
|
||||
if (-not (Test-Path $dll)) {
|
||||
throw "WindowInjection.dll not found"
|
||||
throw "WindowInjection.dll not found: $dll"
|
||||
}
|
||||
|
||||
Copy-Item $dll `
|
||||
Copy-Item `
|
||||
$dll `
|
||||
".\dist\rustdesk\WindowInjection.dll" `
|
||||
-Force
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "WindowInjection.dll built successfully"
|
||||
Write-Host "PlatformToolset: $platformToolset"
|
||||
|
||||
- name: Add usbmmidd
|
||||
shell: pwsh
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user