Closed harnoorsaini closed 3 years ago
It sounds like what you're doing is running the ISO through the tool, mounting it in Windows, and trying to do an in-place upgrade. Is that correct?
Yep
I see. This tool was not initially developed with that in mind. However, I am working on a feature that modifies the current installation of Windows, which could potentially allow for in-place upgrades. Testing is going to take some time, though, but it shouldn't take too long. A day or two at most, provided everything goes well. I'll update the documentation as well once the feature is finished.
Thanks for the quick reply! So currently it would work if I boot into it - but then I would loose apps and data? If so then I will wait a few days for the patch. Thanks a lot man!
No problem! And yes, data would be lost if you were to boot from the ISO and install that way.
Good news: the first version of the feature has been implemented! The parameter to activate it is -PrepareUpgrade
. More information is available here.
For your situation, it seems all you have to run is .\Win11-TPM-RegBypass.ps1 -PrepareUpgrade
. That should patch your system, then you can try running setup.exe
from the ISO you created earlier. If it causes any problems, use -UndoPrepareUpgrade
to revert the changes.
From my testing, it seemed to work fine, but let me know how it goes for you!
Hi, so some errors: first it says the script only runs on windows. I hacked it with "$IsWindows = $true", then I get a "This will only run on 64-bit devices" , there was a rogue "$Is64BitSystem = $false" @ line 111. So changed that, then it ran with a warning: "Test-Path : Cannot bind argument to parameter 'Path' because it is an empty string.". I then restarted, but got the same "This PC must support TPM 2.0" error again...
FYI: in regedit under MoSetup I have "Tracking" and "Volatile" folders. BTW, I have a 4790k, motherboard does not TPM at all.
Hmm... That's odd. I'll spin up a Windows 10 VM later when I get the chance, so that I can run the script in a clean environment and figure out what's going on. Thank you for bringing this to my attention.
I appreciate you telling me what some of the problems were. I just realized that there were debug/testing flags left behind that I forgot to revert, and they were causing problems. I'm still trying to figure out what's wrong with the patching routine. I'll let you know what I figure out.
Please also keep in mind that if you're not doing it already, run env.bat
BEFORE running the script. It may fix some problems.
I really appreciate all your input!
UPDATE: Seems that now the patch is actually being installed. I have yet to spin up a VM to see if in-place upgrading works. Thank you so much for your patience!
If you wouldn't mind running .\Win11-TPM-RegBypass.ps1 -PrepareUpgrade
again, I believe I have fixed the bugs that were causing the script to break and terminate.
If you're curious, here were the issues:
$CurrentArchitecture
was prematurely assigned; assumed not x64 OS$IsWindows
was null, not false. Resulted in script exiting.Test-Path $Destination
: command existed before main routine, resulting in path being checked too early; script would fail early if $Path
was null or empty.PrepareSystemForUpgrade
, command Write-Host
(Line 556 as of commit 200) was not spelled correctly-PrepareUpgrade
or -UndoPrepareUpgrade
was passed, because the functions existed before the checkJust a quick note: I would recommend running .\Win11-TPM-RegBypass.ps1 -UndoPrepareUpgrade
before running .\Win11-TPM-RegBypass.ps1 -PrepareUpgrade
, just as a precautionary measure. It will remove any broken elements created by the script.
So thanks for all your help. Here's what I did: deleted the old iso, cloned your repo and ran the script to generate a new iso from the original iso [1], then ran the "PrepareUpgrade" command, restarted, mounted the new iso and ran "setup.exe"... then I was met with the same "The PC must support TPM 2.0" error. (funny that it does not complain about the CPU).
[1]: what "original" iso are you using? in your readme you are using a dev version, whereas I am using the latest retail version. Could that be the reason?
I ran a Dev version cloned using UUP Dump.
May I ask, are you running the env.bat
file to open PowerShell in the current directory?
Yes I am running that each time.
I'm wondering if your environment is different. Could you enter $PSVersionTable
into PowerShell, and post the results here? Here's my output:
Name Value
---- -----
PSVersion 5.1.19041.1237
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.1237
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
And by retail, do you mean an ISO downloaded from the Microsoft website, or an ISO downloaded through the Media Creation Tool? I believe the images are different, but I'm not sure.
I tried both the UUP Dump version, and the official ISO from the Microsoft webpage in the Windows 10 VM. I may have an unsupported system somewhere I can try this on, but I'll have to go looking for it. I can do testing on that when I get the chance.
My output from the $PSVersionTable command is identical to yours. I obtained the ISO via the "Download Windows 11 Disk Image (ISO)" section on the webite: https://www.microsoft.com/en-us/software-download/windows11. I believe it's the one you are talking about...
Yes. Interestingly enough, I tried that one in the VM, but there was never any warning. With or without the patch. I believe that build of the setup executable was the one that exempted VMs from the exclusion list, which is why I need to find a PC without a TPM to do testing on. I can't do that until I get home.
OK. So, for the heck of it I decided to give it another go, but this time I didn't deselect "go online and get updates" (I always thought that maybe in one of the updates they would patch out any loop-holes), and lo and behold, it's installing as we speak! I will report back once/if it succeeds. Thanks again for your help.
Excellent! The patch should force upgrades (Feature Updates) from Windows Update to bypass the checks as well. I don't know if it would need to be reapplied again, and I have no idea why unchecking that option would cause problems (I should try that in the VM), but at least we know it works!
OK, so I am in! So far so good, I will install updates and see if it complains.
Sounds good! Since everything's working so far, I'm going to close this issue. Just post again if anything goes wrong.
Thank you for helping out!
When I mount the newly created ISO (original ISO I obtained from Microsoft official site) and run setup.exe, I still run into the same error...