August 7, 2006
Help, I'm on Windows, where is my home?Posted 3029 days ago on August 7, 2006
I've been trying out a ClickOnce app; I'll post some more about the actual app shortly, but I ran into a frustrating problem with its config files; I'll get to "where is my home" in a moment.
With ClickOnce, you install a .NET app simply by clicking a link on a web page. The app downloads to some unknown location on your hard drive, and you run the app from its shortcut.
All very smooth and seamless when it works. Trouble is, in my case there was a bug in the app, such that when you set a certain preference, the app would crash on startup. Since the app crashed before starting up, you couldn't easily change the preference option back.
In this scenario, you need to edit the config manually. But where is it? It's not in the registry. Squinting at the shortcut properties for the app doesn't tell you where it is installed locally; it is simply a link like this:
http://someurl/appname.application#appname.application, Culture=en-US, PublicKeyToken=da11c34c2676c953, processorArchitecture=msil
I did some digging around; in extremis, there is always FileMon. If you know ClickOnce in depth, you will have got there before me: somewhere in \Documents and Settings\username\Local Settings\Apps\2.0.
Even once you have the general location it is not easy to find the right file. For some reason ClickOnce creates at least two directories under \Apps\2.0\ for each application. If your app is called "Your application.exe", then one begins "your..exe" and the other begins "your..tion", since it makes some effort to abbreviate the directory names. Both of these directories contain config files; in fact, in my case the one beginning "your..exe" only contains a config file. So this is what I have to edit, right?
Wrong. Apparently the real config file was in \Apps\2.0\Data\ABC.XYZ\your..tion\Data\1.x.x.x\user.config. Edit that, and the buggy app starts fine.
This is all pretty interesting, as it is really about right and wrong ways to hide things from the user. I appreciate that ClickOnce is intended to be a black box; but what happens when the black box needs to be opened? I don't see why it has to be so hard to find out where the app really resides, nor why ClickOnce has to create so many obscure directories: after all, the whole lot is in the user's home directory and is therefore user-specific.
I have a long-standing and related gripe: I love the fact that Windows has a home directory for each user, but I hate that it is so hard to find. Why isn't there a prominent "Home" shortcut that takes you to your root in Documents and Settings? Instead we only have "My Documents", and there is no easy route from My Documents to the other contents of your home directory.
Worse still, some contents of your home directory are hidden by default, including the entire Local Settings tree which is where my errant config file resides, and another crucially important tree called Application Data.
If Microsoft had done a better job with this way back, we might not have so many apps writing data to \Program Files
Comments are closed
Recent postsUsers plead with Borland to give up .NET
IE7 to be released 18th October,...
If Microsoft doesn't use UAC, why...
Google's unsettling lack of direction
Vista security: now prove it