Thursday, November 11, 2010

Technobrief #12

Summary: Recent findings of software, articles, and more.
CSS
Design
Firefox
  • InstantFirefox
    Add-on that enables instant (Chrome-like) search in Firefox.
  • Syphon
    Keeps your favorite extensions synced with all your computers.
Humor
  • Simplicity
    Great illustration of what a typical Apple product, Google interface and your company's application look like (funny, and so true).
Icons
  • 50 New Free High Quality Icons Sets
    Most of the listed freebies may be used for commercial projects as well, some of them may not.
  • Gcons
    Comprehensive collection of 100 creative, open source and multi-purpose icons in 12 colors for the web and desktop applications.
Interviews
  • John Sculley On Steve Jobs, The Full Interview Transcript
    Offers awesome insights into how Steve Jobs does things; it’s also one of the frankest CEO interviews you’ll ever read (Sculley talks openly about Jobs and Apple, admits it was a mistake to hire him to run the company and that he knows little about computers).
JavaScript
  • The Essentials of Writing High Quality JavaScript
    Stoyan Stefanov offers an excerpt of his book (JavaScript Patterns) detailing the essentials of writing high quality JavaScript, such as avoiding globals, using single var declarations, pre-caching length in loops, following coding conventions, and more. This excerpt also includes some habits not necessarily related to the code itself, but more about the overall code creation process, including writing API documentation, conducting peer reviews, and running JSLint.
jQuery
Opinions
  • Laborers versus Professionals
    Jan Van Ryswyck offers a frank look at typical corporate application development practices (fear-driven development!).
Software
  • Diffuse
    Tool for comparing and merging text files.
  • FotoMix
    Allows you to crop, resize, rotate, mix and manipulate different pictures,
    to create a wide variety of images.
  • Hamster Free Video Converter
    Converts video and audio files between various formats.
  • Free Video Converter
    Converts video between formats (AVI, MP4, WMV, MKV, SWF, 3GP, MPEG), creates custom presets, converts to devices, rips & burns DVDs, and uploads videos to YouTub.
  • JD-GUI
    Java decompiler.
  • xSearch
    A free search tool that offers more features than Windows Search, including searches for special words in files (any of the words, all of the words, exact phrase, without the words, etc), search for hexadecimal values, search for words in Unicode or UTF-8 format, and more.
  • CPU-Z
    Displays information about the main devices of your computer including CPU, graphics card, motherboard, memory, etc.
  • Rasterbator
    Creates rasterized versions of images, which can be printed and assembled into enormous (or smaller, if you prefer) posters.
Web tools
Web development
  • The Footer’s the Menu
    James Edwards suggests ways to address usability and accessibility problems with drop-down and fly-out menus.

Tuesday, November 9, 2010

Windows Live Essentials 2011 error [SOLVED]

Summary: Why can't I install Photo Gallery and Movie Maker?
This is what an installation error should not look like:

Two hours of frustration, searching the web and support sites for possible hints, following any remotely close suggestions, and the only thing I get is:
An unknown error occurred.
Error: 0x80096005
Source: D3DX9
Thank your Microsoft, kids!

UPDATE: Okay, after getting a number of hints from troubleshooting posts, I was able to fix the problem. It looks like my system missed the original DirectX 9 DLL (D3DX9.DLL). I don't know why it's missing. Maybe some program removed it when it was not supposed to (I did not see any errors related to DirectX 9, though). So, I just made copies of the latest version of the DirectX 9 DLL (D3DX9_XX.DLL) in the System32 and SysWow64 folders and renamed the copies to D3DX9.DLL. Problem solved. Hope it helps someone.

Wednesday, October 27, 2010

Free web site builders: Weebly vs. Yola

Summary: Pros and cons of using Weebly and Yola free web site builders.
If you need a simple web site, a wide range of providers can offer you a capability to build and host your site for free, assuming that you can live within their limitations. The most common limitation is banner advertisements which will be sprinkled across your web pages. Banner ads may not be a problem for some, but they often make you site look amateurish. If you want a more professionally looking site with no banner ads, your free web hosting options are limited to:
I have checked these sites and used two of them to establish web presence for some friends (small businesses owners). Here is a brief summary of my experience (note: I describe the features of free hosting; all companies provide premium -- paid -- hosting with fewer limitations).

Wix looks slicker than the other two, but it produces web pages that use Adobe Flash technology instead of more common (and expected) HTML. Now that Google can index Flash-based pages this may not be a big deal, but being mostly an HTML type of developer, I can't bring myself to embrace Flash as a web page medium. Call me old-fashioned or biased, but I think that for simple web pages, HTML is more appropriate than Flash.

Yola (formerly, Synthasite) and Weebly are very similar. They give you a web site builder to create web pages based on available templates (some templates are free, some are not). You pick a template (you can change the template at any time), then you add elements (such as two-column layout, heading, text, picture, hyperlink) to the page layout via available widgets. Widgets allow you to customize the page elements, but customization options are often limiting. If you need to add an element that does not have a corresponding widget (such as a table), you can use an HTML widget that lets you enter any HTML code snippet.

Once your web site is ready, you publish it to a subdomain under yolasite.com or weebly.com (e.g. mycompany.yolasite.com or mycompany.weebly.com), or you can use a custom domain (e.g. mycompany.com), which you can purchase directly from Yola or Weebly (for a slightly higher fee), or from any domain registrar, such as GoDaddy.

Yola and Weebly add their company logos to page footers, but the logos are rather unobtrusive.

Here is a list of problems I encountered when I worked with Yola and Weebly:
  • Yola: Web site builder requires Firefox (it did not work for me in Chrome). (This seems to have been fixed.)
  • Yola: CSS customization is tricky (there is no easy way to define common styles, such as fonts, etc).
  • Weebly: Cannot paste formatted text (say you paste text copied from a web page); it messes up formatting and does not let you correct it (the only way is to delete the element and recreate it).
  • Weebly: Customization of a window title is somewhat limited (you cannot define an arbitrary title for a page title).
  • Weebly: Cannot reference already uploaded images (e.g. you can upload an image and reference it on one page, but how do you reference it on another page?).
  • Weebly: Some features of the resulting site work only in Internet Explorer (e.g. ALT properties of IMG elements only work in IE).
  • Weebly: There is no option to preview changes before publish the site.
  • Weebly: Customer support is sporadic at best (I got a response to one out of four questions I submitted).
  • Both: Cannot specify title (tooltip) for hyperlinks (looks bad for image URLs).
The best things about Yola are vibrant user community and customer support. I raised several issues with Yola's customer support and got prompt responses from Yola's representatives. All my issues were resolved. I can say that Yola's customer support rivals (well, it's actually better than) customer support of most big names in software industry. I also found good recommendations at Yola's user forum.

The major limitation of both sites is their page templates. Although, they offer dozens of free templates, most of them look like they were designed in mid-90's for a high school project. I found one relatively decent template at Weebly (which I used for one site), but I had even less luck with Yola (I ended up building one site at Yola, but it's not something I would be proud to show).

If you need a simple and unassuming web site, give Weebly or Yola a try. They could be so much better, but even with current limitations, you can use either service to build online presence for a small business, create a personal or family site, and other simple applications.

If you can recommend another alternative (based on personal experience), please leave a comment (just make sure that this alternative does not use banner ads and supports other features offered by Yola and Weebly: custom domains, templates, site builder, custom CSS, HTML editing).

UPDATE (Dec 25, 2010): I recently published another site on Weebly, and while working on it, I appreciated the feature that let me easily find and incorporate free stock photos into the pages. Being able to select a different photo in the page header for each page was especially handy.

Tuesday, October 19, 2010

How to fix a hanging uninstaller

Summary: How to fix a hung uninstaller issue due to inclusion of Visual C or MFC runtime merge module in the MSI package.
I have hassled with this problem for a long time and just recently figured out how to fix it, so I'm posting the solution in hope that it will help someone else.

Symptoms
You create an MSI package using Visual Studio, WiX Toolset, or whatever. The MSI package works fine during initial installations, repairs, and upgrades, but it takes really long time to uninstall. It may take two minutes, five minutes, 15 minutes, or longer, when it should've taken a few seconds. In my last case, after 20 minutes of waiting I gave up and killed the MSIEXEC process (this was during testing, so no harm was done).

Troubleshooting
I suspect that an uninstaller can (appear to) hang for different reasons. If your setup package includes merge modules for any version of Visual C or MFC runtime, such as Microsoft_VC80_CRT_x86.msm, Microsoft_VC80_MFC_x86.msm, Microsoft_VC90_CRT_x86.msm, Microsoft_VC90_MFC_x86.msm, etc, they can cause the problem. To verify, build your MSI package without these merge modules and see if the uninstaller runs faster. If it does not, I'm sorry, I can't help you, but if your uninstaller runs significantly faster, you should be able to correct the problem. Another troubleshooting step could be running uninstaller for the MSI containing the merge modules with logging enabled and checking the log entries. The command line for this should be similar to:
msiexec /uninstall "PATH TO YOUR MSI FILE" /l*vx "PATH TO OUTPUT/LOG FILE"
In my log file, when the installer appeared hanging, I saw a repetition of the same pattern of log messages that looked like these:
Action start 13:07:24: SxsUninstallCA.
1: sxsdelca tried opening key w/o wow64key  2: Software\Microsoft\Windows\CurrentVersion\SideBySide\PatchedComponents 3: 380 4: 0
MSI (s) (E8!C8) [13:07:24:507]: Closing MSIHANDLE (235) of type 790531 for thread 200
MSI (s) (E8!C8) [13:07:24:507]: Creating MSIHANDLE (236) of type 790531 for thread 200
1: sxsdelca tried opening wow64key  2: Software\Microsoft\Windows\CurrentVersion\SideBySide\PatchedComponents 3: 404 4: 0
MSI (s) (E8!C8) [13:07:24:507]: Closing MSIHANDLE (236) of type 790531 for thread 200
MSI (s) (E8!C8) [13:07:24:507]: Creating MSIHANDLE (237) of type 790531 for thread 200
1: sxsdelca 2: traceop 3: 1158 4: 0
MSI (s) (E8!C8) [13:07:24:507]: Closing MSIHANDLE (237) of type 790531 for thread 200
MSI (s) (E8!C8) [13:07:24:507]: Creating MSIHANDLE (238) of type 790531 for thread 200
MSI (s) (E8!C8) [13:07:24:507]: Creating MSIHANDLE (239) of type 790531 for thread 200
1: sxsdelca 2: traceop 3: 1186 4: 0
MSI (s) (E8!C8) [13:07:24:507]: Closing MSIHANDLE (239) of type 790531 for thread 200
MSI (s) (E8!C8) [13:07:24:507]: Creating MSIHANDLE (240) of type 790531 for thread 200
1: sxsdelca 2: traceop 3: 732 4: 0
MSI (s) (E8!C8) [13:07:24:507]: Closing MSIHANDLE (240) of type 790531 for thread 200
1: sxsdelca 2: traceop 3: 748 4: 0
MSI (s) (E8!C8) [13:07:24:507]: Creating MSIHANDLE (241) of type 790531 for thread 200
1: scavenge 2: {121634B0-2F4B-11D3-ADA3-00C04F52DD52} 3: {98CB24AD-52FB-DB5F-C01F-C8B3B9A1E18E} 4: {AEA1383C-9A90-406A-8CAE-718170D9CBDA} 5: -1
MSI (s) (E8!C8) [13:07:24:507]: Closing MSIHANDLE (241) of type 790531 for thread 200
...
...
...
MSI (s) (E8!C8) [13:16:37:663]: Creating MSIHANDLE (180783) of type 790531 for thread 200
1: scavenge 2: {EDDF99D9-9FE3-4871-A7DB-D1522C51EE9A} 3: {42CDEC6E-1259-F078-C01F-C8B3B9A1E18E} 4: {AEA1383C-9A90-406A-8CAE-718170D9CBDA} 5: -1
MSI (s) (E8!C8) [13:16:37:663]: Closing MSIHANDLE (180783) of type 790531 for thread 200
1: sxsdelca 2: traceop 3: 748 4: 0
MSI (s) (E8!C8) [13:16:37:663]: Creating MSIHANDLE (180784) of type 790531 for thread 200
1: scavenge 2: {0EFDF2F9-836D-4EB7-A32D-038BD3F1FB2A} 3: {42CDEC6E-1259-F078-C01F-C8B3B9A1E18E} 4: {AEA1383C-9A90-406A-8CAE-718170D9CBDA} 5: -1
MSI (s) (E8!C8) [13:16:37:663]: Closing MSIHANDLE (180784) of type 790531 for thread 200
1: sxsdelca 2: traceop 3: 748 4: 0
MSI (s) (E8!C8) [13:16:37:663]: Creating MSIHANDLE (180785) of type 790531 for thread 200
1: scavenge 2: {4D7B7CF9-E7EA-4404-B148-0C8B8A520E35} 3: {42CDEC6E-1259-F078-C01F-C8B3B9A1E18E} 4: {AEA1383C-9A90-406A-8CAE-718170D9CBDA} 5: -1
MSI (s) (E8!C8) [13:16:37:663]: Closing MSIHANDLE (180785) of type 790531 for thread 200
1: sxsdelca 2: traceop 3: 748 4: 0
Reason
I'm not quite certain why this is happening, but apparently the problem only occurs under certain conditions, i.e. the same MSI package that includes Visual C or MFC runtime merge modules may work fine on some systems and hang on others. For more information, check the See also section.

Solution
This may not be the most elegant solution, but in the absence of alternatives, to fix the problem, do not process Visual C and MFC runtime components during uninstallation. In the MSI terms, you need to delete the SxsUninstallCA action from the CustomAction table in the MSI package.

ActionTypeSourceTarget
SxsUninstallCA1SxsUninstallCACustomAction_SxsMsmCleanup

You can delete this record manually using Orca, but it would be more convenient to automate the operation, which you can do with the help of the WiRunSql.vbs script. The script comes with the Windows Installer Software Development Kit (SDK). Once you install the SDK, you can find the WiRunSql.vbs file in the location similar to:

C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\sysmgmt\msi\scripts\WiRunSQL.vbs

You can copy this file to your project or solution folder and then execute it as a post-build step. For example, if you keep the script in the solution folder, your post-build command in a WiX project may look like this (make sure the command appears on one line):

cscript //nologo "$(SolutionDir)WiRunSql.vbs" "$(TargetPath)" "DELETE FROM CustomAction WHERE CustomAction.Action='SxsUninstallCA'"

Enjoy!

See also:
WinForm app Uninstall involving VC++ runtime libs takes a long tim[e]

Monday, October 18, 2010

WiX how-tos and missing links

Summary: Links to articles explaining how to accomplish different tasks in WiX and other helpful information.
This is post #4 of the six-part Learning WiX series. For other topics, see:

Table of contents
  1. Background (why WiX?)
  2. Introduction (answers to common questions)
  3. Getting started (references and tutorials)
  4. How-to's and missing links
  5. Slides and demo projects
  6. Improved demo projects (32- and 64-bit installers)
Here is a list of articles covering topics that I either did not find -- or found implemented better than described -- in most popular WiX tutorials and wikis:

How to: Exclude license agreement dialog from the dialog sequence
How to: Install a Windows service (see also this and that)
How to: Build 32-bit and 64-bit MSI packages (see this thread, and that one, too)
How to: Add a shortcut (without an icon [.ICO] file)
How to: Add a checkbox to conditionally install a desktop shortcut (via a check box)
How to: Add a desktop shortcut (without a registry key)
How to: Create shortcuts for ALL USERS
How to: Execute custom action (CA) on uninstall only
How to: Create an uninstall shortcut
How to: Launch program after installation
How to: Add a neat checkbox to the exit dialog for launching a program or help file
How to: Create a localized installer and bootstrapper (see also parts 2, 3, and 4)
How to: Modify XML files (e.g. web.config) during installation
How to: Modify web.config file during installation (turn off debug flag, etc)
How to: Implement custom actions (CAs) (excellent explanation of different CA types)
How to: Implement a custom action in managed code (C#/VB.NET)
How to: Implement a major upgrade (see Brian Gillespie's comment for optimization ideas)
How to: Preserve original Windows service configuration on major upgrade
How to: Deploy a web site (also this one)
How to: Save path to installation folder in the registry (search for ARPINSTALLLOCATION; see also this, this, and that)
How to: Override (wrong) Program Files (x86) on x64 machines in WixUI_Advanced sequence
How to: Upgrade application in the original installation folder ()
How to: Make setup UI sequence show only two (Welcome and Final) dialog boxes
How to: Retain user-customized files during a Windows Installer major upgrade
How to: Register a COM+ application
How to: Create an event log source
How to: Deploy publisher policy files to GAC

I also found the following information very insightful (some related to MSI, other about WiX):

Description of TARGETDIR and SourceDir
Explanation of the MergeRedirectFolder variable
Differences between 32-bit, 64-bit, and mixed MSI packages (includes folder locations, package compatibility and other info)
How Windows Installer Processes Packages on 64-bit Windows
List of system folders defined by the Windows Installer engine
Add/Remove Programs (ARP) support (good explanation and illustration of ARP properties)
Windows Installer: Property Reference
MSI Writing Guidelines

I will keep updating these lists updated when I find more useful articles.

See also:
WiX - Windows Installer XML (more how-tos)
WiX tricks and tips (includes a few how-tos)
WiX Tricks (several good suggestions)
WiX Tips & Tricks

Tuesday, October 12, 2010

Learning WiX from ground up

Summary: Reference guide for beginners.
This is post #3 of the six-part Learning WiX series. For other topics, see:

Table of contents
  1. Background (why WiX?)
  2. Introduction (answers to common questions)
  3. Getting started (references and tutorials)
  4. How-to's and missing links
  5. Slides and demo projects
  6. Improved demo projects (32- and 64-bit installers)
So you decided to create your first setup package using Window Installer XML (WiX). Where do you start? And how much do you need to know about WiX and Windows Installer (MSI) to build a working deployment package?

The answer to the second question is: it depends. Well... sort of. Before you begin, you definitely need to know the fundamentals of the Windows Installer (MSI) technology, such as:
  • The overall structure of an MSI package (MSI database)
  • The difference between packages, features, components, and deployment items (files, registry keys, shortcuts, etc)
  • Custom actions (CAs) and how they are used
  • Upgrade types (minor vs. major upgrade)
  • Merge modules
You don't need the in-depth knowledge, but at the very least, you need to understand the terminology (check the Wikipedia overview and MSI Basics). You may need to learn more to implement such complex features as program shortcuts (yes, shortcuts are complex in Windows Installer), but you will be able to learn additional concepts as you go.

To get started, install the current version of WiX Toolset from:
You can download a beta version of the upcoming release or an older version of WiX Toolset from SourceForge.

I assume that you will be using Visual Studio to develop setup programs. WiX Toolset includes a Visual Studio add-on, Votive, that enables WiX integration with the Visual Studio IDE. After installing WiX Toolset, make sure that WiX project templates appear in the New Project dialog box:

At this point, you can create a WiX project, but when you open the auto-generated WiX source file, you'll realize that you have no idea what to do with it. This is where a tutorial can help.

The WiX Toolset's help file is a good place to start (by default, the help file is installed to C:\Program Files\Windows Installer XML v3\doc\wix.chm; you can find a shortcut to the help document under the WiX program group in the Start menu; the help file can be also viewed online). You don't need to read it all; the first few chapters and how-to articles give you a basic idea of what you need to do to get a functional setup project.

To get more in-depth understanding of WiX, check out more advanced tutorials. The ones I found most helpful include:
There is also a very insightful presentation by Jeffrey Sharp (with slides and video):
The following MSDN article by Ibrahim Hashimi is a bit out-of-date and has a slightly different focus (build automation), but it still offers a pretty decent overview of WiX:
Nick Ramirez just published an excellent book that covers a lot of WiX and Windows Installer (MSI) topics (see my Amazon review):

You can read the Getting Started and Adding a User Interface chapters online.

And here is a list of tools that you may want to check out:
  • SharpSetup creates bootstrapper and GUI for your WiX installer in C# and WinForms.
  • Wix# (WiXSharp) builds MSI packages or WiX source code from C# code.
  • IsWix (Industrial Strength Windows Installer XML) is a document editor that enables non-setup developers to collaborate with setup developers using WiX projects.
  • WixEdit is an editor for XML source files for the Windows Installer XML (WiX) toolset to build MSI and MSM setup packages.
After you feel more comfortable with WiX basics (deploying files, etc), your next challenge will be implementing slightly less obvious operations (registering COM objects, creating shortcuts, using custom actions, etc) that are either not covered in the help file and popular tutorials or covered incompletely. In the next post, I will include the list of references to the how-to articles that I found most helpful.

Friday, October 8, 2010

Introduction to WiX

Summary: Answers to most likely questions from Windows Installer XML (WiX) novices.
This is post #2 of the six-part Learning WiX series. For other topics, see:

Table of contents
  1. Background (why WiX?)
  2. Introduction (answers to common questions)
  3. Getting started (references and tutorials)
  4. How-to's and missing links
  5. Slides and demo projects
  6. Improved demo projects (32- and 64-bit installers)
Here is a list of questions I had a couple of weeks ago before I started working with WiX (Windows Installer XML). I hope that answers to these questions will help other WiX novices.

What is WiX?
WiX is a language (Windows Installer XML [eXtensible Markup Language]), or more specifically, a Windows Installer-specific XML syntax. You can use WiX syntax to author XML source files for your setup project, from which you can then build Windows Installer (MSI) packages with the help of WiX Toolset.

What is WiX Toolset?
WiX is distributed as a free (open-source) toolkit that includes several command-line tools (such as WiX compiler, linker, etc), documentation, and utilities. Once you create WiX source files defining your setup application (you can do it by hand in a text editor, such as Notepad), you can use WiX Toolset to compile these files into a Windows Installer (MSI) package.

Can I develop WiX projects in Visual Studio?
Yes, WiX Toolset's Visual Studio package, Votive, which is also free (and open-source), adds WiX-specific project templates to Visual Studio, so you can create and build WiX projects directly from Visual Studio. Votive also provides syntax highlighting and IntelliSense for WiX source files.

Which version of Votive do I need?
There are several versions of Votive (and WiX Toolset), each targeting specific versions of Visual Studio. At the time of writing, the latest version (v3.5 for Visual Studio 2010) was still in beta. The recommended version (v3.0) works with both Visual Studio 2008 and 2005. Earlier version(s) of the toolset target the earlier version(s) of Visual Studio.

How does Votive/WiX differ from Visual Studio Installer?
Visual Studio Installer (or Setup and Deployment Project Template) allowed you to build setup packages via drag-and-drop activities and automation. It automatically detected dependencies for your application files, generated GUIDs for components and features, and did a few other things in the background, so you may have not even realized that they were happening. When working with WiX projects you must perform all these tasks by hand.

So WiX is not as good as Visual Studio Installer, right?
Yes, and no. It's true that WiX requires more manual work. And it has a steep learning curve. But it's more flexible than Visual Studio Installer, it supports more features and customization, and gives you more control over the resulting setup package. And it produces a much cleaner MSI database.

Does WiX support all features of Windows Installer?
No, unfortunately not. WiX supports many common features of Windows Installer technology, but not all. The list of supported features includes (but is not limited to):
  • 32-bit, 64-bit, and mixed (32/64-bit) installers
  • Creation of shortcuts and registry entries
  • COM server registration
  • Windows service registration
  • Customization of setup dialog sequence (up to certain extent)
  • Creation of web sites
  • And much more
If you wonder about WiX support of a particular feature, check the web for articles and posts on the topic of your interest and you're most likely to find whether WiX support it or not.

Can I use WiX to create a bootstrapper program (setup.exe)?
No, WiX Toolset only allows you to build MSI and MSM (merge module) files.

What are other limitations of WiX?
See the answers posted on StackOverflow.

What are the differences between WiX project types?
In addition to regular installer projects, Votive allows you to build merge modules and WiX libraries. Merge modules let you share installable components among different products. For example, if you want to deploy a common COM component/ActiveX control with different applications, you can encapsulates its installer in a merge module and than use this merge module with regular WiX installer projects (the merge module will be absorbed in each product's MSI package). WiX libraries allow you to share identical sections of XML code between the WiX source files (this is similar to using include files in C/C++ projects).

What do I need to know before learning WiX?
In theory, you should understand Windows Installer (MSI) before you start learning WiX, but in practice you can learn both technologies concurrently. The abundant information available online can help you get started and achieve progress even if you have very limited understanding of Windows Installer.

Where do I find support if I get stuck?
You can start at StackOverflow (I found answer to most of my questions there). The "official" support site is at SourceForge.

I want to try WiX. Where do I start?
This will be the topic of my next post.

See also:
What about that WiX?
Dude, where is your installer?