Life is always interesting for programmers when they have to update the code that’s running the update. This gets even more interesting for updates to Windows Terminal (WT) and PowerShell, running inside — you guessed it — WT and PowerShell (PS). Right now, a new WT 1.19.10292 solves self-update issues that remain present for PS. You can see the proud evidence in the lead-in graphic, which concludes a WT upgrade with “Successfully installed. Restart the application to complete the upgrade.” PS, on the other hand, still says “Cancelled” at the end of a self-upgrade, even though a restart reveals the newly-upgraded version at work.
How New WT 1.19.10292 Solves Self-Update
Windows users are actually much more familiar with this self-mod situation than they may think. Indeed, the reason why Windows must reboot after CUs and during OS install and upgrade, is so an updater or installer can work on files totherwise in active use RIGHT NOW if they weren’t suspended (if only temporarily).
In essence, this is what restarting WT/PS does. It terminates running processes for the code to be updated. Then they can be altered or replaced before the next set of new processes starts back up. I’m glad to see the WT team take such a steady and time-worn approach to updating Windows Terminal itself. It’s what makes most sense!
When I was learning to program back in the late 70s and early 80s one of my first and hardest-learned lessons was “Don’t step on your own toes” (write code that changesitself in unwanted or unplanned ways). That way lies madness. Glad to see those old lessons still apply, even for WT and PS.