Remix.run Logo
b800h 6 hours ago

It seems incredible to me that Microsoft would alter the execution of programs based on the filename of the executable. For all we know, there was another game with the same filename and this game has been caught in the crossfire. This is crazy stuff.

Arnavion 6 hours ago | parent | next [-]

Doing things based on exe filename is quite standard in Windows land. There's literally a registry key called "Image File Execution Options" where you can add a subkey with the name of the exe and then add values to control things like what interpreter to launch it under by default. Similar to Linux's binfmt registration, but based on filename rather than magic bytes. Very useful for attaching debuggers to specific subprocesses that you can't launch manually, as long as the process is named sufficiently uniquely.

https://techcommunity.microsoft.com/blog/askperf/two-minute-...

Joe_Cool 2 hours ago | parent [-]

Renaming anything (without a manifest) setup.exe will cause Windows to ask for UAC elevation. The user cannot opt-out. There are a few other hard coded strings like "install" that cause this AFAIR. You can also use its_a_setup_mr_bond.exe for example.

IAmLiterallyAB 6 hours ago | parent | prev | next [-]

I don't know if it was filename exactly, but a similar story:

> Jon Ross, who wrote the original version of SimCity for Windows 3.x, told me that he accidentally left a bug in SimCity where he read memory that he had just freed. Yep. It worked fine on Windows 3.x, because the memory never went anywhere. Here’s the amazing part: On beta versions of Windows 95, SimCity wasn’t working in testing. Microsoft tracked down the bug and added specific code to Windows 95 that looks for SimCity. If it finds SimCity running, it runs the memory allocator in a special mode that doesn’t free memory right away. That’s the kind of obsession with backward compatibility that made people willing to upgrade to Windows 95.

https://www.joelonsoftware.com/2000/05/24/strategy-letter-ii...

BearOso 4 hours ago | parent | prev | next [-]

It's not limited to Microsoft. Nvidia and AMD Windows drivers also do the same. Even mesa has a few lists of program-specific flags:

https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/uti...

saagarjha 4 hours ago | parent | prev | next [-]

This is common across all platforms that have a backwards compatibility story

ZeWaka 3 hours ago | parent | prev | next [-]

Quite a lot of this in proton, except it's by steam appid: https://github.com/ValveSoftware/Proton/blob/proton_10.0/pro...

asveikau 6 hours ago | parent | prev | next [-]

There is a ton of this in the app compatibility support. It comes from the era in which it would not be expected for a vendor to patch a program they already shipped. So, you know, they enable the hacks that keep SimCity working if they notice you're running SimCity. And the SimCity CD-Rom would never see an update.

charcircuit 5 hours ago | parent [-]

>It comes from the era in which it would not be expected for a vendor to patch a program they already shipped

This is still the case today. An operating system breaking apps is not desirable behavior. Not all apps are still in development, the work may have been contacted out, the development studio may have been bankrupted, the source code may have been lost, etc. Either you add a compatibility hack to the OS or you drop support for that app.

asveikau 4 hours ago | parent [-]

> Either you add a compatibility hack to the OS or you drop support for that app.

It isn't really a binary choice like this in real life. This really depends on the specifics of what the breakage is. The best way is to not break the caller's expectation to begin with.

Anyway, my point is that patching on the vendor side is way more common than it would be in the days before internet updates were common.

charcircuit an hour ago | parent [-]

It's still common with modern operating systems. I think the bias may just be from historical blog posts talking about old events than newer ones. The developers adding these are under NDA so they aren't going to be sharing with the world what they are doing.

You are right that it's not a binary choice, they are others like maintaining tech debt forever or paying out of pocket to upgrade people's apps. But it's common for those to not be viable options and operating systems need to keep evolving forward.

meinersbur 3 hours ago | parent | prev [-]

Changing execution behaviour based on filename is common in Linux environments too. Some examples:

1. BusyBox is a single executable that executes different commands based on which symlink was used to call it

2. Bash puts itself into compatibility mode if invoked as "sh"

3. "ping" can be invoked as "ping4" or "ping6"

4. Some of git's subcommands are symlinks back to the main executable

5. Clang switches to C++ mode if invoked as "clang++"

6. AppArmor profiles activate on file paths

LelouBil 3 hours ago | parent | next [-]

Your examples are interested, but not comparable.

In your list these are executables that change their own behaviour based on how they are called, whereas in the OP it's the OS changing code based on the name of an application.

saati 3 hours ago | parent | prev [-]

But 1-5 is the executable making decisions based on it's command name, not the OS changing behavior.