forked from ge9/IddSampleDriver
-
-
Notifications
You must be signed in to change notification settings - Fork 371
189 lines (158 loc) · 7.61 KB
/
compile.yml
File metadata and controls
189 lines (158 loc) · 7.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
name: Virtual Display Driver Building
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
configuration: [Debug, Release]
platform: [x64, ARM64]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
- name: Check Chocolatey installation
run: choco --version
- name: Install Visual Studio 2022 dependencies
run: |
choco install visualstudio2022-workload-manageddesktop -y
if ($LASTEXITCODE -ne 0) { exit 1 }
choco install visualstudio2022-workload-nativedesktop -y
if ($LASTEXITCODE -ne 0) { exit 1 }
choco install visualstudio2022-workload-vctools -y
if ($LASTEXITCODE -ne 0) { exit 1 }
choco install windowsdriverkit11 -y
if ($LASTEXITCODE -ne 0) { exit 1 }
# Fix the string conversion warning treated as error
- name: Fix string conversion in Driver.cpp
run: |
$filePath = "Virtual Display Driver (HDR)/MttVDD/Driver.cpp"
$content = Get-Content -Path $filePath -Raw
$content = $content -replace 'string edidPath\(edidname\.begin\(\), edidname\.end\(\)\);', 'string edidPath = WStringToString(edidname);'
Set-Content -Path $filePath -Value $content
# Fix the missing InfVerif.dll issue
- name: Fix WDK paths for InfVerif
run: |
# Find where infverif.dll actually exists in the WDK installation
Write-Host "Searching for infverif.dll..."
Get-ChildItem -Path "C:\Program Files (x86)\Windows Kits\10" -Recurse -Filter "infverif.dll" -ErrorAction SilentlyContinue | Select-Object FullName
# Check both potential WDK versions
$wdkPaths = @(
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0",
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0"
)
foreach ($basePath in $wdkPaths) {
Write-Host "Checking $basePath..."
if (Test-Path "$basePath\x86") {
# Create the subfolder if it doesn't exist
if (-not (Test-Path "$basePath\x86\x86")) {
New-Item -Path "$basePath\x86\x86" -ItemType Directory -Force
Write-Host "Created directory: $basePath\x86\x86"
}
# Copy files if they exist
if (Test-Path "$basePath\x86\infverif.dll") {
Copy-Item "$basePath\x86\infverif.dll" "$basePath\x86\x86\" -Force
Write-Host "Copied infverif.dll to $basePath\x86\x86\"
} elseif (Test-Path "$basePath\x86\InfVerif.exe") {
# Sometimes it's an exe instead of dll
Copy-Item "$basePath\x86\InfVerif.exe" "$basePath\x86\x86\" -Force
Write-Host "Copied InfVerif.exe to $basePath\x86\x86\"
}
# List contents to verify
Write-Host "Contents of $basePath\x86\x86:"
Get-ChildItem "$basePath\x86\x86" -ErrorAction SilentlyContinue
}
}
# Try another approach - check if we need to extract infverif.dll from somewhere
Write-Host "Checking for InfVerif.exe..."
$infVerifExe = Get-ChildItem -Path "C:\Program Files (x86)\Windows Kits\10" -Recurse -Filter "InfVerif.exe" -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty FullName
if ($infVerifExe) {
Write-Host "Found InfVerif.exe at: $infVerifExe"
$exeDir = Split-Path -Parent $infVerifExe
$targetDir = "$exeDir\x86"
# Create directory if needed
if (-not (Test-Path $targetDir)) {
New-Item -Path $targetDir -ItemType Directory -Force
Write-Host "Created directory: $targetDir"
}
# Create a dummy infverif.dll if needed
if (-not (Test-Path "$targetDir\infverif.dll")) {
# Create empty dll as placeholder (this is a hacky fix but might work)
[System.IO.File]::WriteAllBytes("$targetDir\infverif.dll", [byte[]]@(0x4D, 0x5A))
Write-Host "Created placeholder infverif.dll at: $targetDir\infverif.dll"
}
}
# Print the directory structure to help diagnose
Write-Host "WDK bin directory structure:"
Get-ChildItem "C:\Program Files (x86)\Windows Kits\10\bin" -Recurse -Depth 3 | Where-Object { $_.Name -like "*inf*" -or $_.FullName -like "*\x86\*" }
- name: Build the driver
run: |
msbuild "Virtual Display Driver (HDR)/MTTVDD.sln" /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }}
- name: List build directory
run: dir "Virtual Display Driver (HDR)\${{ matrix.platform }}\${{ matrix.configuration }}\MttVDD"
- name: Upload built driver
id: upload_artifact
uses: actions/upload-artifact@v4
with:
name: Built-Driver-${{ matrix.configuration }}-${{ matrix.platform }}
path: |
Virtual Display Driver (HDR)\${{ matrix.platform }}\${{ matrix.configuration }}\MttVDD\MttVDD.dll
Virtual Display Driver (HDR)\${{ matrix.platform }}\${{ matrix.configuration }}\MttVDD\MttVDD.inf
Virtual Display Driver (HDR)\${{ matrix.platform }}\${{ matrix.configuration }}\MttVDD\mttvdd.cat
Virtual Display Driver (HDR)\${{ matrix.platform }}\${{ matrix.configuration }}\MttVDD\vdd_settings.xml
- name: Generate release tag
id: generate_tag
run: |
$releaseTag = (Get-Date).ToString('yy.MM.dd')
echo "RELEASE_TAG=$releaseTag" >> $env:GITHUB_ENV
- name: Show generated release tag
run: |
echo "Generated Release Tag: ${{ env.RELEASE_TAG }}"
- name: Verify Built Artifacts
run: dir 'Virtual Display Driver (HDR)\${{ matrix.platform }}\${{ matrix.configuration }}\MttVDD'
prepare_installer:
runs-on: windows-latest
needs: build
strategy:
matrix:
configuration: [Release]
platform: [x64, ARM64]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: Built-Driver-${{ matrix.configuration }}-${{ matrix.platform }}
path: SignedArtifacts
- name: Prepare Setup Repository
run: |
git clone https://${{ secrets.READ_REPO }}@github.com/VirtualDisplay/Virtual-Driver-Installer.git inno-setup
- name: Prepare build directories
shell: pwsh
run: |
$env:PLATFORM = "${{ matrix.platform }}"
. '.github/workflows/build-fix.ps1'
- name: Prepare Setup
run: |
$platform = "${{ matrix.platform }}"
# All directory and file operations are now handled by the build-fix.ps1 script
Write-Host "Platform: $platform - Setup completed by build-fix.ps1 script"
- name: Compile Installer
uses: Minionguyjpro/Inno-Setup-Action@v1.2.2
with:
path: inno-setup\Setup.iss
options: /O+
- name: Upload Installer as artifact
uses: actions/upload-artifact@v4
with:
name: Installer-${{ matrix.configuration }}-${{ matrix.platform }}
path: inno-setup\output\*.exe