Tuesday, September 09, 2008

Incorrect shortcut icon in start menu

Had an issue with an InstallShield 11 created installer.

One of the installed shortcuts was displaying a `default` exe icon, rather than the one specified.

Digging in the MSI, with Orca, showed that the shortcut incorrectly had an IconIndex of 1.

The Installshield IDE displayed an icon index of 0.

Something was obviously wrong.

The "Icon" table, in XML mode, showed the problem:
It was:
<row><td>NewShortcut2_B78C30FEFEEC4393B73638863E86FFA5.exe</td><td/><td>&lt;PATH_TO_PROGRAM FILES_FILES&gt;\StatMon.exe</td><td/></row>

Instead of:

<row><td>NewShortcut2_B78C30FEFEEC4393B73638863E86FFA5.exe</td><td/> <td> &lt;PATH_TO_PROGRAM FILES_FILES&gt;\StatMon.exe</td><td>0</td></row>

The IDE was showing a different value, if none was specified, than was put into the MSI.


Hope this helps save someone a headache in the future. ;)

Friday, September 05, 2008

My First Ubiquity command

It redirects the current tab to the root of the current domain.  - I find this helpful when there isn't a home link on a website.


/// http://blog.stevenlevithan.com/archives/parseuri
/*
 parseUri 1.2.1
 (c) 2007 Steven Levithan 
 MIT License
*/
function parseUri (str) {
 var o   = parseUri.options,
  m   = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
  uri = {},
  i   = 14;

 while (i--) uri[o.key[i]] = m[i] || "";

 uri[o.q.name] = {};
 uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {
  if ($1) uri[o.q.name][$1] = $2;
 });

 return uri;
};

parseUri.options = {
 strictMode: false,
 key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],
 q:   {
  name:   "queryKey",
  parser: /(?:^|&)([^&=]*)=?([^&]*)/g
 },
 parser: {
  strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
  loose:  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
 }
};


function cmd_domain_home() {
// heavily ripped from Utils.openUrlInBrowser

 var windowManager = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);

  var browserWindow = windowManager.getMostRecentWindow("navigator:browser");

  var browser = browserWindow.getBrowser();

  var uriParts = parseUri(browser.mCurrentBrowser.currentURI.spec);

  browserWindow.loadURI(uriParts.protocol + "://" + uriParts.host + "/", null, null, false);

}

Defrag chaos


This is after I managed to delete unneeded files from the C drive, which had run out of space.

Lesson for the day: If someone is responsible for admin of a key (read business critical) server, don't let them go on holiday if you'll have to pick up the pieces and sort out any problems, when it hasn't been proactively managed, while that person is away.

Tuesday, September 02, 2008

Example of poor usability

It's definitely a good idea to be consistent within software.  This is especially true when indicating special behaviour or requirements.

For example. It's not a good idea to highlight a textbox in one part of a program to indicte that it is a required field and then highlight a textbox in another part of the program, in the same way, to indicate that the text box is read only.