This script prepares a Windows 10 installation media to upgrade VeraCrypt-encrypted (and also TrueCrypt-encrypted) Windows 10 systems without the need to decrypt them.
VeraCrypt 1.23 now supports the ReflectDrivers mechanism to perform upgrades of Windows 10 without decrypting. Continue reading to learn more about it.
The patcher still works for the new "Windows 10 October Update" (Version 1809)! Usual, setups using BIOS/UEFI+CSM do well while regular UEFI setups tends to cause trouble. Check the Reports on the "Hall of Fame"-Issue (for successful upgrades) and the "Hall of Blame"-Issue (for unsuccessful upgrades) to evaluate the risk for your system.
First: I’m not a native English speaker. Pardon me for spelling mistakes.
Hello, security-aware people,
since the last wave of Windows 10 upgrades, a new way to upgrade has emerged. With version 1.23, VeraCrypt supports the ReflectDrivers mechanism. This mechanism was introduced by Version 1607 of Windows 10 to enable 3rd party encryption solutions (like VeraCrypt) to upgrade without decryption. This way is more elegant than my previous solution and should be preferred if possible.
Unfortunately there is no official manual by VeraCrypt for this. Probably because it's similar problematic and risky like my original solution. So here is a how to upgrade using this method. If this don't suite your needs, the original Windows 10 media patcher method still works!
Disclaimer: I don’t take any responsibility for whatever happens. Be prepared for the worst-case scenario! (Loss of data)
The name "ReflectDrivers" comes from the "/ReflectDrivers" command line option that can be passed to the "setup.exe" of any Windows 10 installation media since version 1607. This argument tells the setup where the driver for the encryption can be found. This allows the setup to integrate the encryption drivers into the upgrade process.
To Upgrade you need:
Start the upgrade by:
.\setup.exe /ReflectDrivers "C:\Program Files\VeraCrypt" /PostOOBE C:\ProgramData\VeraCrypt\SetupComplete.cmd
Note the additional "/PostOOBE" option in upgrade step 3. This option tells the setup a program/script to launch when the upgrade finished successfully. Here VeraCrypt gets informed that the upgrade has finished.
Knowing that the upgrade worked, VeraCrypt generates the special configuration file C:\Users\Default\AppData\Local\Microsoft\Windows\WSUS\SetupConfig.ini
. This configuration file teaches Windows Update about the encryption driver. When it upgrades Windows 10 in the future, than it should install without any additional actions. Please note that this configuration file only apply for upgrades by Windows Update. Manually upgrading via "setup.exe" from an Windows 10 installation medium still needs the right command line options.
Manually running C:\ProgramData\VeraCrypt\SetupComplete.cmd
once (with administrator rights) can teach Windows Update right away about the encryption driver. This is useful on newly installed machines to prepare them for upgrades by Windows Update in the future.
Please feel free to report your (un)successful Upgrade in the "Hall of Fame"-Issue or "Hall of Blame"-Issue to help other users.
Enjoy your up-to-date “Windows as a Service”.
I found a way to upgrade Windows 10 (any version up to the current 1703 1709 1803 1809) without decrypting the System Drive. I tested it on 64-bit Windows with the “entire system drive” encryption in BIOS mode and “Windows Partition” encryption in UEFI mode. Maybe some of you may try other configurations… it should also work for 32-bit installations.
Note that you can upgrade any Windows 10 version directly to the current version without installing the intermediate versions. How it works is described below, but it’s a bit complicated. I created a script that does the work. Also, there is a video tutorial about script usage and the upgrade.
Script: https://github.com/th-wilde/veracrypt-w10-patcher/archive/master.zip
Place the script into the root of a Windows 10 installation media (You can create one using the media creation tool from Microsoft - use the ISO variant and decompress the .iso file.) and run it with administrator rights. The script will patch the VeraCrypt driver into the installation media. After completion (This may take a while.), run the setup.exe from the root of the installation media and follow the instructions on screen. Don’t boot from the created media! This would end in a normal installation process instead of an upgrade.
Only on UEFI mode:
The upgrade requires the Windows bootloader entry (which VeraCrypt has replaced/removed) in the UEFI firmware (NVRAM) to work properly. To add the entry, boot up a Windows 10 installation media and access the command line by pressing SHIFT + F10. Run the following command:
bcdedit /set {fwbootmgr} displayorder {bootmgr} /addlast
Reboot back to the encrypted Windows OS and start the upgrade.
The bootloader entry is never used. Optionally it can be removed with following command from an elevated command line:
bcdedit /set {fwbootmgr} displayorder {bootmgr} /remove
The modified installation media can be used to upgrade multiple machines. In this case, be sure to upgrade the machine to the same VeraCrypt version that the installation media contains. Don’t mix architectures (64-bit/32-bit) while patching. Use a 64-bit system to patch 64-bit installation media and vice versa.
Video-Example/Tutorial: https://youtu.be/uK-kUTNiWIk
The video shows VeraCrypt in UEFI mode on a VirtualBox VM performing an upgrade to the "Creators Update" (1703).
Please feel free to report your (un)successful Upgrade in the "Hall of Fame"-Issue or "Hall of Blame"-Issue to help other users.
The upgrade process is more a reinstall than an update of the Windows 10 OS. This reinstallation mechanism does not work (out of the box) if the drive/partition is encrypted with VeraCrypt. I dug around and figured out how the reinstall is done.
The problem is Steps 2 and 3. The “SaveOS” (Step 2) doesn’t contain the needed VeraCrypt driver to access the encrypted partition/drive. Also, the new Win10 OS on its first start (Step 3) misses the VeraCrypt driver. Both will cause a rollback of the upgrade. The system will be stuck at its outdated version forever.
Primarily, it utilizes Windows's built-in DISM (Distribution Imaging Servicing and Management) tool (dism.exe) to inject the VeraCrypt driver into all the images (one for each edition of Windows) inside the install.wim file.
Some explanations of how its done:
It’s either black magic or easy going. This is just an overview of how it works. For details, check the script. Enjoy your up-to-date “Windows as a Service”.
Credits also goes to:
And everybody who shared their experience in the issues section!