Category Archives: windows

120 days with Vista

Is there any more to say about Vista? Probably not; yet after reading 30 days with Vista I can’t resist a few comments.

The author, Brian Boyko, says:

On two separate computers I had major stability problems which resulted in loss of data. This is an unforgivable sin …. Additionally, Vista claims backwards compatibility, but I’ve had major and minor problems alike with many of my games, more than a few third-party applications, my peripherals, and, in short, I encountered problems that actively prevented me from getting my work done. Based on my personal experiences with Vista over a 30 day period, I found it to be a dangerously unstable operating system, which has caused me to lose data.

As for me, I installed Vista RTM on four computers shortly after it was released to manufacturing in November last year. Two plain desktops, one media center, one laptop. Just for the record, my experience is dull by comparison with Boyko’s. No lost data; all my important apps run fine; I am not plagued by UAC prompts; the OS is stable.

Have there been hassles? Yes. Tortoise SVN crashes Explorer from time to time; a perfectly good Umax scanner has no driver; Vista on the laptop had severe resume problems which only recently seem to have been fixed by a BIOS update. And Creative’s X-Fi drivers for Vista are terrible. There are also annoyances, like Vista’s habit of thinking your documents are music.

At the same time, I’ve seen nothing to change my opinion that the majority of Vista’s problems are driver-related. Overall I like it better than XP; it doesn’t get in the way of my work and I would hate to go back.

When I do use XP, some of the things I miss are the search box in the Start menu (the Vista Start menu is miles better in other ways as well); the thumbnail previews in the task bar and in alt-tab switching; and copy and paste which doesn’t give up at the first hurdle. I also miss Vista’s more Unix-like Home directories, sensibly organized under Users rather than buried in Documents and Settings.

Security-wise, I consider both User Account Control and IE’s protected mode to be important improvements.

Forget the “Wow”. This is just the latest version of Windows; and it’s not as good as it should be, five years on from XP.

Nevertheless, it is a real improvement, and I’ve been happy with it over the last four months.

 

Technorati tags: ,

Don’t call your Windows app UpdateAnything

I wrote a little Windows utility that updates a file. It’s safe and harmless; it just modifies a file which is in my user documents folder. I called the utility UpdateMSI. Under Vista with UAC enabled, running this app throws up a dialog:

An unidentified program wants access to your computer

But why? Simple: Vista inspects the name of the executable, notes that it includes the word “update”, and concludes that it needs local administrator rights.

On the face of it, this is silly. First of all, Vista is wrong: my app does not need admin rights. Second, it is infuriating that I am not given any choice in the matter. The UAC dialog says “Cancel” or “Allow”. It does not include the option to run with my normal user rights.

Microsoft did this in an effort to detect setup applications; the word “setup” has the same effect. It will trigger if the word is anywhere in the executable name. I tried it with WorldCupDatePicker.exe – same result.

Surely it would not have been too hard to give the user a say in this? Just a checkbox that says “Let me run this how I want on my computer”? You can disable UAC of course; but I’m not going to do that; overall it’s a good feature.

If you wrote the app, there is a fix. You have to embed a UAC manifest in your application. There are simple instructions here, though note that these explain how to force the UAC prompt, not how to suppress it. If you don’t want to run as admin, modify the line:

<requestedExecutionLevel level=”requireAdministrator”/> 

to read instead:

<requestedExecutionLevel level=”asInvoker”/>

Bottom line: always include a manifest.

Technorati tags: , ,

Automating development: Software factories for Visual Studio

The Register has my piece on software factories, based on an interview with Jack Greenfield, a Microsoft software architect. Greenfield talks about a 40% – 80% productivity gain.

If you’re not familiar with this stuff, a bit of orientation may help. When Greenfield talks about software factories, he means both factory instances, which automate the building and customization of specific types of application, and also factory-making tools, which let you create or adapt factories to suit your specific needs. And when Greenfield talks about the factory “runtime”, he means the infrastructure in Visual Studio and its SDK that lets you put your factory to work.

You can actually play with this stuff now. The runtime is called the Guidance Automation Extensions and the authoring tool is the Guidance Automation Toolkit; perhaps one should add the Domain-Specific Language tools. All can be downloaded. You can also download the first four software factory instances. If anyone has tried these and has comments, I’d love to hear from you.

I was intrigued by the internal debates Greenfield mentions. He says it was a mistake to ship the “White Horse” modeling tools in Visual Studio 2005 (Design for Deployment) as a fixed set which are used only occasionally. He is now focused on shipping tools to make and customize tools, a strategy which he believes has more future.

We will always need tools; improvements are welcome. That said, I am also reflecting on the lesson from Qcon: the human factor counts most.

 

Visual Studio 6 on Vista

Why would you want to run Visual Studio 6 on Vista? Two reasons. First, because it includes Visual Basic 6.0, the last version not based on .NET. Second, because Visual C++ 6.0 is still widely used to avoid issues with the C runtime library. There is little point in installing the other products in Visual Studio 6.0.

Visual Basic 6.0 is supported on Vista, but Visual Studio 6 is not. One reason is that it includes the Microsoft Java Virtual Machine which Microsoft promised Sun it would withdraw. This is the stated reason why Visual Studio 6.0 is no longer available for download, even for MSDN Universal subscribers. Fortunately I still have some old MSDN DVDs, so I dug these out and ran setup for the Enterprise edition of Visual Studio 6.0, installing on Vista Professional.

I can’t pretend it went smoothly. First there were compatibility warnings, which I ignored. I deselected applications other then Visual C++ and Visual Basic. Then setup appeared to hang on the screen where it detects installation components, and Vista popped up its “Program not responding” dialog. I believe this is just a matter of patience. My tip is to run task manager and see if the ACMSETUP process is taking up CPU time. If it is, give it more time.

So setup completed, but with an error towards the end:

RegCreateKey failed for \Interface\OLEViewerIViewerCLSID. Access is denied

followed by a DLLREgisterServer failure. I was informed that setup had failed, but nevertheless VB 6 and VC++ were installed and seemed to run OK.

Naturally I wanted to apply the service pack – SP5 or SP6. This is where I had the biggest problems. I could run SETUPSP6.EXE, but the install always failed. If I logged the install, I found this entertaining error:

Do not ship. Error message to log function that detects what VS products are installed in what language unable to function.

Hmmm. I Googled to no avail, though I found this thread where several others report the same problem. Then I tried removing Visual Studio 6.0 for a reinstall, but got the same error from add/remove programs. I finally twigged. The problem was that the first install never completed. Although the product was mostly installed, some part of the Microsoft Installer database had not been updated. The error message actually makes sense: the products were not installed.

Therefore I re-ran the original setup. This time I went into the Tools part of custom setup, clicked Change Option, and deselected the OLE/COM object viewer. Setup now completed without error; so too did SP6. Success.

The apps seem to work OK too – so far so good, though I’m resigned to having to use Run as administrator.

Try this at your own risk; as I mentioned above, Visual C++ 6.0 is not supported on Vista; in fact, I don’t think it is supported at all.

 

Semi-documented APIs in Windows

There have long been complaints about undocumented functions in the Windows API which give Microsoft’s internal developers an advantage over third-party software developers. Perhaps even more frustrating are those that are semi-documented. An example was found recently by a user of the htmleditor, a .NET wrapper for the HTML editor built into Internet Explorer. If you write an editor you might want to support undo and redo; there are simple undo and redo commands available but they are crude. The API also provides more advanced functions, including a change log and the ability to undo or redo entries in the log. You can find the documentation here; the relevant interfaces are IHTMLChangeLog, IHTMLChangePlayback and IHTMLChangeSink.

All looks good on a brief inspection; but note the lack of any sample code. Then think about how you might want to use this API. What exactly does an item in the change log represent – a single character, an HTML element, a paste operation, or what? How can you inspect the items (they seem to be a binary black box, understood only by an API function called ExecChange)? There is only one function for iterating through a change log, called GetNextChange – are you intended to cache the entries somewhere, since there is no GetPreviousChange or GetFirstChange? The API allows for notification of changes, but the Notify event has no arguments: presumably you are meant to call GetNextChange and do something or other with the log entry.

Of course developers have shrugged their shoulders and experimented a bit. Some have found Notify failing to fire, particularly with MFC. Others have just been puzzled. I tried it with my C# wrapper and got strange results; I think the only way forward would be to reverse-engineer the log entries to work out what it is they represent.

But what about Microsoft’s developer support? There are managed newsgroups, which are meant to guarantee a response for developers with MSDN subscriptions, as well as other online forums supposedly monitored by Microsoft developers – like Senior Program Manager Dave Massy, who says in his welcome:

Welcome to the MSDN forum for Internet Explorer Addon Development. If you have questions around development of extensions for Internet Explorer then this is the place to ask them.

Perhaps it is; but Massy is strangely silent on the intricacies of IHTMLChangeSink. I have seen this often: easy questions get a ready reponse either from Microsoft or from community members, but the tough ones, where only Microsoft has the answer, are simply ignored; or else there is a request for further information which looks promising at first but leads nowhere. Try Googling on this API; you will find questions but few answers.

My question is this: why bother publishing the API at all if it is so poorly documented and badly supported that nobody can figure out how to use it?

I would guess that this API is or has been used internally, by other Microsoft products that use the IE editor, and that somewhere in the bowels of Redmond there is proper documentation or sample code, perhaps not in sufficiently polished form for general release.

It’s time Microsoft either stopped pretending to offer developer support through these online forums, or put in the effort required to make them work.

 

Delphi 2007 is done

CodeGear says it has completed Delphi 2007, its RAD development tool for Windows. What’s notable about Delphi 2007? First, it’s Win32 only. Borland CodeGear hasn’t yet won over many .NET developers, so it took the decision to concentrate on native code in this release, although CodeGear is not abandoning .NET completely.

Second, it builds apps that work right on Windows Vista.

Third, there’s a new database API (CodeGear calls it an “architecture”) called DBX4; I’ve not investigated this yet. 

Fourth, it’s mostly binary-compatible with Delphi 2006 so that existing add-ins should work.

Fifth, it uses MSBuild (same as Visual Studio 2005), which is good news for anyone with a non-trivial build process.

Delphi 2006 was a huge improvement over the two previous versions (Delphi 8 and Delphi 2005). Version 8 was for .NET only, bypassed by most Delphi developers. 2005 brought .NET and Win32 together, but the IDE was barely usable. 2006 is pretty good; it looks as if 2007 may be better still. Although the feature set is not particularly exciting, the product is said to be faster and more reliable, which is what Delphi developers care about most. I will be reviewing the release shortly and will post links when available.

 

Technorati tags: , , ,

Software architects cautious about SOA; London Underground makes it work

SOA (Service Oriented Architecture) once seemed to promise a new world of smooth cross-platform and cross-language interopability, high software reuse, easier maintenance of complex systems, and clean wrapping of legacy systems. Has it delivered? I found the recent Microsoft Architecture Insight Conference surprisingly downbeat. Sam Lowe from Capgemini gave a brisk overview of where SOA is valuable, emphasizing that it is not always applicable, that its value is hard to prove, and that it often does not live up to its hype. “You need to think across business and IT”, he said, making the point that project roadmaps should not be technology-centric. It is no good rewarding people simply for creating services; if you do, you end up with lots of services for no clear reason. Too many services may be worse than too few.

All sound stuff. A second session from Conchango’s James Saull continued the theme in his “real world” session. It’s “very very rare” to see SOA success stories, he told us, following up with “I have never seen a business case for doing a service-oriented engagement.” One delegate immediately came up with one; but there was a fair amount of head-nodding as well. The supposed reusability of SOA services also got bashed. “I haven’t seen anyone to date really getting reuse,” said another delegate. Versioning and dependency issues were mentioned. The takeaway was not that SOA is useless, but rather that resources have been wasted in a mistaken belief in SOA as a solution to everthing.

It took a case study to bring relief from these depressing assessments. This was from the London Underground, the same WPF (Windows Presentation Foundation) application that I commented on earlier, but with a little more detail. I was not the only person impressed by this application; apparently the governor of the Bank of England, Mervyn King, paid the developers a visit to find out more about it. Although the project is only a proof of concept, there is great enthusiasm for it and a production version is actively being planned, though it will take until Q3 2007 before the 20,000 London Underground desktops are powerful enough to run it (.NET Framework 3.0 is required). Passengers may actually see station displays running WPF.

The London Underground application brings 3 or 4 systems together into one visualization. You can think of it as a kind of Enterprise mash-up. Although it is the user interface that catches the eye, it would not be possible without an existing investment in SOA, going back several years. It therefore appears that London Underground is getting reusability and other SOA benefits that are eluding most others. I asked what the secret was. The answer was a little vague. “We’re fortunate that we had the right services in the right place at the right time,” said developer Keith Walker. Peter Goss expanded on this. “We have four of five main services we use, but each of our large applications has an interface exposed which we can consume from if necessary. It’s an ongoing process.” In other words, every application was designed to be part of a platform, not just to work in isolation.  There was the right level of granularity for the services, which matched the business well.

Here at last is an example of SOA yielding perhaps unexpected benefits, presuming that the proof of concept does translate successfully into a deployed application. For more background on this case study, download the presentation referenced in my earlier post.

So what does it take to be successful with SOA? It’s hard to discern whether London Underground is just a particularly good fit for this kind of architecture, or whether it happens to be using development principles that would work equally well in other contexts.

 

Visual Studio 2005: still needs admin rights on Vista?

It was good to see – at last – the release of Visual Studio 2005 Service Pack 1 Update for Vista.

I was hoping this update would remove the need to run Visual Studio 2005 with administrator rights on Vista. Unfortunately I don’t think it does. It’s hard to be sure; in fact, I can’t find any clear statement about what the “Update for Vista” actually does. Following the “more information” links on the download page is like playing the original Adventure game – a maze of twisty little passages, all alike – none of which tells you what you want to know.

Still, I note that the list of bad things which happen when you run with normal permissions still exists; so I’m presuming Microsoft still recommends using “Run as administrator” for Visual Studio.

I dislike doing this. I don’t develop on Linux as root, nor on the Mac – why should it be needed on Windows? I realise that some things need local admin rights for good reasons – registering a COM DLL, for example – but I don’t see why I should have to run the entire IDE as admin just for the sake of those few activities.

How dangerous is it? I presume it’s no worse than running as admin on XP, for example, but it’s pretty bad. For example, I checked out what happens with online help if you use “Run as administrator” to start Visual Studio. Help opens in a separate application called Document Explorer, which embeds Internet Explorer to render the online documentation. As I expected, if you open this from Visual Studio’s Help menu it runs with elevated rights. Naturally, the docs include links to external web sites. What if you right-click one of these and choose “Open link in external window”? The site will open in IE, but take a look at bottom right. “Protected mode off”. In fact, IE is now running with a high integrity level, just like Visual Studio. Nothing to stop you browsing the web from here, probably not realising you are more at risk than usual.

It’s crazy to be reading documentation and browsing the web with full admin rights, just to keep Visual Studio happy.

I intend to try running Visual Studio as a normal user and see how it goes. I reckon it will work for some projects at least.

Note: if you want to see the integrity level of the processes on your system, download the latest Process Explorer. You’ll need to select the Integrity Level column. The ins and outs of UAC and the extent to which it protects you are discussed in Mark Russinovich’s blog entry on the subject.

 

Technorati tags: , , ,

What would the young Bill Gates make of today’s Microsoft?

He would be hacking (in a good way) with the crowd at the Future of Web Apps conference I attended two weeks ago, not here with a bunch of senior software architects discussing the failures and successes of SOA (Service Oriented Architecture). I’m at the Microsoft Architecture Insight Conference in Wales, where I’ve been hearing a lot about old-fashioned ideas like requirements analysis, making the business case for change, being realistic about software reuse, and other sound, sensible, but unexciting software development principles.

That’s not to say this is a bad conference, far from it. I had an excellent chat with Microsoft’s Jack Greenfield, a Microsoft architect who is putting together the next generation of Microsoft’s modeling and enterprise development tools for Visual Studio. “Software factories” is the buzzword – see here for more background on this. There is also good stuff on identity management within and beyond the firewall, sessions on using development methodologies in Visual Studio Team System; amigo Ivar Jacobson is here talking up his Essential Unified Process (though “process” is last year’s word; we do “practices” now); and a number of case studies including one on visualizing the London Underground network which I’m looking forward to later today – this is the amazing WPF application which was shown off at one of the Vista launches.

It’s easy to find fault with products like Vista or Office 2007; yet you have to give Microsoft credit for establishing .NET as a major platform for enterprise development against considerable JEE momentum.

That said, let’s go back to the young Bill Gates. There is a track here on SaaS (Software as a service), which seems to mean hosted, on-demand applications versus traditional premises-based development. We heard some research on disruptive technology which Microsoft is sponsoring in conjunction with the Manchester Business School, including a look at Siebel vs Salesforce.com for CRM (Customer Relationship Management). Here’s one facet that stuck in my mind. According to Dr Steven Moxley of the MBS, Marc Benioff’s first customers were not SMEs or start-ups, but groups within large enterprises that were frustrated by the shortcomings or inflexibility of their existing software. It was a kind of stealth adoption. Salesforce.com was able to sell to such groups because its software is zero-install, pay as you go.

I immediately thought of the times I’ve had phone calls that go, “Could you send that attachment to my Gmail account. Our email is playing up today.”

Gmail may be less feature-rich than Exchange; but it tends to just work.

In other words, you could as easily do Microsoft vs Google as Siebel vs Salesforce.com. Why is Microsoft sponsoring studies that articulate its own vulnerability? Officially, this is about helping its partners to grown their own distruptive solutions using Microsoft technology; but I also see this as evidence that Microsoft has abundant understanding of the difficulties it faces. What it lacks is any conherent strategy for overcoming them, though there are always hints that some such strategy will emerge sometime “soon”.

I think it might. Gates disrupted IBM; he didn’t topple it. But there is going to be some pain.

Postscript: See also this pertinent post from Zoli Erdos who is looking forward to ditching his desktop software, subject to finding a solution for a couple of unsolved problems:

My bet is on Google or Zoho to get there first. As soon as it happens, I’m going 100% on-demand.

 

IE7 phishing site confusion

Preparing for a conference, I saved the agenda from a web page to a file, so that I could read it on the train. I used the IE “web archive” feature, which saves a page to a single file with the extension .mht. When I re-opened the page later, I was suprised to see the following warning:

Local file identified as phishing site

Something wrong here I reckon. Apparently my own hard drive is a phishing site.

I suppose IE7 has a point. After all, I’ve copied the page from one place to another, and although it looks like a page on the web, it isn’t. Then again, it isn’t criminal either. I’m using a feature of IE exactly as designed.

Amusing; but the difficulty I have with these kinds of false alarms is that they undermine the real ones. How is the non-technical user to know which warnings they can safely ignore? The danger is that they end up taking none of them seriously.

 

Technorati tags: , ,