Migrating Delphi versions with DevExpress

I usually run on the latest version of Delphi while the other Delphi developers in our department run a version or two back.  I’m the pretty much the sole Delphi developer on our .NET projects and I switch between VS 2008 and Delphi 2007 as needed.  The core Delphi team is on Delphi 2006 because of how our product development and testing cycles work.  We don’t switch compiler versions without coordinating with our QA department.

The core team is moving up to Delphi 2007 later this year for the next release cycle.  The current version of the product will stay in Delphi 2006 and the versions of the 3rd party components will be locked.  While development on the next release goes on, we may need to release updates to the current version.  So we lock the 3rd party components so that QA only needs to test the code specific to the update, plus general regression across the application.

With some component vendors, this makes upgrading more challenging.  We use the Developer Express components for Delphi Win32 and for .NET.  DevExpress has wonderful components, but they use monolithic installers that install everything for each compiler per platform.  If I install the latest version of the DevExpress components for Delphi 2007, I’m also going to get the latest version for Delphi 2006.  You can’t install them separately, not without seriously confusing their installer.  Installer technology is scary enough, the last thing you want to is mess areound with the installer.  I wanted something robust, hand tweaking my system to manipulate the installer would be to fragile to have an entire team try it.

After a few emails with DevExpress support, I came with another method.  I wrote a Delphi app that would manually downgrade a DevExpress install for a specific compiler.  You would run this app after running the DevExpress installer and it would rip out the DevExpress current installed bits and replace them with a cached copy of the version that we need to stay at.  It does the following steps:

  1. Check to see if Delphi 2006 is running and stop with a warning message if it’s running.  Here’s how to check to see if Delphi 2006 is running:
    function IsDephi2006Running: boolean;
    handler: THandle;
    data: TProcessEntry32;
    Delphi2006IsRunning: boolean;
    function GetName: string;
    i: byte;
    s: string;
    result := '';
    i := 0;
    while data.szExeFile[i] <> '' do begin
    result := result + data.szExeFile[i];

    if uppercase(result) = 'BDS.EXE' then begin
    s := uppercase(ProcessFileName(data.th32ProcessID));

    Delphi2006IsRunning := pos('BDS\4.0\BIN\BDS.EXE', s) > 0;
    Delphi2006IsRunning := false;
    handler := CreateToolhelp32Snapshot(TH32CS_SNAPALL, 0);

    if Process32First(handler, data) then begin
    while Process32Next(handler, data) do begin
    if Delphi2006IsRunning then

    result := Delphi2006IsRunning;

  2. See if the Package Cache key, HKEY_CURRENT_USER\Software\Borland\BDS\4.0\Package Cache, exists in the registry.  If it does rename it.
  3. Deregister the DevExpress components from the IDE. 
    In Delphi 2006, the component packages are registered in HKEY_CURRENT_USER\Software\Borland\BDS\4.0\Known Packages.  The rollback program has a list of list of every DevExpress 5 and 6 package.  My code rips them all out. Before they are removed, their location is cached as this is the folder where the compiled library files are located.  For Delphi 2006, this defaults to “C:\Program Files\Developer Express.VCL\Library\Delphi10”.
  4. Using the location the library folder for the DevExpress compiled units, we delete all of the files in that folder.  If you want to be extra cautious, you could just rename that folder and create a new one with the original name.
  5. Copy the cached copy of the rollback version of the DevExpress compiled units to the library folder.  I keep a clean copy of the library folder in a protected location on our network.  If you need to rollback your DevExpress components, you’ll want to cache those fiels before doing anything else.  You will also need to cache the list of packages to install.
  6. Register the rollback packages into the Known Packages key used in step 3.
  7. Copy the runtime packages to the bin folder.  You can get the location of the bin folder by reading the value of RootDir in HKEY_CURRENT_USER\Software\Borland\BDS\4.0.  I keep a cached set of the runtime packages in the same folder that I keep the cached library files.

This process goes on the assumption that the DevExpress source code is not your Delphi search paths.  We typically leave the source code of the 3rd party components off the search path and just use the compiled units.  You get a faster compile and you don’t have to see other vendors compiler hint and warning messages.  If you want the source code on the search path, the you will need to cache all of the source code files.  At that point, it would be easier to cache the entire “\Program Files\Developer Express.VCL” folder.  And that’s how we upgrade selcted portions of our development environment.

Proof by lack of evidence

CNET’s Matt Asay wrote an article for CNET’s News.com that was just so bad, it gets the “Epic Failtag.  You can get the gist of how bad it is by the first few lines:

Vista’s big problem: 92 percent of developers ignoring it

And to think Microsoft used to be popular with the developer crowd…

Not anymore. A recent report from Evans Data shows fewer than one in 10 software developers writing applications for Windows Vista this year. Eight percent. This is perhaps made even worse by the corresponding data that shows 49 percent of developers writing applications for Windows XP.

Wow, I’m not sure where to start on this one.  I started by visiting the Evans Data web site that Asay refered via this link.  It was vague and provide no actual metrics.  How that “one in 10” number was arrived that was never specified.  Sounds pretty bogus to me.

What they did say was this:

Only eight percent of North American software developers are currently writing applications to run on Microsoft’s Vista operating system, while half are still writing programs for XP, according to Evans Data’s Spring 2008, North American Development Survey. These same developers forecast a fragmented Windows market in 2009 with only 24 percent expecting to target Vista and 29% expecting to continue with XP.

8% of what?  Is that 8% of all developers writing for the Windows Desktop or is 8% of all North American software developers.  The former is a subset of the latter.  Did they exclude web developers from that count?

The other question is what do they mean by writing for Vista?  Does that mean writing for features specific to the Vista platform or does it mean writing the code so that it behaves under Vista?  Did they break that out by managed code as compared to unmanaged code?  If you are writing managed code like for the .NET Framework or Java, then you are not targeting an OS, you target the managed code framework.

Since Matt conveniently left out any actual numbers, I can use myself as a sample set.  A sample size of 1 is just as relevant and/or meaningless as an undefined sample size. I write shrink-wrapped applications for the Windows desktop market.  I do both Win32 coding (with Delphi 2007) and for the .NET Framework (with Visual Studio 2008).  All of my code is tested on XP, Vista, Server 2003, and Server 2008. 

With the .NET Framework, I have no code that is OS specific and I didn’t have to change any of it for Vista or Server 2008.  For the Delphi code, some minor changes were made to account for the location of the local application data folder.  That was all we had to do.  It’s something like 5 lines of Delphi code out 500,000+.  Of course by using Delphi 2007, we get the benefit of the Delphi VCL being Vista aware.  We get the Aero Glass effects and the new UI for dialogs without any code changes.

Does that mean we are not targeting Vista?  No, it just means for our applications, that Windows XP and every OS that comes after it is tested and supported.  That leads back to the critical failure point of Matt Asay’s article.  He’s making broad assumptions based on no evidence.  I’m reminded of that old quote by Leonard H. Courtney, “There are three kinds of lies: lies, damned lies, and statistics.”

I don’t usually read news.com anymore, in fact I came across Matt Asay’s article in a blog post by Steve Trefethen.  So I’m not familiar with Matt Asay’s body of work.  I don’t know if he wrote this out of ignorance out or as Steve put it: “written for no other reason than to generate traffic for c|net.”  I would like to know how much actual research Matt performed for his article.

The title of this post comes from the “You Are Wrong Because” portion of Scott Adams book, “The Joy of Work: Dilbert’s Guide to Finding Happiness at the Expense of Your Co-Workers”.  The context was that Adams has stated that irrational people are easily persuaded by anything that has been published.  I think that’s applicable with with Matt Asay’s article.

{updated on 6/23/08]
I removed the link to Matt Asay’s article because I didn’t want to give him any more traffic.  It’s not that there would be a lot coming from my blog, it’s more of a principle thing.  I had originally included a link so that people could make up their own mind, but I think I have enough of his article to make my point.  And if you really want to read it, you know where to find it.

What’s the deal with the idiots wearing Bluetooth earpieces at a dance recital?

On the Saturday that just passed, our family was at the Palace Theatre for our daughters dance recital.  They had a lot of fun and really enjoyed their time performing on stage.  One thing that annoyed me were the people who insisted on wearing their Bluetooth headsets during the performance.  With the lights lowered, the blue lights blinking were a major distraction.

Don’t these people know that they look like dorks wearing their blue light idiot badges in a performance hall?  You wouldn’t answer the phone (well, you shouldn’t) at a dance recital, that would be rude and disrespectful to the performers and their family and friends.  One of the mothers in my younger daughter’s class was wearing one.  I kept thinking, “Are you out of your mind?”.  I had to stand near her because all of the girls had rows assigned to their classes.  Out of the corner of my eye, I kept seeing this blue light blinking and it was very distracting.

Blue LEDs are brighter than other colors and in a dark room, they will draw your attention.  Our brains are wired that way.  In my home office, my PC’s case has a couple of blue LED’s and they light up the room.  No need for night lights in my office.  Between the brightness and how our eyes perceive the color blue, bright blue LEDs can cause eye strain.

I have a Bluetooth headpiece, but I only use it in the car.  I don’t have anything against Bluetooth technology, but there is a time and place for everything.  And a dance recital is neither the time nor the place.  Think about it for a minute, it’s not practical to use a Bluetooth earpiece in performance hall.  If someone calls you, you wouldn’t want to take the call in your seat, you would walk out to the lobby to take the call.  You would be better off just to set the phone to vibrate and keep it in your pocket.

Unless they are wearing the earpiece as a fashion accessory.  “Hey, look at me!  I have a device embedded in my ear advertising my dorkness every two seconds”.  Come on, if you want to carry a techno device to look cool, you’re 4 years too late with Bluetooth.  If that’s what you want, then get an iPhone, it’s new enough to make you look cool. 

As a side note, a few weeks ago I saw some guy with Bluetooth earpieces in both ears.  We called it “Double-dorking”.

Tim Russert, 1950-2008

I was shocked to hear about the passing of Tim Russert.  I always enjoyed watching “Meet the Press” and I should have watched it more.  I’ve been kicking myself forgetting to TiVo this morning’s show.  On this morning’s “Meet The Press”, Tom Brokaw hosted a tribute to Tim Russert.  Fortunately, the show is available on the MSNBC site, and I’m grateful for that.  I don’t know know it will be available, but the following link should work right now.


If you want to view a larger version, even fullscreen, try the following: http://www.msnbc.msn.com/id/21134540/vp/25173667#25173667.

He was the master of the interview, his show was not the one to do if you were looking for softball questions.  Even though he came out of politics, first with the late Senator Daniel Patrick Moynihan, then with the Governor of NY, Mario Cuomo, Tim Russert was non-partisan and fair.  His untimely departure leaves a great void and he will be missed.

Unblocking attachments with Outlook

Today, one of the other programmers needed to send me some odd registry entries that were on his machine.  So I asked him to export the registry settings to a .reg file from regedit and then and email me the .reg file.  Outlook blocked the file attachment because the .reg file extension is on the Outlook equivalent of the “No Fly” list.  Outlook has two levels of attachment security, Level 1 and Level 2.  Level 2 attachments will prompt you to save the file to your hard disk.  Level 1 attachments are blocked at the client by Outlook and can not be accessed.  The list of file types classified as Level 1 are listed here.  It has the usual suspects and this include .reg files.

That’s annoying.  I wanted that .reg file.  Fortunately, you can white-list specific file types in the Level 1 list and allow access to them.  I found the following instructions on the HowTo-Outlook web site at this page.

  1. Make sure Outlook is closed.
  2. Open your registry editor by opening the Run command and type regedit (regedt32 for Windows 2000)
  3. Locate the following key
    Outlook 2000 [HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Security]
    Outlook 2002 [HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\Security]
    Outlook 2003 [HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security]
    Outlook 2007 [HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Security]
  4. Go to Edit-> New-> String Value and name the value Level1Remove (case sensitive!)
  5. Double-click on the newly created value and enter the extension including the “dot” that you want to open in Outlook. For instance .exe
    If you need to enter more than one extension you’ll have to type separate them by a semicolon like this; .exe;.bat;.url
  6. Press OK on the input box and close the registry editor
  7. When you open Outlook the attachments which hold those extensions aren’t blocked by Outlook anymore.

In my case, I just used “.reg” as the file extension.  To go back to blocking the extensions, just remove or rename the Level1Remove string value from that registry key.

This isn’t that hard to do, but it’s a pain to have start and stop Outlook just to get the new settings to take affact.  I can understand why the restart is required, it prevents malicious code from changing the setting without you being aware of some going on with Outlook.

When chicken bombs are outlawed, only outlaws will have chicken bombs

From the The Hartford Courant:

…A motorist on Powder Forest Drive Friday morning noticed what looked like a whole chicken — the kind bought at grocery stores for roasting — with a pipe bomb stuffed inside, police said Monday.

When they arrived on the scene around 9 a.m. officers found the roaster had an improvised explosive device where the fowl’s innards should have been.

They closed the road for part of the morning as the Hartford Police Department’s bomb squad was called to detonate the device, police said.

The full article can be read here.  Are chicken bombs the latest meme?  I saw references to this story on bunch of sites.  One of more entertaining links is here, scroll down through the comments.

Backing up your Blogger hosted posts

This blog is hosted on Google’s Blogger platform.  It has it’s own domain name, but it’s still on Blogger.  While I have faith in our Google Overlords, I still like keeping a local backup of the blog posts.  There’s a nice open source Blogger backup utility named “Blogger Backup”.  It’s written in C# in VB.NET and is hosted on CodePlex.

When it’s running, you’ll see a window that looks like this:

Sell photos on photrade | By Chris Miller

You save each post as it’s own file, or put them all inside one big, honkin’ file.  The posts are saved as XML to make it easier to process.  You can use Blogger Backup to restore the posts back to your blog.  That would be handy if you accidentally delete a blog post.  You could also use the saved XML files to port your blog to another platform.  While I have no intention of moving this blog off of Blogger, it’s good to know that I would have a way of migrating all of my posts to a new platform.

Blogger Backup is a .NET application, you’ll need to have the .NET Framework 2.0 installed.  To communicate with Blogger, it uses the GData.Net (Google Data API for .NET) library.  I wasn’t familiar with GData, it’s a Apache licensed API that provides programmable access to many of Google’s services:

  • Base
  • Blogger
  • Calendar
  • Spreadsheets
  • Google Apps Provisioning
  • Code Search
  • Notebook
  • Picasa Web Albums
  • Document Feed
  • Contacts
  • YouTube
  • Google Health

GMail is not on the list, but that would be asking for trouble.  The last thing we need is a Google API for sending spam through GMail.  The API is not limited to .NET, they have versions for Python, Java, and Objective-C.  I think you could do some interesting things with the GData API and their Calendar.

If you are wondering about the screenshot, I’m playing around with the beta for Photrade.  It has some cool features, it’s worth checking out.

[Updated on 6/12/2008]
For some reason I thought Blogger Backup was written in C#, when it’s actually VB.NET.

Photrade has updated their license agreement for everyone’s benefit

Yesterday, I posted about a new site called Photrade and it’s license agreement.  Basically, section F of their license gave them the permanent right to do anything to your images with out compensation.

Their site looks cool and it provides features that I haven’t seen anywhere else, but the license was too broad for my comfort.  Within 4 hours, they had revised their license.  The updated license gives Photrade the rights to use your images in order to operate the web site and to provide the functionality that the web site gives you.

That’s really cool.  The updated license is completely appropriate for their business needs with out reserving any permissions that they would not need to operate their site.  The change in the agreement is very similar to the changes that Adobe made with licensing for Photoshop Express, except that Photrade revised the license with 4 hours. 

From the comments posted to my earlier post, it sounds like the original license was drawn up by lawyers seeking to provide the greatest level of protection to their client.  My guess is that no one looked at section F too close enough to realize how broad the rights were that were being granted to Photrade.  I’m sure that the people behind Photrade had no intention on reselling the images, but since the original license gave them that right in perpetuity, that part needed to be revised.  And it was revised in under 4 hours.  For revising and publishing a legal contract, that turn around time is very impressive.  Without knowing the people behind Photrade, the speed in which they revised their license says a lot about their character.

Now that I’m comfortable with the license agreement, I’m looking forward to trying Photrade.  For more information about Photrade, take a look at their site tour video.

Photrade lets you sell your photos online but retains perpetual and royalty-free license to your images

I have updated this post with additional details about how Photrade has revised their license agreement.  I also put additional comments in a new post.

I’m still playing around with Twitter and one of the accounts that I follow is photojojo.  The photojojo site is pretty cool and has some decent photography tips.  A little while ago, Photojojo tweeted a free invite code to the beta of www.photrade.com.

Hmm, a site where I could sell my images.  There a few ways of earning money on their site.  From their FAQ page:

There are 3 different ways to earn ad revenue:
1) From banner ads on your Photrade galleries. Earn every time someone sees your galleries.
2) From Photrades unique Patent-Pending Picture-in-Picture advertising (during our Beta test this ad space is donated to charity and/or used for test ads), where the ads are directly IN the photo when it gets shared. Earn Ad revenue every time someone sees your photo on ANY website (ie. in your blog or on your myspace).
3) From ads on a splash screen where users land when they click on your photos from another site. Earn ad revenue every time someone clicks on your photo when it iss hosted on another site.

You can sell your images and add a markup.  There is a base price for images and you can set a mark up value and collect the difference between the base price and the markup.  Plus you can sell licenses as stock images.   The idea of generating ad revenue by using your own artwork in blog postings looks intriguing.  If someone hotlinks your image, they would be hotlinking your advertising.

Sounds cool, but I declined to complete the membership form.  To complete the sign up process, you have to agree to the terms of the Photrade License Agreement.  Never agree to a license agreement without reading it.  That is really important when your own intellectual property is involved.  Most of the license is common boiler plate code, but I stopped when I hit section (F).  The following is section F in it’s entirety:

(F) Company does not claim ownership in Your Content. At all times, You retain all rights in Your Content. However, each time You upload Your Content, You irrevocably grant to Company, its parent, subsidiaries, affiliates, and advertising or other partners a non-exclusive, perpetual, worldwide, royalty-free license in and to Your Content and intellectual property rights therein. Such license shall include, without limitation, the right in perpetuity, without any credit or compensation to You, to use, reuse, modify, alter, display, backup, archive, publish, sub-license, perform, reproduce, disclose, transmit, broadcast, post, sell, translate, create derivative works of, distribute and use for advertising, marketing, publicity and promotional purposes, all or any portion of Your Content, and Your name, voice, likeness and other identifying information, in any form, media, software or technology of any kind now known or developed in the future for any purposes whatsoever including, without limitation, developing, manufacturing and marketing products or services using Your Content. Intellectual property rights shall include all patents, trademarks, service marks, trade names, trade identities, copyrights, trade secrets, rights of publicity, logos, domain names, know-how, source code and object code, mask-work rights, inventions, moral rights, author’s rights, goodwill and other intellectual property and proprietary rights whatsoever. You hereby waive any moral rights You may have in and to any of Your Content, even if such material is altered or changed in a manner not agreeable to You.

I marked in bold the part where I lost interest in signing up.  Basically, anything you upload becomes freely available to Photrade and they can do anything they want with it.  If you upload a spectacular snapshot of a sunset from your vacation, Photrade can sell it and they don’t have to share any of the revenues with you.   That’s the same sort of nonsense that Adobe tried to pull when they release Photoshop Express.  That didn’t go over too well and Adobe revised their terms of service to make it clear they wouldn’t sell the images.

Photrade’s license looks pretty evil.  Their intentions may be pure (and I am assuming that they are), but that license allows them to anything to your images and your personal information forever.  And that’s a mighty long time time, according to Prince.  I would consider signing up if they revamp that license to make it more like Adobe’s.  It would be nice if you could license your images with a Creative Commons license like Flickr does.  The concept looks good, but that scary fine print make it a non-starter for me.

[Updated on June 11th, 2008]

As noted in the comments, Photrade has revised their license.  The new section F is more more reasonable:

(F) Company does not claim ownership of Your Content. At all times, You retain all ownership rights in Your Content. However, we do need certain rights from you, with respect to Your Content, in order to operate the Website and in order to enable you to do all the things this Website affords you the ability to do. Therefore, by uploading or transmitting Your Content to Website, you grant Company a worldwide, royalty-free, non-exclusive, fully sublicensable license to use, reproduce and modify Your Content solely for the purposes of operating the Website and enabling your use of the Website. To the extent that you choose to make Your Content available for sale or licensing to Users, you additionally grant Company the rights to distribute, publicly perform and publicly display Your Content (in whole or in part) for the sole purposes of operating the Website and enabling your use of the Website and to sublicense Your Content to other Users.

Basically, this gives Photrade a license to your images in order to present them on their site and enable the usage of the image.  This gives Photrade the legal protection that they need to run their site while still protecting the users.

I’m impressed, they made this change in just a few hours.  That’s not an easy task to pull off when you are changing the contents and coverage of a legal document.