Rajganesh Writes

Sunday, September 18, 2011

Recently I ran into an interesting problem in one of a .NET Windows
Application's Setup project. This is a .NET 3.5 application, hence used the
visual studio 2008 setup project to build MSI installer for the application.
While first time installation was successful, upgrade version of the setup
project failed to update few of the files.

After going through few MSDN link, got to know when you have an updated
application and set RemovePreviousVersions as true in setup project “VS
2005 setup project will create MSI which completely uninstalls the old version
and reinstalls the new version” but “VS 2008 will create MSI
which updates the old installation based on pre defined file replacement
rules”. In simplified terms below are the rules,

Both the old and new files are versioned files (i.e. application’s
executable, dll files)

If your new file is having higher version compared to old files (e.g., old
dll version is 1.0.0.1 and new dll version is 1.0.0.2), old file will be
replaced by new file

If your new file is having same or lower version compared to old files
(e.g., old dll version is 1.0.0.1 and new dll version is 1.0.0.0 or 1.0.0.1),
old file will not be replaced by new file

Both the old and new files are non versioned files (i.e. txt files, help
files)

Installer will compare the created time and the last modified time of the
old file. If the times are not same (case when the file is modified after
installation in users machine), old file will not be replaced by new
file (though your new file could be different than old file). The
intent of this logic is to prevent Windows Installer from overwriting files that
users have modified on their machine.

Installer will compare the created time and the last modified time of the
old file. If the times are same (case when user haven’t changed the file),
old file will be replaced by new file.

As one of my text file (non versioned) was not updated in my upgrade MSI, I
ran the MSI with verbose log to understand how the Windows Installer treats my
file. Below is the command to run MSI with verbose log in command prompt.

msiexec /i "SampleInstaller.msi" /l*v "d:\SampleInstaller.log"

/l tells Windows Installer to create a log, * tells it to log everything and
v tells it to use verbose mode.
This is the entry in log file for one of the file which failed to update.

Monday, May 30, 2011

Recently got a chance to learn some of the new HTML5 standards. There are lot of new features supported out of box by the browsers adapting the HTML5 syntax.

DIVE INTO HTML5 is a wonderful book/tutorial on HTML5. This article, lists out the top 28 features one must know before coding in HTML5.

There are many new element tags introduced by HTML5 standards. As per HTML5 standards, Canvas element is defined “a resolution-dependent bitmap canvas which can be used for rendering graphs, game graphics, or other visual images on the fly”. Along with strong JavaScript support, Canvas is one of the best competitor to RIA development tools like Flash & Silverlight.

To start with HTML5 learning, I thought of migrating my MIX 10 10K coding puzzle developed in Silvelight to HTML5 Canvas element. Below is the puzzle displayed using Canvas element.

The above code looks good and every one expects it to work fine. But in real, it just displays a white blank SilverLight application. This is an expected behavior of SilverLight and Timheuer talks about the solution in this link.

The solution is to map proper XAP MIME Type, adding few changes in AppManifest.xml file and adding the below param tag inside the object tag as shown below.

AppManifest and Param changes are in our hands and can be modified, but mapping proper MIME type for SilverLight application in Google site cannot be done. Other options are like hosting your SilverLight application in some other MIME configurable hosting provider. But there are no better free SilverLight hosting provider available. Any other options? I heard about Google app engine. So thought of trying to use app engine as host.

Here is good post about embedding SilverLight in app engine. I followed the same and hosted my application in app engine. Then changed the source attribute in the object tag to the app engine URL. What a surprise, the application worked like charm.