Total Pageviews

Disclaimer

This is a personal web page. The views expressed on this blog are mine and do not necessarily reflect the views of my current employer.

I am currently employed by Morgan Stanley.

August 31, 2007

Inno Setup and ISPP

Inno Setup provides 90% features you need to create a standard and powerful installer while 10% features you may want are missing. For me, I hate to hard code version strings in the script and update it several times.

And now I find Inno Setup Newsgroup and Inno Setup Extensions Wiki, so most problems can be solved following the tips.

ISPP is mentioned so many times by IS experts which means it is a "must have" tool. Yes, after reading about it I find most missing features of IS in this useful preprocessor.

Inno Setup can serve most people while only a few of them learn and use ISPP. For example, I've been using IS for a long time and finally decide to learn ISPP today.

Ribbon Everywhere?

Microsoft spends four years on Office 2007. Yes, four years is such a long time. However, what makes you WoW? Just Ribbon UI and XML file format are two important things I notice. Even though the new file format is not well treated by users, Ribbon UI has received a lot of reviews.

It is apparent that somebody loves it while others hate it. However, now Ribbon enters a new field Microsoft never imagines. The field is development tools.

If you know NDepend, a wonderful code analysis tool for .NET, you may see the coming version with Ribbon UI.

And if you try InstallAware, you see Ribbon too. It is surprising that InstallAware does not publish even a screen shot of the user interface on its web site. I notice this feature only after installing the tool.

Yesterday, when I read about MonoDevelop, I found that the guys might do a Ribbon UI in future versions too. Now GTK# Ribbon Library is nearly complete, so it is quite possible to see a Ribbon driven MD.

Will one day we see Delphi or Visual Studio with Ribbon? Wait and see.

August 28, 2007

Inno Setup Script Sample for Version Comparison

An important feature that Inno Setup fails to provide is to uninstall old versions before installing a new version. When I prepared Code Beautifier Collection 6.0 Milestone 3, I started to think about this feature. Luckily because I have experienced Pascal script already, I soon found a way.

Every installer place some information in your registry in order to display an item in your Control Panel's Add/Remove Programs. In your Inno Setup script under [Setup] section, you should specify AppVersion and AppID. For example,

As a result, some registry items are added.

So in [Code] section you can use Pascal script to do version string comparison to see if there is an older version.

Do something in InitializeSetup gives you a chance to exit the installation if necessary.

First, I try to see if CBC was installed. Using AppID makes thing easy.

Second, I read AppVersion from registry named 'DisplayVersion'.

Then, I compare the read result with current version, 6.0.0.1004.

At last, if there is a newer or the same version installed, exit. If an older version is there, uninstall it and continue to install this new version.

Because Inno Setup does not provide version string comparison function, I wrote customized code first in Delphi 2007 and then copied the code to Inno Setup script. This is an important thing, that you can debug the code in Delphi while you cannot debug it in Inno Setup,

These function should be placed at the beginning of [Code] section.

Currently, I do not know how to access AppID of [Setup] section in [Code] section, so all version strings are hard coded. Once I find a way to do so, those hard coded strings can be replaced.

In fact, I prefer Pascal script to MSIcode in InstallAware and I will continue using Inno Setup for CBC. Pascal programming has become part of my life.

Actually I tried to search on Google before actions, and the only useful entry returned from query is a post on AgileTrack Blog. however, that approach is a complicated approach. I believe my code is simpler and make full use of existing information in your registry. BTW, you can download the full iss file from http://code.google.com/p/lextudio/source/browse/trunk/trunk/setup/CBC2Exe.iss



[Update: You can find all my Inno Setup posts at http://www.lextm.com/search/label/Inno%20Setup]

Product Review: InstallAware

It is so common to distribute software as installers, that so many installation solutions are available in the market.

Even though I am just running a small open source project named Code Beautifier Collection, I have to make a good quality installer to please users.

Inno Setup

I have been using Inno Setup for a long time. Generally speaking, with help of Pascal Script support, I could do nearly everything in the installer to provide as many features as I can imagine.

However, it is not yet a perfect solution too. Its main disadvantages are,

  1. Inno Setup installers are Microsoft standard compliant. You should create MSI installers in order to pass the certifications.
  2. Inno Setup does not provide a powerful wizard to guide newbies. The learning curve is tough. That's why I spent so much time learning it.
  3. Pascal Script authoring is really hard and sometimes error prone. Usually I wrote the script in Delphi, test it and then copy back to Inno script file.

InstallAware Studio

When I install  InstallAware I soon understand why Marco Cantu find it professional.

I think Ribbon UI is cool but I prefer a VS-like UI.

Compared to Inno Setup, IA has some main advantages,

  1. IA creates standard MSI installers.
  2. IA allows you to work with wizards and with script based development simultaneously.
  3. MSIcode can be debugged within IA. This reminds of modern IDEs such as Delphi and C++Builder. Meanwhile, you do need to type MSIcode manually and every line is generated using a panel and wizard, so you can make fewer mistakes.

IA provides professional dialog templates, web deploy and other advanced features which I do not want to touch right now. They are cool, but maybe required only by large projects such as CodeGear Delphi and C++Builder.

In all, it is nice to have a copy of IA. It really reduces the complexity of creating a powerful installer.

August 26, 2007

GrapeVine Voice: Milestone 4 for Delphi 2007 Update 2

I've just notice Update 2 of Delphi 2007 and C++Builder 2007 does not update your Borland.Studio.ToolsAPI.dll. So the version number of it remains 11.0.5000.7128 which is just the same as Delphi 2007 Update 1 and C++Builder 2007.

As a result, M4 of GrapeVine is compiled against this version of ToolsAPI assembly. Although I do not have a test environment to test, I estimate that M4 should be able to load in Delphi 2007 Update 2. I believe it is good news for those who wanna have a try of Code Beautifier Collection with their new CodeGear IDE.

You can find the download at http://code.google.com/p/lextudio.

Stay tuned.

August 24, 2007

Eclipse Download Experience Changes

Maybe third party distributions finally hurt Eclipse Foundation a bit. Now when I try to download latest Eclipse, I find Europa, a bunch of official distribution packages.

I find the packages similar to EasyEclipse packages (EasyEclipse has more packages). And I can use FlashGet to speed up downloading because there is finally an HTTP mirror here in China.

I'd like to try Europa Eclipse IDE for C/C++ later because it is even smaller than EasyEclipse for C/C++. I believe it will be a better base for TeX development.

BTW, you'd better choose between Europa and EasyEclipse. While Europa is official, EasyEclipse does add a lot of useful plug ins in each distro in order to optimize your productivity which greatly save you a lot of time and energy from searching in the archive yourself. 

August 20, 2007

Product Review: Karvonite

NHibernate and ECO are huge library for enterprise usage. However, even if you are running a small application, object model persistence technique can save a lot of development time.

That is why Microsoft creates LINQ in .NET 3.5. However up-to-now, you cannot redistribute .NET 3.5 because it is a Beta. So try a nice third party product may be an alternative.

Why I chose Karvonite?

I downloaded Karvonite May Preview to see if it meets my requirement for CBC. In order to enhance PropertyRegistry unit I need some library who can persist collections. Basic classes in .NET framework fail to provide a solution.

BTW, Karvonite is free although not Free As the Freedom.

Manual And Sample

While I was still reading the manual, I found some information was missing. Yes, object library was mentioned several times but there was no line about how to create one.

It is normal because Karvonite is still a Preview, and the sample project illustrates so many aspects which is a good starting point.

Conclusion

I am sure that Karvonite can help to make CBC better manage preferences in collections form. The only shortage is that object library is not in XML format so manual editing is hard.

I have planned to use Karvonite in CBC GrapeVine but not yet decided in which Milestone version. It depends on when I could afford time and energy on this topic. I believe Karvonite can save me a lot of time later but now I have to master it before any further actions.

Thanks for creating this free library, AdventurerLand. Hope I can download the final version soon.

(Update: AdventurerLand may provide LINQ for Karvonite once .NET 3.5 is released. Good news.

And AdventurerLand is still a Borland/CodeGear Technology Partner. I guess it forgets to add a BTP banner on its homepage.

When I browse for AdventurerLand here, I find its registered product is Lab Technology.NET. You can see the description is valid for Karvonite. So I believe Karvonite is the "Lab Technology.NET". BTW, I think Karvonite is a better name.)

Windows Live Writer Special Tip

I cannot access my blogspot account at home. Yes, I cannot see my homepage, while I was about to log in and edit posts.

What does this mean? *.blogspot.com is now filtered out of my scope by my ISP. I do not know why.

In this case, I cannot publish posts in WLW at home. However, I keep using WLW at home. Why?

  1. I love to write in WLW. The user interface is much better than a web browser and extendible with a lot of nice plugins.
  2. Sometimes I find WLW generates more tidy code then Blogger default editor.
  3. I can copy the final result into my Blogger editor in a web browser and publish it there.

Because I cannot publish pictures to Blogger, I find this boring workaround sometimes useful. 

Unless there is another great post writer program for me to review, I'll bind to WLW for a while.

What is your favourite post writer?

August 18, 2007

GrapeVine Voice: Installation Experience (Part II)

For MSI installers, it seems easier to install for all users. I do not have time to study MSI, so I try to make something similar with Inno Setup.

Registry manipulation is an important issue here. At startup Delphi 2007 finds experts in registry under LocalMachine and CurrentUser branches. So if CBC is installed for all users, the expert registry entry must be placed under LocalMachine while for one user under CurrentUser.

However, Inno Setup does not support install for all users natively, which means the installer cannot copy preferences files into every users folders. Because Program Files and other common folders are now critical folders on Windows Vista, I make use of Delphi IDE so as to complete the installation which turns out to be an easy way out there.

And luckily I find out that I can divide the whole installation into two separable phases,

  1. Installer installs all files into Program Files, installs GAC assemblies, and creates a registry entry for CBC.
  2. When Delphi starts up and CBC is loaded into Delphi, CBC copies preferences files from Program Files to user's local folder.

In this way, I can finally make install for all users possible.

Actually that's why I add two installer helpers.

Phase 1

When you double click installer, in fact the installer only extract all files into Program Files folder. Then installforallusers.exe, a helper, is launched. You can then decide whether to install CBC for all users. If for all users, a registry entry is added to LocalMachine. Otherwise, the entry is added to CurrentUser.

Phase 2

When Delphi is fired, CBC should be loaded if a registry entry is there. If CBC is already installed, nothing would happen. If not, CBC copies preferences files into user' local folder by calling another helper, installforcurrentuser.exe.

In order to prevent double copy, a new registry entry is added under CurrentUser. The entry value is CBC version number. If a newer version of CBC is installed, preferences files will be updated because the registry entry value is lower than the just installed CBC.

Because it is hard to remove preferences files from local folders, I decide to leave them there.

Conclusion

I have to say I made a lot of changes in the installer of M3. Thanks for Tom's reports I fixed most bugs. If you meet bugs during installation, please contact me immediately.

How do you make installer? Use old-fashioned InstallShield or newly-available InstallAware or use other techniques? I'd like to know.

Product Review: BT Clients

I used BitComet for years. It runs well on Windows XP. Because it is written in C++ efficiency should be its advantage. However, it fails to run properly on Windows Vista. After so many hangs I gave it up.

Yes, FlashGet may be a new choice but I have experienced some hangs too. As a result, I'd like to try some Java product. Azureus is what I am using now.

The first look at Azureus is amazing. The UI is much more beautiful than BitComet. The performance is also great. No hangs occur any more.

I envy those BT client designers. Their products are usually so easy to use, so no manual is actually necessary.

BitTorrent is a nice creation for hosting very large files across the Internet. The misusage of this technique may fire many complaints but is there any technique free of misusage?

August 15, 2007

Windows Live Writer Plugins I Use

Windows Live Writer is a good pal for bloggers. As with some small plugins you could enjoy yourself more.

The following are plugins I use,

  1. Code Snippet - it provides professional formatting of your code. You can see what code I published in posts with Code Snippet.
  2. Insert a Smiley - it allows you add Yahoo! and Windows Live Spaces smiley into your blog. I am not a Smiley addict, so you see I use it sometimes, not always.

Yes, I'd like to try some others some time. What plugins do you use? You may leave a comment.

GrapeVine Voice: 360Safe Treats InDate As Spyware

It is occasional that I created InDate, auto update component of CBC. And the logic used in InDate is simple,

  1. download a package list from a fixed URL.
  2. analyze the list and find latest update.
  3. download the update and run the installer.

Is it similar to other update components in other products? I guess yes. Even some spyware follow these steps in order to install more spyware on your computer.

So if you find some anti-spyware on your computer treat InDate as a spyware, please be careful before removing it.

Luckily, even if you have removed InDate, you can still find latest update on Google Code Homepage.

GrapeVine Voice: M3 Bug or RAD Studio Bug

Tomasz Wawrzyniak (Dear Tom) has been talking with me about M3 installation issues these days. Thanks for his reports, I corrected M3 installer, and also find an important issue in BDS.exe fire again. 

You may have noticed while other Delphi experts, such as Castalia, GExperts, and CnPack Wizards, have different installers for different versions of Delphi, Code Beautifier Collection provides an installer for all Delphi versions. What is the reason? How can I make it?

In fact, there are two rules existing for years,

Rule I, Native

Most of Delphi experts are native experts. As a result, they must link to some IDE packages. Because of the incompatibilities of the packages across Delphi versions, there is no way to compile one version of experts for all Delphi versions. For example, you must compile CnPack Wizards against Delphi 7 packages in order to make an installer for Delphi 7.

If you need to compile against different versions, you have to make installers for different versions. That is the rule I.

Rule II, .NET

The rule for .NET expert, such as Sharp Builder Tools and Code Beautifier Collection is different. If you compile against latest Borland.Studio.ToolsAPI.dll, the expert can work even in old versions of RAD Studio.

CBC 5.3.3 can be installed for all BDS versions 1-4. That can be a good proof.

New Rules?

However, these rules are governed by Borland/CodeGear. So they can be changed without notice.

Now GrapeVine M3 cannot install correctly into Delphi 2007 because it is compiled against a newer version of Borland.Studio.ToolsAPI.dll.

I will contact CodeGear guys soon about this issue. Wish they could try their best to follow Rule II. If impossible, I will be forced to provide different installers, too.

August 13, 2007

GrapeVine Voice: M3 Installer Needs Another Update

According to bug report I received today from Dear Tom, I have updated M3 installer on Google Code.

Please first uninstall the 'old M3' and install this 'new M3' instead.

Sorry for the inconvenience.

(Update: It seems Tom still cannot install M3 correctly. So I decide to clean up my notebook so as to set up a test environment later this week. Please turn back to M2 installation if you could and wait till I test M3 installer completely.

Because now I have less time than usual on coding and testing, forgive me if I made silly mistakes. My intentions were good.)

Fighting With CodeGear Items on CC

Code Central is where most Delphi and C++Builder guys publish their creations. You can also find my items there.

I have to mention that if you do not update your item frequently, it will disappear soon from Recent Uploads list. That's why I keep updating CBC new versions there.

And what is interesting is that CodeGear starts to publish its old products and documents there in the latest months. As a result, I have to fight with CodeGear items for the first time. (Yes, it is fun.)

Look forward to more items from CodeGear at Code Central. Please add some fresh items, CG guys.

August 12, 2007

GrapeVine Voice: Installation Experience Changes (Part I)

I'd like to review some historical phases at first, (details can be found in docs/Readme.pdf)

Without An Installer

The first version of Code Beautifier Collection (named under JCFExpert) was released a long time ago. It was not included in an installer so manually installation is required.

It must be tough for users at that moment. They had to build the assemblies at first, then install it using SharpBuilderTools' Expert Manager.

So if you have chance to review that package, you will see JCFExpert bundles SharpBuilderTools 3.1. SBT, which is much larger than JCFExpert, is included only to install JCFExpert.

Simple Installer

2005-10-30 when I "Announce CBC 2.2 RC 1", I wrote a very simple installer myself to install CBC, so SharpBuilderTools Expert Manager was no longer bundled.

In fact what I wrote was something similar to an Expert Manager which is far from an installer. However, I had successfully reduced the package size.

Inno Setup Installers

On 2005-12-16 I started to write an installer with Inno Setup while I was learning it bit by bit. Yes, it is an amazing technology that changed CBC user experience a lot then. I could imagine why download counts increased after I shipped CBC as an installer.

And I added a few installation tasks version by version.

  1. On 2006-4-24 when I "Announce CBC 2 WalkPace Update 1 (5.0.1.1018)", installer was updated to create more menu items in Start Menu. So Mix for .NET menu items were added.
  2. Later I installed UnhandledExceptionManager into your GAC.
  3. Added installation helper executables both before installation (install.exe) and after installation (installforallusers.exe and installforcurrentuser.exe) in GrapeVine M3.
  4. Added pascal script to find and uninstall older installed versions automatically in GrapeVine M3.

And now the installer is much more powerful and feature complete.

In Part II, I will discuss about what big changes are made in GrapeVine M3 in order to make CBC install nearly perfectly on Windows Vista. Yes, it is a tough migration. Wish it helpful.

GrapeVine Voice: Milestone 3 Is Feature Complete

Code Beautifier Collection 6.0.0.1003 is now available on Google Code Homepage.

The following features are implemented or enhanced in this version,

  1. * Updated installation experience.
  2. * InDate is updated to download updates from Google Code Homepage.
  3. * All GForge links are now redirected to Google Code Homepage.
  4. + Compliant to Vista UAC rules.

You can download the installation file from here.

Documents will be updated in M4.

* This version is no longer a Preview. It can find later updates and works well with Vista UAC.

** Because only Delphi Code DOM is provided in RAD Studio, Source Navigator is not available for C++ and C#.

August 10, 2007

Alex: Source Code Checked In To CodePlex.com

I never tried CodePlex.com source control until today I checked in Alex 1.0 source code to it. Yes, using Teamprise Explorer is fun.

Now If you want to contribute to Alex, you can check out the code at CodePlex.com/alex.

GrapeVine: License Issues and Lextm Common Library

I decide to make a small change in CBC license. That is, LeXDK Core library should be under LGPL instead of GPL.

In this way, people can write closed-source Pluses for CBC from CBC 6.0 on. If you have done a new Plus, contact me so I can package it into next release of CBC. If you meet any problem using LeXDK, contact me so I can lend a hand.

Pluses I wrote are still under GPL including the Framework.

Why I make a change now? Yes, someone contacted me earlier this week and wanted to improve CBC, especially CodeBeautifiers Plus. I do not know what he/she may do in the future. Will there be another Plus or a new version of CodeBeautifiers Plus. The change of license can ensure if a new Plus is created, it can be under any license (GPL is one of the choices). It can be commercial, too.

I have reviewed Overseer and TraceTool. Yes, it is hard to decide which to use (because I still dream of a CodeSite copy). And what I can do now is to enhance Lextm.Diagnostics.LoggingService unit.

I want to imitate .NET Debug and Trace units, using Listener support. So I can implement a log4net listener, an overseer listener, and a TraceTool listener. And one day when I switch to CodeSite, I can implement a CodeSite listener then without heavily modification of existing code.

Why I do not prefer Microsoft Enterprise Library? You know I cannot use it because CBC is not an executable. I do not know how to configure bds.exe.config in order to make Enterprise Library working correctly.

Product Review: Teamprise and TFS

Microsoft is going to provide more collaboration utilities for its developers. Yes, at present we see SharePoint, and Team Foundation Server as two key products. I have been using SharePoint for a few months and it serves well. But I do not try TFS.

Team Foundation Server and Team Explorer 

In my point of view, TFS is an enterprise level alternative of Visual SourceSafe (sometimes Visual SourceDangerous). Because CodePlex.com is hosted on TFS, I believe TFS is much stabler than VSS.

If you are using TFS and Visual Studio non-Express version, you must try Team Explorer somehow. Yes, TE integrates into Visual Studio perfectly, which makes life much easier.

If you use TE already, you know it cannot be used outside Visual Studio. Yes, generally speaking, for Java, GCC, Delphi, Python, Perl, Ruby guys out there, they cannot use TE or TFS. What a pity! I not yet see some easy-to-use SCM GUI product on open source land.

Teamprise

Teamprise, who provides standalone Java client for TFS built on Eclipse RCP, becomes an important player here.

Yes, I am using Visual Studio Express, SharpDevelop, and CodeGear Delphi, but I can now use Teamprise Explorer to access CodePlex.com server easily. And after trying it for a few minutes I start to love it, which reminds of Borland's (original Starbase's) StarTeam, another great SCM product.

Conclusion

Why Microsoft does not provide a standalone client such as Teamprise Explorer? You know why, don't you?

By the way, you have to pay for Teamprise TFS clients, except that you use it to access CodePlex.com as I do. CodePlex authors can request a complimentary license code from Teamprise. You can find more information on CodePlex.com and Teamprise.com.

August 08, 2007

Arabic Review of CBC?

When I tried Google Blog Search Beta today, I found a thread mentioned CBC in Arabic language.

I could not read Arabic, but it seemed some guy compared CBC to Delphi Formatter Expert.

Can you read Arabic? The thread can be found at,

http://barnamenevis.org/forum/showthread.php?s=7789f7090704c6765e1faf46a38ed6a3&p=365526#post365526

August 06, 2007

HardQuery Report: How To Build It On Your Machine

If you master MSBuild, you can manually modified *.proj files in source package in order to build CBC successfully. If you are not familiar with MSBuild, please carefully follow the steps,

* Notice, please do not modify installation folders. My MSBuild scripts assume you install the tools to default folders.

Phase I:

  1. Install .NET Framework 2.0. It contains MSBuild, which is a build engine now pseudo standardized on Windows Platform.
  2. Install MSBee, which enables you build .NET 1.1 assemblies with MSBuild.

* If you have 1, and 2 installed, you can run make.debug.bat to test. Run ExpertManager.bat and add Lextm.CodeBeautifierCollection.Framework.dll to BDS 2006 Expert list, then you can see CBC loaded by BDS.

Phase II:

The following are tools you need to run make.all.bat.

  1. Install Sandcastle, which generates documentation for LeXDK.
  2. Install Sandcastle Help File Builder, which helps generate documentation.
  3. Install CTeX, which compiles documentation.
  4. Install Inno Setup, which generates the installer.
  5. Install MSBuild Community Tasks, which zips up packages.

The installer created in setup folder can be used to install CBC.

* If you build CBC on Vista, please run make.all.bat in an elevated command prompt.

Yes, I make use of a lot of Open Source projects or free tools. Thanks for all the authors.

If you have any questions or comments, feel free to leave a word here. I will update this article later.

(Updated: I did not release my public-private key file in the zip package, so you need to either manually remove Sign.cs from the projects or make a key file yourself.

You should try to build the solution file in SharpDevelop 2.2 before running make.*.bat to ensure that everything can be compiled without errors.)

August 05, 2007

Product Review: Visual C# 2008 Express Beta 2

I have to say after installing Visual C# 2008 Beta 2, Visual C# 2005 is useless. Why? Because I am using Vista Home Basic on which Visual C# 2008 performs better.

For example, Expert Manager in CBC needs elevation. In Visual C# 2005 I have to manually add a manifest file (using mt.exe in SDK). In Visual C# 2008, it is nearly automatically.

Compared to Visual C# 2005, Visual C# 2008 no longer needs elevation at startup (this is a nice change). And at this moment, I do not notice other improvements because I am working at Windows Forms, not AJAX, Silverlight, or WPF.

I have found some bug in Visual C# 2008 too. When you try to clean a project as usual, you found some .tmp files cannot be removed (UAC turned on). I guess they are generated by AutoRecover feature. Wish I can find a way to remove the files at last.

In all, Visual C# 2008 is better than Visual C# 2005.

(Updated: Yesterday when I powered on my computer, I found that I could use Clean task of *.sln file to remove those .tmp files. So I guess the rule is "you cannot delete them until you wake up tomorrow".

Now I turn off AutoRecover feature completely, and find no .tmp files any more. They are gone! at last!

Also it is fun to report bugs to Microsoft. Thanks to Scott, Omar, and DJ.)

(Updated Again: Even if I turned off AutoRecover, new temp files were still generated. Luckily, they did not prevent me from developing so I try my best to ignore their existence.)