-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompilingGuidelineWin.html
More file actions
603 lines (576 loc) · 25 KB
/
Copy pathCompilingGuidelineWin.html
File metadata and controls
603 lines (576 loc) · 25 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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>VeraCrypt - Free Open source disk encryption with strong security for the Paranoid</title>
<meta name="description" content="VeraCrypt is free open-source disk encryption software for Windows, Mac OS X and Linux. In case an attacker forces you to reveal the password, VeraCrypt provides plausible deniability. In contrast to file encryption, data encryption performed by VeraCrypt is real-time (on-the-fly), automatic, transparent, needs very little memory, and does not involve temporary unencrypted files."/>
<meta name="keywords" content="encryption, security"/>
<link href="styles.css" rel="stylesheet" type="text/css" />
<style>
.textbox {
vertical-align: top;
height: auto !important;
font-family: Helvetica,sans-serif;
font-size: 20px;
font-weight: bold;
margin: 10px;
padding: 10px;
background-color: white;
width: auto;
border-radius: 10px;
}
.texttohide {
font-family: Helvetica,sans-serif;
font-size: 14px;
font-weight: normal;
}
</style>
</head>
<body>
<div>
<a href="Documentation.html"><img src="VeraCrypt128x128.png" alt="VeraCrypt"/></a>
</div>
<div id="menu">
<ul>
<li><a href="Home.html">Home</a></li>
<li><a href="Code.html">Source Code</a></li>
<li><a href="Downloads.html">Downloads</a></li>
<li><a class="active" href="Documentation.html">Documentation</a></li>
<li><a href="Donation.html">Donate</a></li>
<li><a href="https://sourceforge.net/p/veracrypt/discussion/" target="_blank">Forums</a></li>
</ul>
</div>
<div>
<p>
<a href="Documentation.html">Documentation</a>
<img src="arrow_right.gif" alt=">>" style="margin-top: 5px">
<a href="Technical%20Details.html">Technical Details</a>
<img src="arrow_right.gif" alt=">>" style="margin-top: 5px">
<a href="CompilingGuidelines.html">Building VeraCrypt From Source</a>
<img src="arrow_right.gif" alt=">>" style="margin-top: 5px">
<a href="CompilingGuidelineWin.html">Windows Build Guide</a>
</p></div>
<div class="wikidoc">
This guide describes how to set up a Windows system that can compile VeraCrypt. Further it is described how VeraCrypt is going to be compiled. <br>
The procedure for a Windows 10/11 system is described here as an example, but the procedure for other Windows systems is analogous.
</div>
<div class="wikidoc">
The following components are required for compiling the current VeraCrypt Windows binaries and drivers; optional alternatives or release-only tools are marked accordingly:
<ol>
<li>Microsoft Visual Studio 2022, or Build Tools for Visual Studio 2022 as a command-line alternative</li>
<li>MSVC v143 C++ toolset with x86/x64 and ARM64 components</li>
<li>Windows 10/11 SDK (10.0.19041.0 or newer), including signtool.exe for signing scripts. If the SDK and WDK are installed separately, use matching build numbers.</li>
<li>Windows Driver Kit for Windows 10/11 with the Visual Studio 2022 extension</li>
<li>NASM</li>
<li>YASM</li>
<li>WiX Toolset v3.x (required for MSI packages)</li>
<li>Legacy BIOS bootloader tools (optional; required only when rebuilding the Boot project): Microsoft Visual C++ 1.52, gzip, UPX, and dd.exe</li>
</ol>
</div>
<div class="wikidoc">
Below are the procedure steps. Clicking on any of the link takes directly to the related step:
<ul>
<li><strong><a href="#InstallationOfNASM">Installation of NASM</a></strong></li>
<li><strong><a href="#InstallationOfYASM">Installation of YASM</a></strong></li>
<li><strong><a href="#InstallationOfLegacyBootTools">Installation of Legacy BIOS Bootloader Tools (optional)</a></strong></li>
<li><strong><a href="#InstallationOfWix3">Installation of WiX Toolset v3.x</a></strong></li>
<li><strong><a href="#InstallationOfVS2022">Installation of Microsoft Visual Studio 2022</a></strong></li>
<li><strong><a href="#InstallationOfWDK10">Installation of the Windows Driver Kit</a></strong></li>
<li><strong><a href="#InstallationOfVisualBuildTools">Installation of the Build Tools for Visual Studio 2022</a></strong></li>
<li><strong><a href="#DownloadVeraCrypt">Download VeraCrypt Source Files</a></strong></li>
<li><strong><a href="#CompileWin32X64">Compile the x64, ARM64 and Driver Builds of VeraCrypt</a></strong></li>
<li><strong><a href="#BuildVeraCryptExecutables">Build the VeraCrypt Executables</a></strong></li>
<li><strong><a href="#ImportCertificates">Import the Certificates</a></strong></li>
<li><strong><a href="#KnownIssues">Known Issues</a></strong></li>
</ul>
</div>
<div class="wikidoc">
<div class="textbox" id="InstallationOfNASM">
<a href="#InstallationOfNASM">Installation of NASM</a>
<div class="texttohide">
<p>
<ol>
<li>
Download “nasm-2.08-installer.exe” at: <br>
<a href="https://www.nasm.us/pub/nasm/releasebuilds/2.08/win32/" target="_blank">https://www.nasm.us/pub/nasm/releasebuilds/2.08/win32/</a>
</li>
<li>
Run the file as administrator
</li>
<li>
Install NASM with the default settings
</li>
<li>
Add NASM to the path Variable. This will make the command globally available on the command line. <br>
<ol style="list-style-type: upper-roman;">
<li>
Open a file explorer
</li>
<li>
Within the left file tree, please make a right click on "This PC" and select "Properties" <br>
<img src="CompilingGuidelineWin/SelectThisPC.jpg" width="40%">
</li>
<li>
Within the right menu, please click on "Advanced system settings" <br>
<img src="CompilingGuidelineWin/SelectAdvancedSystemSettings.jpg" width="50%">
</li>
<li>
Please click on "Environment Variables" <br>
<img src="CompilingGuidelineWin/SelectEnvironmentVariables.jpg" width="17%">
</li>
<li>
Within the area of the system variables, please select the "Path" variable and click on "Edit..." <br>
<img src="CompilingGuidelineWin/SelectPathVariable.jpg" width="25%">
</li>
<li>
Click on "New" and add the following value: <br>
<p style="font-family: 'Courier New', monospace;">C:\Program Files (x86)\nasm</p>
</li>
<li>
Close the windows by clicking on "OK"
</li>
</ol>
</li>
<li>
To check if the configuration is working correctly, please open a command prompt and watch the output of the following command: <br>
<p style="font-family: 'Courier New', monospace;">nasm</p> <br>
<img src="CompilingGuidelineWin/NasmCommandLine.jpg" width="50%">
</li>
</ol>
</p>
</div>
</div>
<div class="textbox" id="InstallationOfYASM">
<a href="#InstallationOfYASM">Installation of YASM</a>
<div class="texttohide">
<p>
<ol>
<li>
Please create the following folder: <br>
C:\Program Files\YASM
</li>
<li>
Please download the prebuilt Win64 YASM zip archive at: <br>
<a href="https://github.com/yasm/yasm/releases/tag/v1.3.0" target="_blank">https://github.com/yasm/yasm/releases/tag/v1.3.0</a>
</li>
<li>
Your browser might inform you that the file might be a security risk due to the low download rate or the unencrypted connection. Nevertheless, the official website is the most reliable source for this file, so we recommend to allow the download
</li>
<li>
Unzip the zip file and copy the files to “C:\Program Files\YASM”
</li>
<li>
Please download the file "Win64 .exe" at: <br>
<a href="https://github.com/yasm/yasm/releases/tag/v1.3.0" target="_blank">https://github.com/yasm/yasm/releases/tag/v1.3.0</a>
</li>
<li>
Your browser might inform you that the file might be a security risk due to the low download rate or the unencrypted connection. Nevertheless, the official website is the most reliable source for this file, so we recommend to allow the download
</li>
<li>
Rename the file to “yasm.exe” and copy it to “C:\Program Files\YASM”
</li>
<li>
Add YASM to the path Variable and create a new system variable for YASM. This will make the command globally available on the command line. <br>
<ol style="list-style-type: upper-roman;">
<li>
Open a file explorer
</li>
<li>
Within the left file tree, please make a right click on "This PC" and select "Properties" <br>
<img src="CompilingGuidelineWin/SelectThisPC.jpg" width="40%">
</li>
<li>
Within the right menu, please click on "Advanced system settings" <br>
<img src="CompilingGuidelineWin/SelectAdvancedSystemSettings.jpg" width="50%">
</li>
<li>
Please click on "Environment Variables" <br>
<img src="CompilingGuidelineWin/SelectEnvironmentVariables.jpg" width="17%">
</li>
<li>
Within the area of the system variables, please select the "Path" variable and click on "Edit..." <br>
<img src="CompilingGuidelineWin/SelectPathVariable.jpg" width="25%">
</li>
<li>
Click on "New" and add the following value: <br>
<p style="font-family: 'Courier New', monospace;">C:\Program Files\YASM</p>
</li>
<li>
Close the top window by clicking on "OK"
</li>
<li>
Within the area of the system variables, please click on "New..." <br>
<img src="CompilingGuidelineWin/AddNewSystemVar.jpg" width="25%">
</li>
<li>
Fill out the form with the following values: <br>
<p style="font-family: 'Courier New', monospace;">Variable name: YASMPATH<br> Variable value: C:\Program Files\YASM</p>
</li>
<li>
Close the windows by clicking on "OK"
</li>
</ol>
</li>
<li>
To check if the configuration is working correctly, please open a command prompt and watch the output of the following command: <br>
<p style="font-family: 'Courier New', monospace;">yasm</p> <br>
and <br>
<p style="font-family: 'Courier New', monospace;">vsyasm</p> <br>
<img src="CompilingGuidelineWin/YasmCommandLine.jpg" width="50%">
</li>
</ol>
</p>
</div>
</div>
<div class="textbox" id="InstallationOfLegacyBootTools">
<a href="#InstallationOfLegacyBootTools">Installation of Legacy BIOS Bootloader Tools (optional)</a>
<div class="texttohide">
<p>
These tools are not required to compile the standard VeraCrypt application binaries or the Windows driver with Visual Studio 2022 and the current WDK. Install them only when you need to rebuild the legacy BIOS bootloader in "src\Boot\Windows" or build solution configurations that include the Boot project, such as "ReleaseCustomEFI".
<ol>
<li>
Install Microsoft Visual C++ 1.52. It is available via the paid Microsoft MSDN subscription. If you do not have a subscription, the ISO image is also archived at: <br>
<a href="https://archive.org/details/ms-vc152" target="_blank">https://archive.org/details/ms-vc152</a>
</li>
<li>
Create the folder "C:\MSVC15". Mount the ISO file and copy the content of the folder "MSVC" to "C:\MSVC15".
</li>
<li>
Create a system variable named "MSVC16_ROOT" with the value "C:\MSVC15".
</li>
<li>
Install gzip and add the folder containing "gzip.exe" to the Path variable.
</li>
<li>
Install UPX and add the folder containing "upx.exe" to the Path variable.
</li>
<li>
Install a Windows port of dd and add the folder containing "dd.exe" to the Path variable.
</li>
<li>
Open a new command prompt and verify that the following commands are found: <br>
<p style="font-family: 'Courier New', monospace;">nasm<br>gzip<br>upx<br>dd --help</p>
</li>
</ol>
</p>
</div>
</div>
<div class="textbox" id="InstallationOfWix3">
<a href="#InstallationOfWix3">Installation of WiX Toolset v3.x</a>
<div class="texttohide">
<p>
<ol>
<li>
Please download WiX Toolset v3.x at: <br>
<a href="https://github.com/wixtoolset/wix3/releases" target="_blank">https://github.com/wixtoolset/wix3/releases</a>
</li>
<li>
Run the downloaded file as administrator and install WiX Toolset with default settings
</li>
</ol>
</p>
</div>
</div>
<div class="textbox" id="InstallationOfVS2022">
<a href="#InstallationOfVS2022">Installation of Microsoft Visual Studio 2022</a>
<div class="texttohide">
<p>
<ol>
<li>
Download Visual Studio 2022 at: <br>
<a href="https://visualstudio.microsoft.com/vs/" target="_blank">https://visualstudio.microsoft.com/vs/</a>
</li>
<li>
Run the downloaded installer as administrator.
</li>
<li>
Select the "Desktop development with C++" workload.
</li>
<li>
Select the following individual components:
<ol style="list-style-type: upper-roman;">
<li>MSVC v143 - VS 2022 C++ x64/x86 build tools (Latest)</li>
<li>MSVC v143 - VS 2022 C++ x64/x86 Spectre-mitigated libs (Latest)</li>
<li>MSVC v143 - VS 2022 C++ ARM64 build tools (Latest)</li>
<li>MSVC v143 - VS 2022 C++ ARM64 Spectre-mitigated libs (Latest)</li>
<li>C++ ATL for latest v143 build tools (x86 & x64)</li>
<li>C++ ATL for latest v143 build tools (ARM64)</li>
<li>C++ ATL for latest v143 build tools with Spectre Mitigations (x86 & x64)</li>
<li>C++ ATL for latest v143 build tools with Spectre Mitigations (ARM64)</li>
<li>C++ MFC for latest v143 build tools (x86 & x64)</li>
<li>C++ MFC for latest v143 build tools (ARM64)</li>
<li>C++ MFC for latest v143 build tools with Spectre Mitigations (x86 & x64)</li>
<li>C++ MFC for latest v143 build tools with Spectre Mitigations (ARM64)</li>
<li>Windows 10/11 SDK (10.0.19041.0 or newer)</li>
</ol>
</li>
</ol>
</p>
</div>
</div>
<div class="textbox" id="InstallationOfWDK10">
<a href="#InstallationOfWDK10">Installation of the Windows Driver Kit</a>
<div class="texttohide">
<p>
<ol>
<li>
Please download a Windows Driver Kit (WDK) version compatible with Visual Studio 2022 at: <br>
<a href="https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk" target="_blank">https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk</a>
</li>
<li>
Run the downloaded file as administrator and install the WDK with default settings.
</li>
<li>
If you install the Windows SDK and WDK separately, make sure their build numbers match.
</li>
<li>
Make sure the WDK Visual Studio extension is installed. If the WDK installer asks whether to "install Windows Driver Kit Visual Studio extension", select this option before closing the dialog. On current Visual Studio 2022 installers, this can also be installed from Individual Components by selecting "Windows Driver Kit".
</li>
<li>
If a separate VSIX setup starts automatically, it will detect Visual Studio 2022 as a possible target for the extension. Please select it and proceed with the installation.
</li>
</ol>
</p>
</div>
</div>
<div class="textbox" id="InstallationOfVisualBuildTools">
<a href="#InstallationOfVisualBuildTools">Installation of the Build Tools for Visual Studio 2022</a>
<div class="texttohide">
<p>
If you installed Visual Studio 2022 with the components listed above, this step can be skipped. Install the Build Tools only if you need a command-line build environment without the full Visual Studio IDE.
<ol>
<li>
Download the Build Tools for Visual Studio 2022 at: <br>
<a href="https://visualstudio.microsoft.com/downloads/" target="_blank">https://visualstudio.microsoft.com/downloads/</a>
</li>
<li>
Run the downloaded installer as administrator and select the "C++ build tools" workload.
</li>
<li>
Select the following individual components:
<ol style="list-style-type: upper-roman;">
<li>MSVC v143 - VS 2022 C++ x64/x86 build tools (Latest)</li>
<li>MSVC v143 - VS 2022 C++ x64/x86 Spectre-mitigated libs (Latest)</li>
<li>MSVC v143 - VS 2022 C++ ARM64 build tools (Latest)</li>
<li>MSVC v143 - VS 2022 C++ ARM64 Spectre-mitigated libs (Latest)</li>
<li>C++ ATL for latest v143 build tools (x86 & x64)</li>
<li>C++ ATL for latest v143 build tools (ARM64)</li>
<li>C++ ATL for latest v143 build tools with Spectre Mitigations (x86 & x64)</li>
<li>C++ ATL for latest v143 build tools with Spectre Mitigations (ARM64)</li>
<li>C++ MFC for latest v143 build tools (x86 & x64)</li>
<li>C++ MFC for latest v143 build tools (ARM64)</li>
<li>C++ MFC for latest v143 build tools with Spectre Mitigations (x86 & x64)</li>
<li>C++ MFC for latest v143 build tools with Spectre Mitigations (ARM64)</li>
<li>Windows 10/11 SDK (10.0.19041.0 or newer)</li>
</ol>
</li>
</ol>
</p>
</div>
</div>
<div class="textbox" id="DownloadVeraCrypt">
<a href="#DownloadVeraCrypt">Download VeraCrypt Source Files</a>
<div class="texttohide">
<p>
<ol>
<li>
Visit the VeraCrypt Github repository at: <br>
<a href="https://github.com/veracrypt/VeraCrypt" target="_blank">https://github.com/veracrypt/VeraCrypt</a>
</li>
<li>
Please click on the green button with the label "Code" and download the code. <br>
You can download the repository as zip file, but you may consider to use the git protocol in order to track changes.
</li>
</ol>
</p>
</div>
</div>
<div class="textbox" id="CompileWin32X64">
<a href="#CompileWin32X64">Compile the x64, ARM64 and Driver Builds of VeraCrypt</a>
<div class="texttohide">
<p>
<ol>
<li>
Please open the file "src/VeraCrypt.sln" in Visual Studio <b>2022</b>
</li>
<li>
Please select "Release|x64" as active configuration.
</li>
<li>
Please click on "Build -> Build Solution".
</li>
<li>
The compiling process should end with warnings, but without errors. Some projects should be skipped.
</li>
<li>
Please select "Release|ARM64" as active configuration.
</li>
<li>
Please click on "Build -> Build Solution".
</li>
<li>
The compiling process should end with warnings, but without errors. Some projects should be skipped.
</li>
<li>
Please select "Release|Win32" as active configuration and build the solution to compile the Win32 setup/helper projects used by the release packaging scripts.
</li>
<li>
To build VeraCrypt drivers, select the "Driver" project and build it for "Release|x64" and "Release|ARM64".
</li>
<li>
Build "ReleaseCustomEFI|x64" or "ReleaseCustomEFI|ARM64" only if you need the custom EFI/bootloader release configurations. These configurations include the Boot project and require the optional legacy BIOS bootloader tools listed above.
</li>
<li>
If you are using Build Tools for Visual Studio 2022 instead of the Visual Studio IDE, open "Developer Command Prompt for VS 2022" or "Developer PowerShell for VS 2022" as administrator, change to the VeraCrypt source root, and run the equivalent MSBuild commands:
<br>
<code>
msbuild src\VeraCrypt.sln /m /p:Configuration=Release /p:Platform=x64 <br>
msbuild src\VeraCrypt.sln /m /p:Configuration=Release /p:Platform=ARM64 <br>
msbuild src\VeraCrypt.sln /m /p:Configuration=Release /p:Platform=Win32 <br>
msbuild src\Driver\Driver.vcxproj /m /p:Configuration=Release /p:Platform=x64 <br>
msbuild src\Driver\Driver.vcxproj /m /p:Configuration=Release /p:Platform=ARM64
</code>
<br>
To build the optional custom EFI/bootloader release configurations, also run:
<br>
<code>
msbuild src\VeraCrypt.sln /m /p:Configuration=ReleaseCustomEFI /p:Platform=x64 <br>
msbuild src\VeraCrypt.sln /m /p:Configuration=ReleaseCustomEFI /p:Platform=ARM64
</code>
</li>
<li>
If you built from the IDE, please close Visual Studio 2022 after the compiling process finished.
</li>
</ol>
</p>
</div>
</div>
<div class="textbox" id="BuildVeraCryptExecutables">
<a href="#BuildVeraCryptExecutables">Build the VeraCrypt Executables</a>
<div class="texttohide">
<p>
<ol>
<li>
Please open a Visual Studio 2022 command line as administrator so that the Windows SDK signing tools, including "signtool.exe", are available on the Path.
</li>
<li>
Go into the folder "src/Signing/"
</li>
<li>
Run the script "sign_test.bat"
</li>
<li>
You will find the generated executables within the folder "src/Release/Setup Files"
</li>
</ol>
</p>
</div>
</div>
<div class="textbox" id="ImportCertificates">
<a href="#ImportCertificates">Import the Certificates</a>
<div class="texttohide">
<p> With the sign_test.bat script you just signed the VeraCrypt executables. This is necessary, since Windows only accepts drivers, which are trusted by a signed Certificate Authority. <br>
Since you did not use the official VeraCrypt signing certificate to sign your code, but a public development version, you have to import and therefore trust the certificates used.
<ol>
<li>
Open the folder "src/Signing"
</li>
<li>
Import the following certificates to your Local Machine Certificate storage, by double clicking them:
<ul>
<li>GlobalSign_R3Cross.cer</li>
<li>GlobalSign_SHA256_EV_CodeSigning_CA.cer</li>
<li>TestCertificate/idrix_codeSign.pfx</li>
<li>TestCertificate/idrix_Sha256CodeSign.pfx</li>
<li>TestCertificate/idrix_SHA256TestRootCA.crt</li>
<li>TestCertificate/idrix_TestRootCA.crt</li>
</ul>
Note: If prompted, the password for .pfx certificates is <b>idrix</b>.
</li>
</ol>
</p>
</div>
</div>
<div class="textbox" id="KnownIssues">
<a href="#KnownIssues">Known Issues</a>
<div class="texttohide">
<p>
<ul>
<li>
<b>This distribution package is damaged</b> <br>
<img src="CompilingGuidelineWin/DistributionPackageDamaged.jpg" width="20%"> <br>
On Windows 10 or higher you might get the error message above. In order to avoid this, you will need to:<br>
<ul>
<li>Double-check the installation of the root certificate that issued the test code signing certificate in the "Local Machine Trusted Root Certification Authorities" store.</li>
<li>Compute SHA512 fingerprint of the test code signing certificate and update the gpbSha512CodeSignCertFingerprint array in the file "src/Common/Dlgcode.c" accordingly.</li>
</ul>
Please see <a href="https://sourceforge.net/p/veracrypt/discussion/technical/thread/83d5a2d6e8/#db12" target="_blank">https://sourceforge.net/p/veracrypt/discussion/technical/thread/83d5a2d6e8/#db12</a> for further details.<br>
<br>
Another approach is to disable the signature verification in the VeraCrypt code. This should be done only for testing purposes and not for production use:
<ol>
<li>
Open the file "src/Common/Dlgcode.c"
</li>
<li>
Look for the function "VerifyModuleSignature"
</li>
<li>
Replace the following lines: <br>
Find:<br>
<p style="font-family: 'Courier New', monospace;">
if (!IsOSAtLeast (WIN_10)) <br>
return TRUE;
</p> <br>
Replace:<br>
<p style="font-family: 'Courier New', monospace;">
return TRUE;
</p>
</li>
<li>
Compile the VeraCrypt code again
</li>
</ol>
</li>
<li>
<b>Driver Installation Failure during VeraCrypt Setup from Custom Builds</b> <br>
<img src="CompilingGuidelineWin/CertVerifyFails.jpg" width="20%"> <br>
Windows validates the signature for every driver which is going to be installed.<br>
For security reasons, Windows allows only drivers signed by Microsoft to load.<br>
So, when using a custom build:<br>
<ul>
<li>If you have not modified the VeraCrypt driver source code, you can use the Microsoft-signed drivers included in the VeraCrypt source code (under "src\Release\Setup Files").</li>
<li>If you have made modifications, <strong>you will need to boot Windows into "Test Mode"</strong>. This mode allows Windows to load drivers that aren't signed by Microsoft. However, even in "Test Mode", there are certain requirements for signatures, and failures can still occur due to reasons discussed below.</li>
</ul>
Potential Causes for Installation Failure under "Test Mode":
<ol>
<li>
<b>The certificate used for signing is not trusted by Windows</b><br>
You can verify if you are affected by checking the properties of the executable:
<ol>
<li>
Make a right click on the VeraCrypt Setup executable: "src/Release/Setup Files/VeraCrypt Setup 1.XX.exe"
</li>
<li>
Click on properties
</li>
<li>
Go to the top menu "Digital Signatures". Her you will find two signatures in the Signature list
</li>
Check both by double clicking on it. If the headline says "The certificate in the signature cannot be verified", the corresponding signing certificate was not imported correctly.<br>
Click on "View Certificate" and then on "Install Certificate..." to import the certificate to Local Machine certificate storage. For the Root certificates, you may need to choose "Place all certificates in the following store", and select the "Trusted Root Certification Authorities" store.<br>
<img src="CompilingGuidelineWin/CertificateCannotBeVerified.jpg" width="40%"> <br>
<li>
</ol>
</li>
<li>
<b>The driver was modified after the signing process.</b> <br>
In this case, please use the script "src/Signing/sign_test.bat" to sign your code again with the test certificates
</li>
</ol>
</li>
</ul>
</p>
</div>
</div>
</div>
</body></html>