Componentizing Winamp – Pt 2
In this post I’ll walk you through the first phases of componentizing an application, in our case we’re doing something easy and starting with Winamp. There are several flavors of Winamp, for simplicity sake I chose “Winamp – Lite”. The version number available at the time of the download is ver # 5.08e, the self extracting EXE name is “winamp508e_lite.exe” and the size of this package is 516KB uncompressed.
As you’ll see later, the repository will consist of 23 files (some you won’t want anyways, like the Uninstaller and it’s associated Lnk file). The size of the repository is 1.84MB uncompressed, 1.24MB compressed. It’s super light weight and hopefully will have minimal dependencies.
However, small apps can still have big dependencies, imagine if it was written in managed code, then we’d have to bring in the entire .Net Framework, so in some cases, application size can be deceiving with respect to it’s dependencies.
The basic steps involved in this endeavor are:
1. Install a system monitoring utility (like InCtrl5 or Ashampoo’s Uninstaller or CleanSweep)
2. Download and install the application. The monitoring utility monitors changes.
3. Capture the change list from the monitoring utility. In my case, it scans all files and the hives before and after set points and diffs the two states.
4. Analyze the change list and add that information to the new component
5. Collect the files, add them to the component’s repository.
6. Analyze the static dependencies of the file resources and convert those to component dependencies
7. Import component and deploy a runtime with Winamp.
8. Wash hands, wipe on pants, repeat.
First I downloaded the utility to my main PC, this was a mistake right off the bat, I’ll explain in Pt 3 why. Why did I install the utility on my main PC? You’ll be doing this analysis on XP-Pro, not on a runtime. Your goal is to understand how Winamp interacts with Pro and represent that in your component.
Next I installed the Uninstaller utility from Ashampoo. I prefer this to InCtrl5 that a lot of people seem to prefer. I don’t know where to find InCtrl5 anymore, it used to be a free download from PC Magazine but I think they’re charging for it now or require registration to access it. This utility from Ashampoo used to be called EZClean, it’s similar to CleanSweep in that it monitors all reg and file activity on the system when you install applications and drivers. It’s used in place of the Windows feature called System Restore that allows you to revert the system to it’s original state if the app/driver caused the PC to become unreliable. Whichever utility you use doesn’t matter, the object here is to have a method of identifying all resource changes on the box.
Next step is to download Winamp, turn on the system monitoring utility then install the application. I recommend you continue monitoring the system after the setup is complete until you’ve launched the app the first time.
When you’ve verified the app launches and appears fine, turn off the monitoring utility so you’re no longer capturing information.
If you’ve never done this before, you’ll find that the utilities capture a lot more Windows activity than simply bin placing files and adding/changing reg keys. Windows is always doing something in the background, creating prefetch data, updating the MRU (‘most recently used’) list for Explorer, etc… So the sooner you turn off the utility after verifying the app runs, the less noise there’ll be in the log for you to sift through.
When I completed the monitoring process and generated a log of changes, everything appeared fine. 20+ files were placed in the Program Files\Winamp folders and subfolders and a Winamp.ini was dropped into the system32 folder. The registry keys weren’t too bad either (meaning there’s weren’t thousands of them!).
With my log I’m now ready to actually start creating a component. This is where I discovered my ‘rookie’ mistake and had to make some tweaks, but I'll discuss that tomorrow when I convert the log to an actual component definition file.
All in all the process to install the utility, turn it on, install Winamp Lite and capture the change log took less than 10 minutes.
- Andy
Comments
Anonymous
September 02, 2005
Over the Spring of '05, I posted a series of blog posts on the end to end process to componentize 3rd...Anonymous
April 10, 2009
(注:本文由 邹少颖 译自Andy Allred2005年的 英文博客系列之二 。如果你要查看中文版的系列之一,请查看 此处 .) 在这个帖子里,我会给您展示如何把应用程序组件化的第一阶段。我们可以从一些容易的实例开始,Anonymous
April 10, 2009
(注:本文由 邹少颖 译自Andy Allred2005年的 英文博客系列之二 。如果你要查看中文版的系列之一,请点击 此处 .) 在这个帖子里,我会给您展示如何把应用程序组件化的第一阶段。我们可以从一些容易的实例开始,Anonymous
April 10, 2009
PingBack from http://www.codedstyle.com/%e5%ba%94%e7%94%a8%e7%a8%8b%e5%ba%8f%e7%bb%84%e4%bb%b6%e5%8c%96%e7%b3%bb%e5%88%97-%ef%bc%88%e4%ba%8c%ef%bc%89-3/Anonymous
June 07, 2009
PingBack from http://greenteafatburner.info/story.php?id=4179