fix WindowInjection

This commit is contained in:
gandc committed 2026-09-13 16:03:45 +03:00
1 parent b21215c582
commit 0f6e1bef32
1 file changed
+63 -7
+63 -7
View File
@@ -831,12 +831,16 @@ jobs:
shell: pwsh shell: pwsh
run: | run: |
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
Set-Location rustdesk Set-Location rustdesk
$source = ".\third-party\RustDeskTempTopMostWindow" $source = ".\third-party\RustDeskTempTopMostWindow"
Remove-Item $source ` Remove-Item `
-Recurse -Force -ErrorAction SilentlyContinue $source `
-Recurse `
-Force `
-ErrorAction SilentlyContinue
git clone ` git clone `
https://github.com/rustdesk-org/RustDeskTempTopMostWindow ` https://github.com/rustdesk-org/RustDeskTempTopMostWindow `
@@ -846,8 +850,14 @@ jobs:
throw "RustDeskTempTopMostWindow clone failed" throw "RustDeskTempTopMostWindow clone failed"
} }
if ($env:TOPMOST_COMMIT -ne "HEAD") { if (
git -C $source checkout "$env:TOPMOST_COMMIT" -not [string]::IsNullOrWhiteSpace($env:TOPMOST_COMMIT) -and
$env:TOPMOST_COMMIT -ne "HEAD"
) {
git `
-C $source `
checkout `
"$env:TOPMOST_COMMIT"
if ($LASTEXITCODE -ne 0) { if ($LASTEXITCODE -ne 0) {
throw "RustDeskTempTopMostWindow checkout failed" throw "RustDeskTempTopMostWindow checkout failed"
@@ -857,9 +867,46 @@ jobs:
$vswhere = ` $vswhere = `
"${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" "${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 ` $msbuild = & $vswhere `
-latest ` -latest `
-products * ` -products * `
-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
-find "MSBuild\**\Bin\MSBuild.exe" | -find "MSBuild\**\Bin\MSBuild.exe" |
Select-Object -First 1 Select-Object -First 1
@@ -867,26 +914,35 @@ jobs:
throw "MSBuild.exe not found" throw "MSBuild.exe not found"
} }
Write-Host "MSBuild: $msbuild"
& $msbuild ` & $msbuild `
"$source\WindowInjection\WindowInjection.vcxproj" ` "$source\WindowInjection\WindowInjection.vcxproj" `
"-p:Configuration=Release" ` "-p:Configuration=Release" `
"-p:Platform=x64" ` "-p:Platform=x64" `
"-p:PlatformToolset=$platformToolset" `
"/p:TargetVersion=Windows10" "/p:TargetVersion=Windows10"
if ($LASTEXITCODE -ne 0) { if ($LASTEXITCODE -ne 0) {
throw "WindowInjection.dll build failed" throw "WindowInjection.dll build failed"
} }
$dll = "$source\WindowInjection\x64\Release\WindowInjection.dll" $dll = `
"$source\WindowInjection\x64\Release\WindowInjection.dll"
if (-not (Test-Path $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" ` ".\dist\rustdesk\WindowInjection.dll" `
-Force -Force
Write-Host ""
Write-Host "WindowInjection.dll built successfully"
Write-Host "PlatformToolset: $platformToolset"
- name: Add usbmmidd - name: Add usbmmidd
shell: pwsh shell: pwsh
run: | run: |