If there's no 16-bit layer in 64-bit Windows, how come 16-bit installers run?
blogs.msdn.com
blogs.msdn.com
"The installer has to be the lowest common denominator in terms of bitness. This is because it needs to be able to check whether the application can run on that system and give an intelligent "um, you can't install Program X because your computer is 16-bit and doesn't support it" message rather than falling over in a big heap."
Exactly right. And the kind of detail that is easy to forget about.
Of course, since the common case is newer apps on older OSes, that requires thinking ahead before such a problem actually happens, and that's tough. Even if you implement it, it's hard to get right because it's hard to really test. Apple does this, but the facility was broken in several Mac OS X releases, making it far less useful than it should have been.
(According to the book Showstopper!, when Microsoft ditched OS/2, they created Win32 by taking the OS/2 API and fixing any divergences from Win16 to make it look as compatible as possible.)
Very hard, since would require, say, a version of windows that only shipped with unmanaged executables (e.g. XP) to foresee, and properly assertion-fail, managed executables. Or any number of other bigger changes than "new API."
Nothing so smart need be done, though, I think. Just run the program, and let it crash if the dependencies aren't met. Give the crash-reporter a heuristic that detects that a program crash was dependency-based, and have it present a different UX in that instance. (This is basically the Erlang philosophy.)
This is hard-coded in some horrible place. It cost me a day once. I mentioned it to a guy next to me at work (random sample ex-MS dev) and said the same thing.
The Windows kernel is (for the most part) a pretty good piece of engineering. The stuff on top of it, not so much.
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?
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.
Also a good example of inside the box thinking. The reason you need to run a 16 bit installer is the software isn't free or open source therefore a simple recompile with a newer version of debhelper or whatever isn't going to bring it up to modern packaging standards.
On the other hand, the old windows software in question will most likely actually run. Debhelper is irrelevant: confronted with a package of comparable age on Linux, you'll be digging up the source code and trying to make it build, not merely tweaking the package, with all its ancient dependencies.
Also, your 15 year old statically compiled binary will contain every little bug any of the linked in libraries had those 15 years ago.
An issue that was relevant on the Windows 3.x operating systems and, on an unusually bad day, Windows 95/98. It's irrelevant to what we are talking about here and also kind of a red flag for Linux fanboyism.
This was important at the time. And the whole point of backward compatibility is to allowed old applications (written, compiled and packaged at that time) to work.
Even if the software is open-source and has been repackaged in the meantime, the old version you found on a long-forgotten CD rotting away in your basement doesn't have that. The Windows philosophy is to make sure that this one still works (which is a crazy goal IMO, but an interesting one).
I wish I could run any old software under current Ubuntu. IE: gwibber.
[0]: Like this guy: http://www.tomshardware.com/forum/107534-13-trying-install-g....
It's a requirement. Imagine how many people would have never upgraded to Windows 95 if their Windows 3.x programs didn't work.
Each program Microsoft 'fixes' is additional sales.
The snide about competition has also become somewhat hollow. Microsoft would love to go back to the monopoly days of the late nineties. But those days are gone.
It was about as bad as I thought it would be.
About an hour into using my Mac Pro's shell, I wanted to weep in relief. Microsoft does not get it. (Or if they do, it gets perverted into something like PowerShell, which I recently wasted a week on).
- tabs
- cut and paste that actually works
- various ways to focus windows
- hey, search!
... and a bunch of other stuff. While CMD.EXE has its feet firmly rooted in 1982 or so.
Yeah, I know you can buy more whizzy shells. But MS really has no excuse for letting the NT console system rot as much as it has. Given that their programmers use it /all the time/, I find it hard to believe that someone hasn't written something better. (PowerShell overshot the mark, and wound up being unusable).
> PowerShell overshot the mark, and wound up being unusable
You haven't still any points against Powershell and continue to pile up on it.
The console system doesn't provide a TTY, as in Unix, but instead uses a CGA/MDA text mode metaphor: a matrix of (character,colour) pairs. This leaves no information about the text that's been printed, per se - it's more like the text equivalent of a bitmap. No carriage returns, no tabs, just an arrangement of characters that happened to have been put in the right places. If you widen the screen, there's not much Windows can do except for leave the new area blank, because it has no idea at all which line breaks are significant and which were just wrapped. (And indeed, if you resize the buffer in the console window's properties, this blanking is exactly what it does.)
There's sort-of nothing wrong with this system, in that it makes sense for a certain style of text-mode GUI console program, that were at one point exceedingly popular in MS-DOS - but unfortunately, it's not so hot for the TTY style of console program that everybody uses these days :)
(Fingers crossed for a much-needed shakeup, but this nonsense has stuck around for so long - I don't think that console properties dialog has changed one pixel since Windows NT 4 - that it's probably a bit late now. Meanwhile, one solution might be to run cmd.exe with a better class of terminal emulator - emacs will do this.)
You /could/ redo one without redoing the other. No problem. But the result would be poor. :-/
So all the work went into the ISE instead of fixing CMD. Powershell console and cmd run powershell are just compatibility layers to make it more familiar.
It's used to run int10h calls (VGABIOS) on early initialization, funnily even on UEFI.
Likewise, I don't understand why vm86 mode can not run directly from 64-bit mode in x86. This seems very like an architectural mistake to me.
> [Because that emulator uses v86-mode, which is not supported by 64-bit processors. -Raymond]
-- http://blogs.msdn.com/b/oldnewthing/archive/2013/10/31/10461...
[1] http://x86asm.net/articles/calling-bios-from-driver-in-windo...
[2] http://www.geoffchappell.com/studies/windows/km/hal/api/x86b...
I'm not sure what exactly crafting a 16-bit installer file to exploit some bug in the bundled installshield to get it to execute code of your choosing (when the user tries to run your installer) would achieve.
You've got the user to run an installer that you've made. They've just double-clicked on your program. Forget crafting dodgy installer data files, you can run whatever code you like just by... running it.
Moreover, given the user is trying to install your program, they'll be happy to elevate its privileges, too (through UAC). So your arbitrary code is running as admin - what more could a security flaw in the bundled installshield get you? (And if the user doesn't think your program's an installer, they're not going to be any less confused by the appcompat installshield's UAC prompt than if your program just tries to elevate by UAC by itself. It's not like the bundled one is setuid root (or the windows equivalent)).
See also: http://blogs.msdn.com/b/oldnewthing/archive/2006/05/08/59235...
In the days of Antivirus products and executable whitelists, the "elevation of privilege" may be getting arbitrary execution as any user. Of course trustedinstaller.exe or whatever that has a valid Microsoft signature can run, why shouldn't it? No need to ship that file back home either for further analysis (as AV products like to do with unknown files), its a standard OS thing. Therefore my rootkit isn't burned either.
Hint: Linux? It does something similar pretty much on the OS level.
The HTTP protocol specifies that, if the server says a document is 'text/plain', the client must not attempt to second-guess it based on content.
IE second-guesses it based on content, so you cannot serve up something that looks like HTML as text/plain to get it to display.
Substantially worse, IMO.
That said, it'd be better to actually save content types in extended attributes or something. And make all applications magically save and respect these attributes.
I don't think Linux does anything remotely like this. It does allow you to use "file" utility to guess the contents of the file, but it doesn't act on it.