Showing posts with label Delphi. Show all posts
Showing posts with label Delphi. Show all posts

2008-03-15

Portable Delphi 2007 for Win32 - Part I

[EDIT] Even though you can do all listed here, there are a few minor 'gotchas' that you should be aware of, so browse through the 2nd part before following this to the letter, especially if you use the command line rather than a graphical tool to delete the folders. I'm currently typing Part II into Windows Live Writer, so check back in a couple hours if it's not online yet when you're reading this... Unfortunately I ran into an internet problem and then changed my mind and decided to split the work and use WinWord to create a PDF file to upload with the whole start to finish process and only keep the "blah-blah" on the post so that you can more easily follow the process without waving through a ton of blah-blah. But real-life has a way of messing up one's plans! I have been sick for a few days (an annoying flue that kept me in bed and hardly willing to touch a computer). I'm feeling better now and will finish work on this as promised, but it most likely won't happen before the next weekend as I have a lot of work stuff to catch up during the week.[/EDIT]

Ever wanted to carry your development environment with you on a flash memory stick? Well, using Thinstall you can, albeit it comes with a hefty price tag of 5.000 USD... Maybe now that VMWare has bought the company they'll wise up and release a cheaper personal version! I would like one, and have e-mailed them already stating that. If you would too, don't forget to bring it to their attention! (Edit: Thinstall is now known as VMWare Project NorthStar)

There seem to be some cheaper alternatives, and I even tried Xenocode's Virtual Application Studio (VAS for short) but, even though it has a nice visual interface, it has a few fatal flaws. I couldn't find a way to have multiple entry points and even something as simple as selecting the main entry point is painful with an application that has several thousand files as they use a simple non-typing lookup and they display ALL files to be selected. And if your app (or app combo) somehow has the same exe name in two different folders, then you can't tell them apart in that combo-box... But the main problem against VAS was it failing a simple test: virtualizing ActiveState's Perl 5.8.8... That's something that Thinstall did without a glitch...

This is a two-part article, but don't worry: this time both parts are already written before publishing the first one! But I also like to tease a bit, so Part II will only come out in a couple days! That and because I took my notes on a text file while doing things and have to get them into WLW for proper formatting! :)

Thinstalling (TM) Delphi for Win32 2007 (TM) Professional

Those reading my blog will know that I'm a bit anal about files and disk space in my computer: I'm a software developer (among other things), so I like to be in control! It is me and not the machine nor the OS or any given application that should be in control of what goes on on my computer...

In light of that, I have a plethora of small and some not so small utilities that I have in a "ready-to-run" state on a different partition, so that, after a fresh install, I can run those immediately. I also use Delphi (currently the "2007 for Win32" version) and if you couple all that with the lousy installer and/or lousy install script that Delphi ships with you can understand why I have targeted it a few times before.

I also hate the way my system gets noticeably slower as I add programs. That's no big surprise: the big junkyard of Windows, usually known as Registry, easily starts to hold a gazillion of entries slowing it down. Add Windows Installer to the mix (and very few major-named products these days use an installer that is not based on MSI technology) and you can see where all this goes...

MSI technology is one of those nice-in-theory concepts with all it's self-healing that allows a "regular Joe" to keep running, say, Microsoft Office, even after he blissfully deletes some required folders because upon running an office application it will detect that some files are missing and will re-install them. Now, this is bad news for those like me that like to tweak things. Something as simple as deleting some readme's in 30 different languages will trigger the self-healing process and next time you run your app, they'll be back in place... Also, messing up with the MSI files left behind on your disk will usually result in bad news, from missing application icons (why on earth don't they use the proper .EXEs for the shortcut icons?), to more serious problems with self-healing kicking in and asking for original media to put things back there and you not being able to run the app until you please the installer...

So, I decided to try a new angle and this time I decided to experiment with an old tool but one which I only recently got in contact with: Thinstall. In a short sentence, it's VMWare for single applications, that is, it's a virtualization system that allows you to run applications without installing them first. Just double click a "simple" executable file and it will run as if you had installed it on your machine.

So, what are the pluses and minuses of Thinstalling applications?

+ No more re-install whenever you switch machines or re-format your C: drive or reset it to a "working" ghost image;
- You do need to re-activate when you switch machines; (that's an area where those using pirated and cracked versions have an edge over us, licensed users, but that's the price to pay when companies don't trust their customers and with MSFT setting the way, other companies keep following like lambs...)
+ You can run Delphi 2007 for Win32 from a 1 GB USB flash drive even on a machine with NO .Net installed and from a restricted guest account;
+ You can run it from a network share with no concurrency problems;
- Updating a "Thinstalled" app requires a bit more work (more on that on Part II);
- By default, a thinstalled program will have R/W access to "My Documents" and "Desktop" only: every other file/folder accessed, if changed, will be modified in a local copy on a "sandbox"; you can however configure per folder/drive which ones will be writeable or not. Or you can configure your thinstalled app to run in "merged" mode, but that can be tricky if the host computer has a similar version of the app installed.
+ Thankfully, network and removable drives are used R/W by default so if your files are not on a local disk, you don't need to make further changes to modify them.
- You can't Thinstall apps that install device drivers, such as PalmOne apps or a Virtual CD/DVD emulator or even some Anti-Virus.
+ You can Thinstall applications that install and depend on services as those will be virtualized and started as well when you run your app.

In my current setup, using a 4 GB flash drive, I can fit pretty much everything I need, being 1 GB for a ghost image of Win XP SP3 RC2 with nothing but Win XP + AV + , another one for Delphi 2007 and still have 2 GB left for other thinstalled applications and some data files. This allows me to be back in a working condition within 10 minutes, even if something seriously messed up my hard disk big-time...

So, how does one get to Thinstall Delphi 2007 for Win32?

After you get hold of a copy (you can get a trial from Thinstall's website), you do the following:

0 - Start with a CLEAN machine: I recently re-installed my C: partition with Windows XP SP2 and, after changing some settings, I proceeded to make a ghost of that partition to a bootable 2 GB USB flash disk (only uses less than 600 MB after a bit of tweaking). Using a CLEAN machine is important as is choosing the "oldest" one, that is, if you plan on running it on Windows 2000 and XP, don't use XP for the CLEAN machine as it may already have some files that the 2000 will not and those won't be installed and thus won't be captured.

0b- It's also VERY important to do it all in one go and refrain from using non-related programs, such as surfing the net or doing downloads or even cleaning up your temporary folders: whatever you do may get added to the thinstall project and needlessly clutter it.

  1. Run "Setup Capture" and do the pre-install capture.
  2. Install Delphi (including .net runtime and SDK); as for the shortcuts location, I used the option for "All Users" so it would not clutter my relocated "My Documents".
  3. Launch and activate (if you want the install to be pre-activated, e.g., you're the only one using it); if you don't activate, when you run it you'll have 30 days to do it later, although I believe, but haven't tested, that those 30 days start counting from the day you INSTALLED it and not from the date you first run the Thinstalled version.
  4. Configure any settings and/or install components and/or install updates.
  5. Run "Setup Capture" and do the post-install capture.
  6. Select the "shortcuts" to create and main package name. When you Thinstall an application, you create a single executable file but you can have alternative "entry points" into that file to run other applications that are part of the same capture. For instance, you can have an independent shortcut for running the Help Documentation without first launching Delphi. These are dependent of the "main" package where all the files/registry settings are stored. On my system, and for some reason (GUID conflict?), it suggests to store the capture in "ATI - Software Uninstall Utility". I opted instead to name the capture folder "Delphi 2007".
  7. Wait a few minutes while it copies over 31.000 files using 3+ GB for my Professional SKU full install.
  8. On my system, it failed to copy "C:\Documents and Settings\LocalService\NTUSER.DAT" and "C:\Documents and Settings\NetworkService\NTUSER.DAT": just ignore as those should not be copied anyway... This may be a symptom of me not following step 0b! :)
  9. IMMEDIATELY SAVE this captured installation, that is, save the "Delphi 2007" sub-folder inside the Captures folder: this will be needed later if you want to upgrade your installation. I copied it to my external hard-drive and named it "Delphi 2007 (Full)" to distinguish from a copy that I'll make later after the tweaking is done.
  10. Now we can start tweaking the thinstallation!

Tweaking the Thinstallation

You can do the remaining process on any machine: all you need is access to the thinstall folder and respective Capture sub-folder where you stored your "Delphi 2007" capture. I opted to use the same machine as I will quickly restore it to a clean state by booting from a flash drive and running ghost from there.

  1. Go to your "Delphi 2007" capture folder and open up "Package.ini";
  2. Uncomment (remove the starting ";") the "CompressionType=Fast" line and comment the other one (";CompressionType=None"); this will instruct Thinstall to use a quick compression when creating this application. Whenever in doubt, check Thinstall's online help file for available options.
  3. Edit the "Sandbox=" line and use a descriptive name. (I used SandboxName=Delphi 2007). Whenever you run a Thinstalled application, any changes to registry and files that are not in the "merged" folders/keys will be saved in a local sandbox. By default, that is in your current user's Application Data\Thinstall\<sandboxname> folder, so, in a typical Win XP install, with a user named Joe and the suggested sandbox name above, this will be "C:\Documents and Settings\Joe\Application Data\Thinstall\Delphi 2007". It is possible to configure the application to clear this folder on exit, but you can also do a more interesting thing: if you create a "Thinstall" folder in the same place where you have your Thinstalled application, that folder will be used to store the Sandbox. This is particularly useful to do when running an application from an USB flash drive as in this way, not only your settings are not stored on the local computer, they will "travel" alongside the application on your flash drive.
    3b- I like to keep my apps in the same drive, a partition of my HDD and a copy of everything on a 4 GB flash drive. In both cases, a neat way to keep all your settings (read: sandboxes) nicely grouped in one place is to add the following line next to the previous one:
    SandboxPath=LocalSandbox\..\..\..\..\.Settings
    This way, and as long as your apps are not stored more than 3 levels deep, all the sandboxes will be created under the .Settings folder in the root of the drive where the applications are. So you can have something like:
    X:\Multimedia\Image\Image Editing App 1.exe
    X:\Multimedia\Image\Image Editing App 2.exe
    X:\Multimedia\Audio\Audio Editing App 1.exe
    X:\Dev\RAD Studio 2007\Delphi 2007.exe
    and, assuming the Sandboxes use the same name as the executables, you'll have the sandboxes created like this:
    X:\.Settings\Image Editing App 1\
    X:\.Settings\Image Editing App 2\
    X:\.Settings\Audio Editing App 1\
    X:\.Settings\Delphi 2007\
  4. At this point, I did my first "build" which is as simple as invoking the BUILD.BAT file: 1 hour and 22 minutes later (on a 3 year old laptop!), I had a 2.000.782.941 bytes "Delphi 2007.dll" file along with a few .exe entry points for a total of 1.86 GB. Of course, this includes at least the huge 600 MB file with the .NET framework SDK install files. We'll get rid of those soon!

    4b- Don't worry about two things: the app won't show the proper icon (we'll use a workaround for an explorer bug soon), and it may take a LOAD of time launching (we'll get to that fix soon too!). If you want to test it out quickly, just launch something like the Command Prompt or the Documentation.
  5. Thinstall captures are very easy to process: 3 "registry change" files are created containing all the registry changes to HKLM, HKCU and HKU; several "virtual" folders are created such as "%desktop%" which equals the current user's desktop folder and some %drive_x% folders for each drive where changes where made other than in one of the "standard" folders, that is, if the program only makes changes to, say, "C:\Program Files\CodeGear...", you will see no %drive_c% folder created, but if you change the default install to, say, "C:\Delphi2007", then you'll see a %drive_c%" folder with whatever was created/modified there.
  6. We can safely get rid of uninstall files(*) as there's no point in uninstalling stuff from a Thinstalled app: even though the changes would be recorded in the local sandbox, and it would appear uninstalled, you'd save nothing by doing so and by deleting the sandbox, it will revert back to the "default" state. Thinstall also already ignores changes to some self-healing registry keys, so you can remove stuff without being prompted with a "re-install".
    (*) As we'll see in Part II, there are some exceptions, with Delphi being one of them!
  7. With that in place, let's delete (you DID make that full copy already, didn't you?!) the following folders/files:
    - %ProgramFilesDir%\Microsoft Visual Studio 8\Microsoft .NET Framework 2.0 SDK - ENU (569,8 MB)
    - %SystemRoot%\Microsoft.NET\Framework\v2.0.50727\Microsoft .NET Framework 2.0 (76,4 MB)
    - %SystemRoot%\Microsoft.NET\Framework\v2.0.50727\Microsoft Visual J# 2.0 Redistributable Package (15,6 MB)
    - %SystemRoot%\Installer (93,9 MB - this was unrelated to Delphi 2007 and probably because I somehow ran something else: I've had this capture on "hold" for a couple days...)
    - %Common AppData%\{6AF0EFC6-B937-4704-A430-319EB93F4C12} - Delete all sub-folders but leave the files as they're needed for the "Check for Updates" option. (423 MB) This one will be in %Local AppData% instead of %Common AppData% if you used the "Just for me" shortcuts option when installing.
    - %Common AppData%\{135F413C-658B-4923-B950-5F2B786BC8DA} (341 MB - Help update setup files)
    - %Profile% (nothing useful)
    - %Common Programs% and %Desktop% - These hold the shortcuts as created by the installer, but we'll use a different set
    - HKEY_USERS.txt (on my system, there's only a handful entries and none Delphi related, probably for me breaking step 0b!)
  8. Now let's open up Package.ini and fix a few more things:
    - Fix the broken Icon for "Delphi 2007.exe". Find the section [Delphi 2007.exe] and duplicate it. Now do a find/replace (on the whole text file) finding "Delphi 2007.exe" and replacing with "Delphi 2007.dll". Next, change one of those two sections to read [Delphi 2007.exe]. You'll need a few more changes so just check that they look like this:

    [Delphi 2007.exe]
    Shortcut=Delphi 2007.dll
    Source=%ProgramFilesDir%\CodeGear\RAD Studio\5.0\bin\bds.exe
    CommandLine="%ProgramFilesDir%\CodeGear\RAD Studio\5.0\bin\bds.exe" -pDelphi
    Shortcuts=%Programs%\CodeGear RAD Studio

    [Delphi 2007.dll]
    ReadOnlyData=bin\Package.ro.tvr
    Source=%ProgramFilesDir%\CodeGear\RAD Studio\5.0\bin\boreditu.dll

    The "problem" you fixed is that Explorer will try loading the whole .exe file in memory to show the icon, and with an .exe several hundred MBs it will fail. We trick it by storing the "bulk" of the information in a .dll or .bin or .dat or whatever non-exe file and then adding a smaller shortcut to Delphi 2007.exe, as per the Thinstall help section on this topic.

    - You can cleanup quite a few more entries in here, or just leave them with Disabled=1 so they won't have shortcuts created alongside with the main executable. I left the following entry points enabled:
    Check for Updates, Delphi 2007, RAD Studio Command Prompt, RAD Studio Documentation, Rave Reports.
  9. You may want to find and delete all the "Icon=" lines as they force some applications to use an icon stored in an MSI instead of the one in the EXE and deleting the Install cache will get rid of the icons.
    [EDIT]In order to keep the RAD Studio Command Prompt and the Documentation icons, move those two *.ICO files elsewhere or copy them from the "full" version if you have already deleted them from step 7 above and update the Icon= line accordingly. You can, for instance, name them RAD Studio Command Prompt.ico and Documentation.ico and place them straight in the project root directory so that it's clear what they're used for.
    [/EDIT]


  1. Also, while you're at it, check the lines with "Shortcuts=" (notice that it's PLURAL Shortcuts with an S at the end: not to be mistaken with the similar but different meaning option Shortcut!).
    In my install, I set all the shortcuts into a Thin\genre\app type of folder, for instance, I use Shortcuts=%Programs%\Thin\Dev\Delphi 2007, so that all shortcuts created (for the sections that don't have Disabled=1), will be stored in a Thin -> Dev -> "Delphi 2007" folder. (More on that on Part II).
  2. The speed problem seemed to go away as soon as the "main" executable file dropped in size: didn't test to see if it was related to being over 2 GB of uncompressed data or to having a few huge files in there, but it works ok in a 1.7 GB uncompressed version as well as in this 1 GB compressed one...
  3. Now you can re-build by simply invoking the batch again. On the same machine as above, and because Thinstall caches the files from the previous compilation, it took only 10 minutes to generate the brand new 1.032.472.412 bytes file. This means that, together with the few extra shortcuts or alternative entry points, it now uses up only 984 MB, so it perfectly fits on a 1 GB flash drive. (And we'll trim that further in Part II).

That's all for now. In Part II, we'll tweak a lot more by removing the .net related help content. I will also explain how to update your Thinstalled "Delphi 2007.exe" file so that you can incorporate patches, add/remove/update some components or simply modify default settings. Finally, I'll show you how easy it is to have the proper file type associations so that you can simply double-click an *.dpr file and open up your Thinstalled Delphi. Until then, get your own (30 day trial of Thinstall)* and start playing!

* EDIT: Thanks to Xsintill for pointing out the VMWare NorthStar beta (which is essential the full Thinstall project) but has two things better than the Thinstall trial: 1) lasts until 1st of June 2008 (roughly 70 days from now); 2) The whole registration process for the trial is automated and less restrictive in the choice of e-mails. So go grab that beta and start playing...

2007-12-10

Even slimmer Delphi for Win32 2007

Slim Following on previous posts, I decided to remove the Windows SDK documentation from my Delphi 2007 installation. The main drive was for the added space: with those 250 MB less I would be able to fit the whole C: into a compressed ghost image file with less than 2 GB and that's with Windows XP SP2 + Office 2003 + Delphi 2007 + quite a few more programs and updates.

Why is it so important to be < 2GB? Because I can easily upload that single file to any FTP server without worrying about the server or client being unable to FTP files bigger than 2GB; because I can copy that to any disk partition/external drive without worrying about the 2GB FAT 32 limit; because it's a single file to keep track of, without risking to have no backup at all just because somehow one of the multi-part files didn't get copied for whatever reason and finally, because I can now fit the file into a 2 GB usb flash drive.

So, rather than just delete the files, I decided to check out the Help registration files and modify them as well. I needed to modify 3 files: h2reg.ini, Master.HxT and RADStudioFilter.xml (get all 3 from here).

What did I gain?

  1. 250 MB less of disk space;
  2. Going from 14 to 4 seconds on the first help call of each session;
  3. Getting less extraneous results;
  4. Being able to now fit my whole C: drive onto a single < 2GB file.

What did I loose?

  1. Basically, the Dinkumware, C++, Delphi.NET and Windows Platform SDK help.

Of these, the most "troublesome" will be the PSDK, but that can be easily accessed online directly from MSDN Library, and has the advantage of being more up to date...

How did I do it:

  1. Go into your "%ProgramFiles%\CodeGear\RAD Studio\5.0\Help\Doc" folder;
  2. h2reg -u
  3. copy the supplied files over the ones with the same name there;
  4. h2reg -r (or run the install_and_view.cmd file that is already there)

Now you can delete the PSDK and Dinkumware folders.

If you want to "play safe", backup the whole DOC folder to a CD or external drive, should you want to go back. To undo, h2reg -u, replace the folder, run the install_and_view.cmd.

BTW: disregarding the .NET pre-reqs, Delphi 2007 for Win32 uses around 400 MB of my disk space now, which is just about right for me!

Get rid of another 343 MB...

If you installed the Help Update, be aware that you now have an extra cached (yes, duplicate!) 343 MB worth of data in C:\Documents and Settings\All Users\Application Data\{15EDF4CD-698A-4E52-8278-2E25143AD95B} (change to wherever you have your user profiles and I don't know where that is in Vista, but if you scan your HDD for the folder named {15EDF4CD-698A-4E52-8278-2E25143AD95B}, you should find out easy!

Yep, that's CG again thinking that they ought to know better than us, developers, and treating us like "dumb users" and caching stuff without even asking for our consent...

343MB

For those thinking "when will this guy stop complaining about this?": you know the answer! When CG stops DOING it! :) I can understand some lack of choices for "normal" software, where the users may need to be protected of themselves, but as a developer, I like to be in control of my machine, rather than have it control me, or in this case, rather than have software waste disk space for no good reason other than because someone was lazy when creating the installer...

Sure, disk space is cheap, but what happens when you try to BACKUP that "cheap" disk space? You're left with no other choice than backing up to ANOTHER disk which has huge drawbacks such as now allowing you to (easily) keep a backup outside your installation so you can quickly recover from a building fire or something... And most 1-man shops just can't afford a fire-proof vault that can keep data backups safe because those things are just too expensive, not to mention bulky and heavy...

EDIT (for those that don't read the comments!): Chris Pattinson, from CodeGear, warns about not being able to run future help patches and needing a full re-install should you delete this folder, so, you can do two things if you still need the space:

1) Back up the folder to a CD/other disk prior to removing it;

2) If you have already deleted the folder, simply install on a Virtual Machine and copy the folder from there. Or, should you have multiple machines with Delphi 2007, just copy the folder from another one. As long as it's added to the same place, you should be fine.

2007-11-29

Delphi 2007 SP3 - Some quirks

On my Help Tests, I ran around some minor quirks and I decided to blog about them as well! (Whoa: 3 whole posts in one day? Don't worry, that's probably 3 more months without posting so you'll have enough time to recover!)

Don't get me wrong, these are minor quirks, but it's also the 4th release of Delphi 2007 for Win32 (Release, SP1, SP2, SP3), so these should have been caught and dealt with by now, unless the quality control processes are seriously flawed... And before someone else goes "Oh, but the product is VERY good if this is all you can say about it", let me just point out that, no, this is not all (I've placed over 40 QC reports back when I did care about doing it), these are just those that immediately jump on you seconds after you start using the product, which doesn't give a good idea about the overall product quality... First impressions usually take longer to disappear...

1) Even selecting "Just me", the shortcut for the RAD Studio Documentation is installed for All Users.

In all honesty, I can't say whether this is a bug from the default SP3 install or caused by the Help Update. In either case, it should have been child's play to both detect and fix this, so there's no real excuse for letting something as simple as this slip through...

2) Minor toolbar sizing errors:
Toolbars

3) Personality Icon not showing (it appears to show only when a project is loaded, which is a bit odd for a single personality product)
Personality

4) Help Improve Visual Studio. WHY? If you buy a Volvo, will you get a form to fill out and return to FORD about how pleased you are with their engine? It doesn't make sense and for a team of developers, it shouldn't be hard to determine what registry key is needed to stop that from showing. Creates a wrong impression, when one does NOT buy Visual Studio and instead opts for buying a CodeGear product and then sees that "Help Improve Visual Studio"!

5) What's with this dull launch screen? So much space and the only thing that changes is a couple lines at the bottom? I used to like the previous launch screen better. Maybe it gets "filled" when you have some optional dotNET "modules", but as it is, it's plain dull...

Dull

Like I said above, all minor quirks, but also all first wrong impressions with a product...

Delphi 2007 Improved Help (?)

If you recall from previous posts (yes, I know it has been a while, but I've been busy!), I was frankly disappointed at the so-called "Improved Help".

The major flaws

Back on release of Delphi 2007 for Win32, the major flaws I found were the following (listed in no particular order, but numbered for easier reference):

  1. Crashing the IDE when requesting help on a menu;
  2. Failing to retrieve help for common Pascal/Delphi keywords;
  3. Giving "precedence" in searches to results pertaining to VB, VC++, Anything else under the moon and, in the last spot, Delphi;
  4. Taking up a huge amount of space with non Delphi for Win32 help contents;
  5. Using an Help engine that would consistently remain in memory leaking resources;
  6. Failure to retrieve help for components in forms or giving too many pointless options to choose from;

What has changed on SP3

#1 was solved with SP1, IIRC;

Help on End#2 Simple test program loaded from the demo ones. Pressed help on unit, interface, uses. All of these would pop a few options to choose from, but among those was the "correct" one. Then press F1 over type: only two options given and neither very useful... Class, procedure: again a few choices; private: a few choices too and among them the "good" one, but the one that I clicked first because it looked as the most promising, took me instead to the C++ reference section. No, that's not C++.net, but rather RAD Studio C++ reference. Odd for a "Delphi for Win32" product. Yes, I know that they have common bases for all their products, but that's THEIR choice and US, END-USERS, should NOT be bothered with that. If I'm programming in Delphi (Pascal), I should NOT need C++ help on my system and certainly not being offered that help when I press F1 on a Delphi keyword... The image on the right shows a list of the choices given when pressing F1 on end (but a similar one shows up for begin as well)...

#3 From the tests above, it appears that this has been nicely worked out: many VC++, VB or J# entries still show up, but usually towards the END of the list, rather than being at the top of it.

#4 remains the same and I don't expect it to change seeing that it's a common base for their Win32+dotNET products;

#5 I couldn't get a single DEXPLORER instance to stay in memory. Maybe the conditions that cause that are rather peculiar, but in all the open/closes I did, not once did I see it left or even another instance being loaded while another one was already in memory.

#6 I had to try REALLY hard to find a component that would not get me to that component's reference help. Almost every single component, from those in a form, to even those in the component selector, got me to the proper page after pressing F1 with no further questions asked.

Conclusions

1) Definitely a much welcome improvement, but still needs a lot of work. It's sad that 9 months after the initial release that touted "Improved Help" as one of the key factors for purchasing the new version, it still fails to live to that promise. Maybe by the time they get to Delphi 2008 the help is then at the standards they said it was back on release of Delphi 2007. Let's just hope they keep improving it, because it certainly looks as they still have a lot of work to do, but as long as they keep doing it, maybe in the future we will get a decent help!

2) There are still quite a few "place-holders" like the one in this example:
Place Holder

3) I was, towards the end of my tests, prompted with this:
Local Help

I opted to use Local Help as the primary source and haven't tested with the default option given as shown above. Seemed to work pretty much the same but only did a few more tests.

Delphi 2007 for Win32 SP3

This week I've been a bit sick. Nothing serious, just a nasty cold with the nasty side effect of going through paper tissues like there was no tomorrow.

So, rather than trying really hard to stay focused on debugging tasks at hand when I had to interrupt every 30 seconds to wipe my nose, I decided it was about time to do something I've been wanting to do for a long time and just couldn't afford the time to do it: upgrade my Delphi 2007 SP1 with both the SP3 and the improved help files that were released after that. That's something that doesn't require much concentration and is "compatible" with using paper tissues every 30 seconds...

So, I start by going to the Delphi registered user's downloads and download two files:

Armed with those files, I reset my computer to a ghost file with nothing but Windows XP SP2 + patches + drivers. After a few hours of installing more patches and all the software I use *except* Delphi (a process that is now much faster as I keep many utilities pre-installed on my D:\Utils folder), it was time to tackle the main procedure: Install Delphi 2007 SP3.

So, I start by creating a new ghost image to have a more recent "fall-back" should something fail, and I mount the ISO on a Virtual CloneDrive.

My first impression is not good when I double-click the drive:

Error01 Error02 Error03

I then proceed to open the drive instead and manually click the install file which brings me to this:

InstallLauncher

Pre-Reqs

Pre-Reqs Disk Space From this point on, everything runs much smoother: I proceed to install the pre-reqs, which I intentionally had not installed before, and then a reboot is in order.

The pre-reqs took an astonishing 2 GB of my C: drive as you can see from the image on the left. After closer scrutiny, you can easily see that it still suffers from the same "bugs" as the original install, namely, caching the same install files in several different places. That's 1.1 GB worth of .NET SDK install files in those two folders marked in the image.

This whole process did complete without any problems and within approximately 10 minutes, after which I had to reboot to proceed with the install.

 

 

Install

Delphi Disk Space Then, on to installing Delphi 2007 for Win32 SP3. After inputting my registration data, I selected to install everything available to my PRO SKU, including Rave Reports. The whole process took around 15 minutes and again proceeded with no problems.

As you can see, Delphi itself, discounting the pre-reqs, requires around 1.5 GB in the Professional Win32 SKU. That's roughly 450 MB for cached install files, 340 MB for help files and 690 MB for CodeGear files in either the program folder or common files.

I could have ran the IDE, but instead I opted for installing the Help Update. The one minor quirk about it, is that you need to go to a command line and type HelpSetup /upgrade. But the upgrade ran smoothly and this time I didn't time it, but it was around 10 or 15 minutes. Not worth another space screenshot as it only differed in a couple MB.

 

Full space report

Full  Disk Space To the left you can find a FULL disk space report before installing even the pre-reqs and after installing Delphi and the help update. As you can see, that's 3.7 GB worth of stuff, from pre-reqs to cached files to more cached files to the proper program files. Not really an improvement over the original setup, IIRC... However, since I believed that at least 1.1 GB of this can be safely shaved, that's what I'll did next. So, I removed the first of the two folders marked in the Pre-Reqs image above and was surprised to find out that the 2nd one was no longer there. However, the total space used was not consistent with that 2nd folder being removed, so after a quick search, I found out that it had been instead moved into my own Local Settings rather than the All Users' one. That's consistent with the choice I was given of installing for myself only (which I chose), or installing for all users. So, I deleted that 2nd folder and then ran Windows Update to download the latest .NET 2 security updates. As expected, it worked flawlessly, and I don't expect to be running into problems by not having those files around.  Of course, Windows Update doesn't update the SDK itself, so this was not a big test. But if you want to play safe, just burn those two folders to a DVD should they be required at some upgrade point in the future...

So, the (current) final space used is down to 2.5 GB, but that's without having yet followed my own guide on how to trim some more MBs out of it. That's intentional, as I want to test the help file and see if it has been REALLY improved without using my own tweaks. That will be the subject of my next post which should be posted either later today or tomorrow, if all goes as planned.

Conclusion

The whole process ran very smoothly, even if CodeGear still thinks that, just because disk space is cheap, they can waste as much as they want. Sure, disk space IS cheap, but if you want to create a ghost image of your main working drive and burn that to a DVD, having 2 GB worth of data or having 2 GB worth of data + 2 GB of worthless cached files DOES make a big difference in making it all fit onto a DVD or not. The way I do it, if anything other than an hardware failure goes very wrong, I can be up and running with a working configuration by popping a DVD into my drive and restoring my system to a full working condition in under 20 minutes, instead of re-installing everything for the better part of 1 or 2 days. The same problem applies to creating and backing up a Virtual Machine with a full working install, so, please CodeGear, stop wasting one's disk space just because it's "apparently" cheap!

2007-07-14

Delphi "killed" by VB6? WTF?

Well, I read in TWM's blog that Delphi is listed in the 12 languages that never took off.

Since I can't comment on either page, I decided to comment in my blog...

I can only say one thing: that article reminds one of the languages mentioned in it (the one that starts with brain...); that article is surely someone's brain fart!

Saying that VB6 killed Delphi and showing a stupid piece of partial code as if it's a "hello world" program???

And for those that would accuse me of attacking that article because I'm a Delphi fan-boy: just read my blogs here and you'll know that I'm everything but a fan-boy!

But I also don't like to see some moron (sorry, but can't help to use that word), say such things about Delphi.

Is that guy getting paid from MSFT or something? Or is he just a dumb arse?

[Edit:]

I've since gone to digg.com and checked out who blogged about that digg among other things: it turns out that my impression that digg was just full of meaningless trash is correct! Of those that "blogged" about that digg, nearly all are non-related commercial sites of some sort that are probably just using some robot-like technology to crank up their site in the listings!

Now, I already thought that digg was a waste of time but now I know for sure that it is really a waste of time! At least that dumb article had some usefulness! :)

2007-07-10

Quick tip for compiling/testing DLLs

Now that Delphi 2007 is using MSBuild, you can take advantage of the Pre-Build events to automate a common headache: killing that task that is using your DLL before you build it!

I'm currently developing an Outlook add-in so I found myself repeatedly quitting Outlook or getting an error because Delphi can't generate the DLL if I don't close Outlook, so, to solve that, and since, for some weird reason, I got used to always build instead of compiling, I just added the following command to this project's Pre-Build Events:

taskkill /F /IM outlook.exe

DIR >NUL

And that's all there is to it. You can also launch outlook after the build so as to immediately test your changes by adding the proper command to the Post-Build events, but I didn't add that as sometimes I do a few builds just to check syntax/compiler errors while I'm still working on something and I don't want to have outlook popup everytime...

Also, you can try without /F (force) and if your outlook or dll host can terminate gracefully in a speedy way you won't need to force termination, but in my PC and with Outlook it doesn't quit that fast, so I need the /F...

EDIT: The DIR >NUL command is just so that, should you not currently have outlook running, the error from taskkill won't stop your build process! :)

BTW: you can achieve something similar in BDS 2006 (and maybe 2005: haven't tested on this one), if you read my blog post about adding pre/post build events to BDS 2006...

2007-07-06

Bugsie - Part 2

In my previous post, I mentioned a minor layout bug that I watched during the CodeRage Encore presentations. I can now consistently replicate it but other people have mixed success depending on what system they use. Here are the necessary steps to reproduce that show that it is in fact a question of the IDE not redrawing the gray/black corner handles.

  1. File -> New Form
  2. Add 2 buttons to the form such that they're not aligned
  3. Drag a selection rectangle and note which button has darker corner handles
  4. Right-Click the other button, that is, the one with the lighter corners
  5. Select Position -> Align -> Cancel
  6. At this point, if the bug happens on your system, the corner grabbing rectangles should not have changed colors, i.e., the button with the darker corners is still the same
  7. If step 6 happens on your system, then click the Align Tops on the Align toolbar and see that the anchor button was the wrong button!

Now, I said that you could see that it was a display issue. Here's how to do that:

  1. Repeat steps 1-5 on the above list
  2. If, after step 5, you can confirm that the button corner handles haven't changed color, i.e., bug is happening, then simply open up something that will cover the form so as to force Delphi to later redraw it (Internet Explorer, FireFox, Explorer, Outlook, etc)
  3. When you move that window away (or switch back to Delphi), you will see that the darker corners are now properly displayed.

Here's the QC report created on this one:

Report No: 48631          Status: Reported
Form designer may fail to correctly update changed anchors
http://qc.codegear.com/wc/qcmain.aspx?d=48631

BTW, if you need more information on the black/gray corner handles, check this post from Steve Trefethen...

2007-07-05

Can you confirm this bug?

Well, 3 months ago, when watching one of the CodeRage Encore presentations, I witnessed a bug in action (more on that sooner!); even though I tried (as you can see in the replay), I couldn't get the presenter to replicate the bug. Now that the replays are finally available and now that I know how to skip so as to quickly find out which presentation and at what point it was (3 months make you forget a lot of stuff, especially when you were thinking the replays would be on after a week or so!), I've finally confirmed that I did indeed saw a bug.

Can you please go here, wait for the video to fully stream (progress bar fully light gray) and then position a few seconds before 06:38 where the bug happens and confirm that it is indeed a bug? I'll report it in QC as soon as I get some 3rd party confirmation on that.

Here's the bug: if you notice in that presentation, there are 3 buttons selected; the middle button has darker corners meaning that it's the button that is used to "control" the action, that is, whatever you choose it relates to that button. Notice that, when selecting the "Align top" the 3 buttons are (incorrectly!) aligned to the first button's top and not to the one with the darker corners. (Watch the video from the start for the explanation on the dark corners). [Edit: the dark corners are either explained elsewhere or later in the video, not before!]

If you can confirm what I saw, then please leave a comment here.

(CodeGear should probably hire me for finding bugs for them, but since I do it for free anyway, I don't think they want to! :))

[EDIT:]

Actually, at first, after making this blog post, I thought it could be some Camtasia bug as I could not reproduce it (as I right-clicked the top-left button it was selected); I have however been able to replicate it afterwards!

Here are the full steps:

1) File->New Form
2) Double click 3 times on TButton
3) Grab button 3 to top left
4) Grab button 2 to mid right
5) Drag a selection box from upper-left to lower-right

At this point, Button 1 is selected;

6) Right-click Button 3
7) Choose Position->Align from the menu and Cancel

At this point, Button 1 still appears to be selected.

8) Click on Align Tops in the Align toolbar and get the wrong behavior doing the align with Button 3 instead.

It appears that Button 3 was in fact selected by right-clicking and that the designer didn't redraw to show that.

BTW: Using Delphi 2007 SP1 on Windows XP with theming active.

2007-06-28

CodeGear Encore - The (non) Replays

As you may have noticed, CodeGear finally placed the replays online. Well, I'm not even going to mention that the initial plan was to have those available only to registered Delphi Customers as it was in those terms that the event took place... (Well, it seems I did mention it, but I have no problem that it's available for everyone!)

What I'm complaining here is about the lousy job done that took them 3 whole months to do!

Sure, I know that CodeGear has been busy but did they really need 3 whole months between the CodeRage Encore event and this (let's be nice) publishing of the sessions?

I mean: where are the download links? Only choice is to view online. But much worst than that, try and position the video replay cursor somewhere in the timeline: it will never be where you put it, thus completely preventing you from skimming those contents...

Three months ago, when the event took place, I saw what looked like a bug; I tried to get the presenter to repeat the steps but that didn't seem to reproduce the bug; since we had already been promised the replays before the event started, I didn't worry too much. I though: I'll wait for the replays and try and see if I did really see a bug in action and if true, I'll report it, if not, no further action will be needed.

Well, never in a million lifetimes would I think that publishing those replays would take 3 whole months and, worst, that after those 90 days, the job would still be done in a very amateurishly way...

CodeGear, this is not the way to tell us customers that one of your goals is quality: doing a bad service and taking so long to do it so bad is not what I or many others would call quality...

BTW: Should the responsible at CG want to at least fix the skimming bit, it has to do with the many files that Camtasia uses and the different ways of indicating the video size: you can't re-use them for other presentations unless they have the exact same duration, otherwise you'll end up in the mess you have managed to do...

2007-06-15

Developing Office Add-ins the Easy Way - Part 3 of 2 (AKA: Yes, I do know how to count!)

Well, even though it's probably not the best use for my time judging from the overwhelming feedback I got on the previous 2 parts, it also doesn't take me that long to write this 3rd part of 2 so I'll do it anyway! :)

I've fixed most (all?) of the blogger screw-ups with the formatting of my post and some incorrect color coding from using Steve Trefethen's Syntax Highliting page, and now I decided to add a couple files for easier download. Here you can find the zip file with nothing but the source code and the Extended Mapi units, and here you can find a nice setup made with InnoSetup in a few minutes that will install the compiled add-in, register it, create a source subfolder with the source code in it and allow you to uninstall all this at any time should you want to. Just remember that you need to restart Outlook to have it acknowledge the newly installed add-in.

Because I know that Blogger will again mess up my formating, I'm instead placing here a prt-scr of the InnoSetup script used for creating the installer: most of it was done through the wizard...

Inno

On a different note, Part 3 of Delphi in a Radical Build will be postponed for a while: my available time has dropped considerably and whenever I pick up on that 3rd part I'll have to redo the 1st two parts as I've recently had some data loss while trying to repartition my external HDD using a re-partitioning utility that had not let me down before... So, the amount of work involved in creating that part 3 of 3 would largely surpass my free time for a lot longer. Not all is lost however as at least I can read my own articles and recreate it: that's one nice side-effect of blogging about something! :)

On another different note, is it my impression or the Windows Live Writer beta 2 (which I installed after finishing the previous 2 posts), lost the spell checker?? I could swear there was an option to spell check in the previous beta!

2007-06-14

Developing Office Add-ins the Easy Way - Part 2 of 2 (AKA: The tutorial stuff...)

If you haven't read Part 1, I'd advise you to do so. In it you'll find some more information on these components and, more importantly, your 20% discount coupon redeemable until the end of June 2007...

Step 1: Running the new Add-In Wizard

  1. Fire up Delphi and choose File->New->Other, Delphi Projects->Add-In Express VCL->ADX Outlook Add-in.
  2. Click Next and, for the project name, I'm using Insider and coInsider for the coClass Name. The first is used, guess what?, for the Project's name and the 2nd is used in Outlook's COM Addins dialog (Tools->Options->Other->Advanced Options)
  3. Clicking next will show you the "Option Pages" step which is optional.
    • For this addin we'll just hit next again. For a more complex add-in, this would be where you'd create your own option pages. You can have option pages displayed as another tab on the Options dialog or by right-clicking all or some folders in outlook, say one for Inbox, other for Outbox: they are different types of dialogs serving different purposes and you can add as many as you like.
  4. Hit next again and we'll be in the "Outlook 2007 Task Panes"; again, not of interest to us here so move along.
  5. Click Next, Finish and we're done here.

Step 1.5: More blah, blah, blah...

We now have a basic project that we'll add some meat to in order for it to do what we set out to. We could easily add an explorer or inspector command bar, but we don't need them for this project. An explorer command bar is one that is displayed on Outlook; an inspector command bar is displayed when you double-click some outlook item and "inspect" it in it's own window. Say, when you double click an e-mail message and another window pops up. You can have the inspector command bars only display for certain types of folders by simply setting a property, say, create an e-mail inspector bar that is displayed only when inspecting a mail message but not when viewing an appointment. And, of course, you can add as many as you want and add buttons, menus and other controls to them at will.

Among other cool objects you can use (not needed for this add-in), are the TADX<AppNameHere>AppEvents, such as TADXOutlookAppEvents from where you can add your own handlers. Here's the list of OutlookAppEvents (these are global events: other components have their own events as well, but these are events that don't relate to a particular button being pressed or hotkey being used):

  • OnItemSend
  • OnNewMail
  • OnNewMailEx
  • OnQuit
  • OnReminderFire
  • OnStartup

BTW: Thanks to blogger messing up my formatting big-time, I had to shorten the list to just a few sample items so as not to have a whole lot of space wasted. Maybe I'll take a prt-scr later and update this...

Step 2: Adding some components and code

  1. What we are now going to add is an "ADX Outlook Form" which is a small pane where we will be displaying the headers of the selected message, so go to File->New->Other, Delphi Projects->Add-In Express VCL and double click "ADX Outlook Form".
  2. Save the form (I used uHeader for the unit name).
  3. Add a TListBox, call it lbxHeader and set it to fill the form.
  4. We need another component to control creation of these panes. Go on to the main project form (should be empty) and add a "TadxOlFormsManager".
  5. In this component's events, add the following code to the "OnADXBeforeFormInstanceCreateEx" event:
    1 if args.FolderObj.EntryID = OutboxEntryID then begin
    2 args.Cancel := true;
    3 end;
  6. Let's add that OutboxEntryID as a protected property to the form (TAddInModule) of type string:
    1 property OutboxEntryID: string read FOutboxEntryID;
  7. And the corresponding internal field to the private section of TAddInModule:
    1 FOutboxEntryID: string;
  8. And a method to set the value in the protected section (not a setter method though!):
       1 procedure SetOutboxEntryID;
      2
      3 procedure TAddInModule.SetOutboxEntryID;
      4 var
      5 nameSpace : Outlook2000.NameSpace;
      6 outboxFolder: Outlook2000.MAPIFolder;
      7 begin
      8 try
      9 nameSpace := OutlookApp .GetNamespace ( 'MAPI' );
      10 outboxFolder := nameSpace .GetDefaultFolder( olFolderOutbox );
      11 FOutboxEntryID := outboxFolder.EntryID;
      12 finally
      13 nameSpace := nil;
      14 outboxFolder := nil;
      15 end;
      16 end;
    • Now click the form and enter the following code to it's "OnAddInInitialize" event:
      1 SetOutboxEntryID();
    • Finally, let's give the TadxOlFormsManager something to manage: double click it and add a new item. Set the following properties for that item:
      1. ExplorerItemTypes->expMailItem, set to True as we want this form displayed on mail folders only; leave all others to false.
      2. ExplorerLayout set to elTopSubpane; (you can play around with it later if you want!)
      3. And finally, let's link it to the form we created above: set FormClassName to our form created above. It will be available on the drop down as soon as you go into File->Use Unit and select our uHeader unit.

    If you build the project, register it and launch outlook, you'll see a blank new pane displayed: Sorry for the large, dimmed and blurred image: it's from my main outlook... :)

    Also, if you notice, so far most of the code was related to adding an exception, that is, we wanted our form to display on mail folders, unless that folder is Outbox.

    Now it's time to add our real meat into this.

    Step 3: Adding our application logic

    1. Lets go back to our uHeader unit and add the following code to the onADXSelectionChange event:
       1 procedure TfrmHeader.adxOlFormADXSelectionChange( Sender: TObject );
      2 var
      3 Selection: Outlook2000.Selection;
      4 IMail : _MailItem;
      5 IMessage : MAPIDefs.IMessage;
      6 PropValue: PSPropValue;
      7 begin
      8 lbxHeader.Items.Clear;
      9 Selection := Self.ExplorerObj.Selection;
      10 IMail := nil;
      11 if Selection.Count > 0 then begin
      12 try // Try for a "normal" mail item
      13 Selection.Item(1).QueryInterface( IID__MailItem, IMail );
      14 if not Assigned( IMail ) then begin
      15 // If it failed, try for a Read/Delivery Receipt item
      16 Selection.Item(1).QueryInterface( IID__ReportItem, IMail );
      17 end;
      18 if not Assigned( IMail ) then begin
      19 // I don't use Remote Mail, but for completeness this should be tested also...
      20 Selection.Item(1).QueryInterface( IID__RemoteItem, IMail );
      21 end;
      22 except// Ignore exceptions
      23 // QueryInterface may throw up an exception, but I don't recall under what condition it was
      24 // It was for some non->relevant item, i.e., one that we're not processing here
      25 // That's the bad thing of writing something and not documenting it properly when it happens!
      26 end;
      27 if Assigned(IMail) then begin
      28 try
      29 if IMail.Sent then begin
      30 IMail.MAPIOBJECT.QueryInterface(MapiDefs.IMessage, IMessage);
      31 if Assigned(IMessage) then begin
      32 try
      33 PropValue := nil;
      34 if HrGetOneProp(IMessage, PR_TRANSPORT_MESSAGE_HEADERS, PropValue) = S_OK then begin
      35 StringToList( PropValue^.Value.lpszA, lbxHeader.Items );
      36 end;
      37 finally
      38 MAPIFreeBuffer(PropValue);
      39 IMessage := nil;
      40 end;
      41 end;
      42 end;
      43 finally
      44 IMail := nil;
      45 end;
      46 end else begin // If no headers found...
      47 lbxHeader.Items.Add( 'This type of message does' );
      48 lbxHeader.Items.Add( 'not have mail headers' );
      49 end;
      50 end;
      51 end;
    2. Now let's add the MAPI units to our project and to the uses clause in this form:
      1 uses MapiDefs, MapiTags, MAPIUtil;
    3. Now all that is left is to add that StringToList function I used to process the semi-colon formatted mail headers into a more readable list:
       1 procedure StringToList( Str: string; lstResult: TStrings );
      2 // Convert a header string containing CR/LFs and TABs into
      3 // a stringlist where each new property starts on a new line
      4 var
      5 iPos : integer;
      6 const
      7 CRLF = #13#10;
      8 begin
      9 lstResult.Clear;
      10 iPos := Pos( CRLF, Str );
      11 while (iPos > 0) and (iPos < (Length( Str )-1) ) do begin
      12 // If the new line starts with a Space or Tab, it's a continuation line
      13 if (Str[iPos+2] = #9) or (Str[iPos+2] = #32) then begin
      14 Delete( Str, iPos, 2 );
      15 end else begin
      16 lstResult.Add( Copy( Str, 1, Pred(iPos) ) );
      17 Delete( Str, 1, Succ( iPos ) );
      18 end;
      19 iPos := Pos( CRLF, Str );
      20 end;
      21 end;

    And we're done!

    Just build again, and re-launch outlook and you'll have something like this:

    Final thoughts and notes:

    1. Don't forget that you can regsvr32 dlllname.dll or regsvr32 -u dllname.dll and any installer will do that for you if you mark the dll as self-registering.
    2. Don't forget that you'll need to close the application you're testing/compiling your add-in for, before you can compile it as the dll will be in use! :)
    3. If you look back, you'll see that you pratically never knew you were handling COM objects and that most of the code was for the application logic with part of the complexity in that arising from using Extended Mapi because Outlook's object model is a bit limited in some places... Creating Excel add-ins is even easier as you don't have to deal with Extended Mapi! ;) You will require some knowledge of the application's Object Model, but that comes out of the box in the form of some VBA help files that you can install with your Office.
    4. I didn't show in this simple demo two other easy to implement features, mostly out of lazyness: adding toolbars/buttons/menus and option pages. Trust me (or don't trust and instead try for yourself!): those are very easy to implement!
    5. Don't forget to take advantage of the 20% discount coupon (see Part 1), and have fun Developing Office Add-ins the Easy Way!
    6. Syntax highlighting done using Steve Trefethen's Syntax Highlighter and then manually tweaked the generated HTML to fix some coloring bugs.

    Developing Office Add-ins the Easy Way - Part 1 of 2 (AKA: Blah, Blah, Blah...)

    Well, I first started thinking of doing this post in April, then, earlier in May, I thought of contacting the component vendor asking them for a special discount coupon that I could give you, the reader of this blog. They promptly gave me one that was good until the end of May, but, as you may suspect by now, I didn't have the time to make the post. Well, things are a bit easier now with Windows Live Writer, so I'll try to make this post today (edit: I finished this several "todays" after starting!). (And don't worry, I talked with them and they extended the coupon's validity to the end of June!...)

    So, how does one create an Office Add-in the easy way? Well, you cheat! :)
    Actually, it's no more cheating than using database access components to access a, (you guessed!) database... I've been using AfalinaSoft's Add-In Express components in the last 18 months or so, and all I can say is that it's child's play doing any office Add-In development, be that Word, Excel, PowerPoint, Publisher, Visio, etc... I've created some Excel add-ins for my own use just because it was so easy to do them, rather than coding in VBScript! Outlook is very well represented in this lot with very cool features available for it as you'll see later in this post. Some new features added in the 2007 version allow you to add new form regions allowing you to create some great outlook add-ins with very little effort! (Note: that's 2007 version of the components, not of Office! All the features and the tutorial in the next part work the same from Office 2000 to 2007!)

    Today's Add-In (I don't imply I'll be adding more, but one never knows as it's really easy to do them!), is a small Outlook Add-in that will show a collapsible pane in the messages list to show you the full Internet headers of the selected e-mail. You can shrink/expand/collapse this pane at will and, due to the way things work in Outlook, it's available for all mail folders except the Outbox. I've had to explicitly exclude that one after I found out that, if I select a message pending delivery, it would cancel delivery of that message: kind of what happens if you double click a message in the outbox and don't hit send again. No big deal: after a mail to the excellent Afalina support, I had a simple way of excluding just that folder (or any other I could want to exclude).

    So, what do you gain by using Afalina's Add-In Express instead of doing it the hard way?

    1. A very well though out and tested component suite.
    2. You can easily follow a couple steps in a wizard, add a few lines of code and have an add-in ready in minutes, not hours.
    3. For the most part (there are a couple minor things to take into consideration), you get not to worry if your add-in is going to be used in Office 2000/XP/2003/2007 and wether or not those are running the default install or SP1 or SP2 or whatever.
    4. If you plan on going the .NET way in the future, they have the exact same components available for .NET.
    5. Deploying your add-in for non-.NET versions is easy: if you don't use packages, all get's compiled onto your main project (DLL), so it's a simple file to distribute/register/whatever.
    6. Many examples of different add-ins for different office applications are available.
    7. If you purchase the higher version (Premium), you get the full source code, including designers and wizards.
    8. Again, for the highest version you can even have instant messaging access to the developers; for other versions, normal e-mail and web-forum based support is provided and still they answer questions promptly.

    Now, before you read any further, I must point out three flaws of this component suite, even though they are minor flaws as I'll explain later:

    1. No trial version
    2. Requires Activation
    3. No help file

    Why do I say they are minor?

    1. You have a no questions asked 30 day money back guarantee (for the non-source versions) : I recommend you start with Standard version or Basic if you're on a short budget, and later, after you decide you will keep it, contact them for upgrade pricing for the source-code versions. I started with Basic myself, over 18 months ago, and have since upgraded to the Premium for the source code and added support.
    2. In the Premium version you get the whole source, even for the designers and wizards, so even if they somehow get out of business, you are not prevented from installing these components; also, you can install these on up to three machines, so you can install it on a Virtual Machine to have ready as a fallback procedure.
    3. They provide an easy to follow start up manual, they also provide both in the installer and in their website a plethora of demo add-ins, they have a very active and friendly forum, and tech support is among the best I've found for any component suite. In fact, should you get the Premium package, you can even contact them through instant messaging!

    As for the coupon code, if you purchase the Basic or Standard versions (no source code included), you can use this coupon for a 20% discount until the end of June 2007: ADFXM20

    Remember that, even using this coupon, you will still have the 30 days from date of purchase to return the product for the price paid should you not be happy with it.

    You will need the Standard version if you want to take advantage of the advanced forms feature as described in the next post. As for later, once you decide you want to keep these components and no longer need to take advantage of the money back guarantee, I'd recommend you to upgrade to either Pro or even better, Premium, not only for the full source code but also the added support. Contact them and they'll upgrade your license for the difference between the purchased and wanted versions.

    Now, with a very lengthy post already, it's time to start explaining how easy it is to create an outlook add-in to display the selected message's headers in another pane. When I started trying to create this demo application, I needed access to some message properties that I wasn't finding through the outlook object model, so I e-mailed them my question and very promptly (next day, IIRC), they sent me, not only the answer to my question, but a few Pascal units with the translated Extended MAPI and a sample project that addressed my problem! I received similar help from them later on when I couldn't find a way to exclude just one folder (outbox) from the folders where the add-in's pane would show and I mailed them the project with my question and they returned me the updated project with a few lines of code added and a short explanation of what was done. It's not as instant as a help file, but it sure is a lot more flexible!

    I was thinking of doing a Video, but not only I'm on a short budget now and the free solutions I tried didn't inspire me, but it's also easier to copy/paste this and print it out for reference, should you want to follow along!

    Part 2, which I'm writing right now, will be posted a few seconds after part one: I decided to split it so it's not such a big article and because you can thus print that 2nd part and use as a follow along should you want to try it out.

    2007-06-13

    Delphi 2007 Update - Take 3

    I wasn't very fond of InstallAware, not as it's used by the Delphi installer, but now I'm even lesser of a fan: so much bloat and so much file messing around from here to there back here then a new there... Is it really necessary? Can't the Delphi installer be a bit more (read: a LOT more!) streamlined?

    I've attempted to update my clean Delphi 2007 image and the process stalled. I read somewhere that some people achieved good results by disabling all their startup programs, only I will rather reformat my PC than I start disabling software just so I can upgrade or install something...

    Luckily, both in that clean Delphi VM and in my main machine, "upgrading" using the now available ISO image went just fine. And I say "upgrading" as it's really a complete uninstall followed by a new install, not really an update... The only good thing is that component registration is left intact so you don't need to re-install them all again.

    Well, after all that, all that was left was testing the update on the tweaked install that I've blogged about earlier. Even though my main dev machine is a variation of that setup, I wanted to test on the same configuration used for that article. Took me a while as I had to redo that image as I recently tried repartitioning my external HDD and good 'ol Murphy stepped in ruining everything in it, but eventually I found enough time to follow the step by step instructions on my own article and redo that image. Oddly enough, upgrading went fine when it had failed on the non-tweaked and clean VM! Just a couple notes for those updating that version:

    1. To be on the safe side, export HKCU\Software\Classes and HKCU\Software\Borland from the account used and import on the install user account;
    2. After the install is done, repeat those steps in the other direction
      (Note: I did it without using these steps and it appears to have worked fine, but if you want to be 100% sure, do these two operations as they won't take much time)

    Also, when asked for the missing files, be sure to enter the {ABE...} folder in the Install user's local settings\application data used for the original install. And don't check the "Clear cache" option!

    The installer works in very weird ways: first, a new GUID is used to cache the files ({2EB...}); then it clears almost everything from the old install cache ({ABE...}), leaving only around 60 MB there. In the end, it copies some files back there, so the end cache space used is around 420 MB in {ABE...} and 770 MB in {2EB...}. Which ones will it use when you use update 2? I have no idea!! Just guessing, and judging from the files and sizes, I'd say that the cached files are in {ABE...} and the uncompressed cached files are in {2EB...}. However, the Setup.exe and related files are together with the uncompressed files, so I really have no clue what the 7z files are needed for... Will all those files be sufficient to install on a new machine? I don't know nor have tested yet. Maybe later but no promises...

    If you really want to be on the safe side, I'd download the ISO since it's the option that installed fine for me in a couple tests where the update would fail. In that case, just click the option to delete the cache. Now, if CodeGear would smarten up a bit and use a decent installer...