One alternative might be to have a security framework that offered the UAC prompt when a program actually attempted to do something that required elevation. I had thought that was the way UAC actually worked.
I wouldn't be surprised, given all the details, to learn that this "check the filename" approach really was the most sensible and appropriate thing to do at the time. We could call it a matter of "path dependency" if we're feeling charitable or a matter of "painting oneself into a corner" if we're not.
What I find so fascinating and irritating at the same time, every time I hear about some bit of Windows internals like this, is that MS seems to need an exit from a corner they've painted themselves into all the time.
This is how it works in most cases, but it's different with access to directories inside "Program Files" folder: because it was a common behaviour in the past, there is a such feature as UAC virtualisation:
http://msdn.microsoft.com/en-us/library/bb756960.aspx
>Prior to Windows Vista, many applications were typically run by administrators. As a result, applications could freely read and write system files and registry keys. If standard users ran these applications, they would fail due to insufficient access. Windows Vista improves application compatibility for standard users by redirecting writes (and subsequent file or registry operations) to a per-user location within the user’s profile. For example, if an application attempts to write to C:\Program Files\Contoso\Settings.ini, and the user does not have permissions to write to that directory, the write will get redirected to C:\Users\Username\AppData\Local\VirtualStore\Program Files\contoso\settings.ini. For the registry, if an application attempts to write to HKEY_LOCAL_MACHINE\Software\Contoso\ it will automatically get redirected to HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\Software\Contoso or HKEY_USERS\UserSID_Classes\VirtualStore\Machine\Software\Contoso.
This is one of the things that makes user separation hard on windows, as anyone who wants to do anything vaguely useful with the computer still needs Administrator access.
I guess it's similar to naming files PRN or NUL. You learn not to do that. It doesn't make it okay.
I lost a few hours to this because it's so quirky and easy to forget. This happened during the compilation of a certain library, which created an install.exe program to move files around the filesystem. That stupid UAC dialog was not even kicking-in and basically the copying just died.
1) Write a little, one-off initialization script (I forget what it did -- probably copied a few files from point A to point B). Expect this task to take about five minutes.
2) Four hours later you discover that merely calling that stupid little script 'setup.cmd' caused all kinds of UAC havoc to ensue. Bang head against desk.
So, now I know. But it sure was counter-intuitive, and (I suggest) more than a little ham-handed on Microsoft's part.
Don't get me started about significant trailing spaces in environment variables (another little gift of non-intuitive behavior in the MS environment).
The number of users who run legacy installers and expect them to work exceeds the number of users who write "little, one-off installation scripts" by several orders of magnitude.
This seems perfectly sane and reasonable to me. What's the alternative? That manifest-less installers should fail because a user forgot to manually elevate a program by shift-right clicking it and selecting "Run as Administrator", all because they upgraded their OS and now their installers won't run any more?