Live data from Hacker News

Windows 95 defenses against installers that overwrite a file with an older one

devblogs.microsoft.com

1–10 of 103 posts

Re: Windows 95 defenses against installers that overwrite a file with an older one

#3

OMG, is this the reason why every other installer would get stuck at 99% forever? :D

It doesn't say for certain, but assuming the version of this they settled on (restoring components after the installation finished) is what they shipped in the original version of Windows 95, then no, I don't think this could have caused hangs in the installer itself (unless Win95 misjudged whether the installer had completed or not and started the restore process early?).

Re: Windows 95 defenses against installers that overwrite a file with an older one

#4
>Windows 95 worked around this by keeping a backup copy of commonly-overwritten files in a hidden C:\Windows\SYSBCKUP directory. Whenever an installer finished, Windows went and checked whether any of these commonly-overwritten files had indeed been overwritten.

This is truly unhinged. I wonder if running an installer under wine in win95 mode will do this.

Re: Windows 95 defenses against installers that overwrite a file with an older one

#5
post #4

>Windows 95 worked around this by keeping a backup copy of commonly-overwritten files in a hidden C:\Windows\SYSBCKUP directory. Whenever an installer finished, Windows went and checked whether any of these commonly-overwritten files had indeed been overwritten. This is truly unhinged. I wonder if running an installer under wine in win95 mode will do this.

> If . . . the replacement has a higher version number than the one in the SYSBCKUP directory, then the replacement was copied into the SYSBCKUP directory for safekeeping.

This as well. I know there are a million ways for a malicious installer to brick Win95, but a particularly funny one is hijacking the OS to perpetually rewrite its own system components back to compromised version number ∞ whenever another installer tries to clean things up.

Re: Windows 95 defenses against installers that overwrite a file with an older one

#6
post #4

>Windows 95 worked around this by keeping a backup copy of commonly-overwritten files in a hidden C:\Windows\SYSBCKUP directory. Whenever an installer finished, Windows went and checked whether any of these commonly-overwritten files had indeed been overwritten. This is truly unhinged. I wonder if running an installer under wine in win95 mode will do this.

> This is truly unhinged.

This is bog-standard boring stuff (when presented with a similar problem, Linux invented containers lol) - read some of his other posts to realize the extent Microsoft went to maintain backwards compatibility - some are insane, some no doubt led to security issues, but you have to respect the drive.

Re: Windows 95 defenses against installers that overwrite a file with an older one

#7
> Whenever an installer finished, Windows went and checked whether any of these commonly-overwritten files had indeed been overwritten.

> Basically, Windows 95 waited for each installer to finish

How could it tell that a particular process was an installer? Just anything that writes to the PROGRA~1 or WINDOWS folders?

Re: Windows 95 defenses against installers that overwrite a file with an older one

#8
post #7

> Whenever an installer finished, Windows went and checked whether any of these commonly-overwritten files had indeed been overwritten. > Basically, Windows 95 waited for each installer to finish How could it tell that a particular process was an installer? Just anything that writes to the PROGRA~1 or WINDOWS folders?

The latter, according to https://devblogs.microsoft.com/oldnewthing/20260324-00/?p=11...

Re: Windows 95 defenses against installers that overwrite a file with an older one

#9
post #6
post #4

>Windows 95 worked around this by keeping a backup copy of commonly-overwritten files in a hidden C:\Windows\SYSBCKUP directory. Whenever an installer finished, Windows went and checked whether any of these commonly-overwritten files had indeed been overwritten. This is truly unhinged. I wonder if running an installer under wine in win95 mode will do this.

> This is truly unhinged. This is bog-standard boring stuff (when presented with a similar problem, Linux invented containers lol) - read some of his other posts to realize the extent Microsoft went to maintain backwards compatibility - some are insane, some no doubt led to security issues, but you have to respect the drive.

It’s not bog-standard. Containers are not equivalent to doing what is described in the article.

Containers are in fact redirecting writes so an installer script could not replace system libraries.

The equivalent would be a Linux distro having the assumption that installer scripts will overwrite /usr/lib/libopenssl.so.1 with its own version and just keeping a backup somewhere and copying it back after the script executes.

No OS that I know of does that because it’s unhinged and well on Linux it would probably break the system due to ABI compatibility.

If they had taken essentially the same approach as wine and functionally created a WINEPREFIX per application then it would not be unhinged.

edit: also to be clear, I respect their commitment to backwards compatibility which is what leads to these unhinged decisions. I thoroughly enjoy Raymond Chen’s dev blog because of how unhinged early windows was.

Re: Windows 95 defenses against installers that overwrite a file with an older one

#10
post #9
post #6

Earlier quoted context omitted.

> This is truly unhinged. This is bog-standard boring stuff (when presented with a similar problem, Linux invented containers lol) - read some of his other posts to realize the extent Microsoft went to maintain backwards compatibility - some are insane, some no doubt led to security issues, but you have to respect the drive.

It’s not bog-standard. Containers are not equivalent to doing what is described in the article. Containers are in fact redirecting writes so an installer script could not replace system libraries. The equivalent would be a Linux distro having the assumption that installer scripts will overwrite /usr/lib/libopenssl.so.1 with its own version and just keeping a backup somewhere and copying it back after the script execu…

You are right that it’s not equivalent, but the article explains why redirecting the writes wasn’t a viable option.
Post reply on HN