Friday, October 06, 2006 4:54 AM
Michael S. Kaplan
Random irreverent thoughts about the Ultimate Fallback
Last night on TBS was an old Friends episode, The One With the Ultimate Fighting Champion. In it, Pete proved himself to be quite inadequate as the 'Ultimate Fighting Champion.' I could not help but be amused by the timing (since I was planning to do this post!).
The meaning of the 'Ultimate Fallback' in resources is a bit different than the 'Ultimate Fighting Champion' -- the former is a last chance opportunity to get the job done, just one step above utter failure. And the latter is the toughest, meanest person in the contest (like a cleaner version of the full contact Kumite).
Anyway, I was at a talk that Mark Russinovich gave earlier this week (standing room only, turning tons away, I can't believe they didn't plan ahead and move it to the Conference Center!), and I got to witness The Case of the Notepad that Wouldn't Run.
Actually, I didn't witness such a thing at all; I technically witnessed The Presentation After the Case of the Notepad that Wouldn't Run, which is not quite the same thing. :-)
Mark re-created the same situation:
As an ad-hoc demonstration of the last request method, during the presentation I copied \Windows\Notepad.exe to my account’s profile directory, renaming it to Notepad-setup.exe in the process. Then I launched it, expecting to see a Consent dialog like the one below ask me to grant the renamed Notepad administrative rights:
To my consternation, no such dialog appeared. In fact, nothing happened. I reran it and got the same result. I was thoroughly confused, but didn’t have time to investigate in front of the class, so I moved on.
Only this time he knew immediately what happened and copied the NOTEPAD.EXE.MUI file in an en-US subdirectory of where he copied NOTEPAD.EXE to.
Of course the whole thing might have been staged, or he may have forgotten and then remembered right away when nothing launched. No worries, either way. That isn't really what this post is about....
This post is about what happened with the MUI file.
I understand about the marketing value that people talking about Windows international features over the last few years found in talking about how our eventual goal was to "...just make English another language." Hell, this is something I used to say back in the day, myself. And I can even see the demo value in proving that it was not just marketing by doing something like Mark did, proving that resources can be gone for English just like for any language. Perhaps there is even some marketing value to that, too.
But is there really a flaw in the notion of embedding one's 'ultimate fallback' resources, the ones that you show when (as the title implies) everything has gone to hell and there is no way that the resources one wanted to load would ever be found, when one has done something as bleeding silly as to not have the resource DLL?
I mean, can't one prove that English is just another language by just choosing some other language as the ultimate fallback? And that demo has the benefit over the one that Mark went through by virtue of the fact that the application is still functional, even when everything has gone to crap. And I suspect that the laughter would be as good (or maybe even better!), and the whole thing would look better for the platform down the road when we move past demos and into actual deployment scenarios.
Since the demo is for the show and the deployment is for the dough, combined with the fact that I think the demo could really be made cooler anyway, wouldn't this have been a better approach?
I might be missing additional wrinkles that make this plan a better one. But this really has struck me as I looked at Win32 Resource Configuration, Preparing Resources, Placing and Loading Win32 Resource Files, the MUI Application Sample, and all of the related topics. Is the plan of embedding the built-in resources of one's ultimate fallback such a bad idea?
The .NET Framework has a somewhat similar model with its 'ultimate fallback', as you can see in topics like Packaging and Deploying Resources....
And I understand the claims that article makes about why this is a good model. I'm just not sure I completely buy it 100%. It is this ultimate fallback model that I have trouble with, honestly.
This is an issue that is not so relevant for Windows and the .NET Framework except in really contrived scenarios, but it can become quite relevant for people who are building resources for their applications and who have the option of creating .MUI files or using the .NET localization model for resources.
Food for thought, I think. Do you feel your code is as likely and guaranteed to always have those resource files there?
P.S. -- This post represents an experiment in using the beta of Windows Live Writer. If I like it then I might look into the SDK to write a plug-in to handle stuff like those links to http://www.fileformat.info for all of the Unicode code points I post!
This post brought to you by ຝ and ພ (U+0e9d and U+0e9e, a.k.a. LAO LETTER FO TAM and LAO LETTER PHO TAM)