Friday, March 14, 2008

No 'C' drive

Sometimes it's useful to change the name of drive letters on a PC.

This tool: DriveRemap.zip does a pretty good job of not breaking most things when the drive that Windows is installed on is renamed.


Fewer blog subscriptions

I use Google Reader as my blog aggregator (shared items here)

I'd slipped into a situation where I had a massive number of feeds so that it was becoming a chore to keep up to date.

So I've had a big clear out.

Here's my old OPML, if you're interested.

I've unsubscribed from about half of them now.
Since the purge I've only resubscribed to one of those (Crunchgear)

Tuesday, March 11, 2008

installscript configure website to use specific version of ASP.NET

After managing to register ASP.NET 1.1 the next step was to tell the newly installed website to use version 1.1 of ASP.NET, rather than the default.

This was done with the following function.

function ConfigureAspDotNetOnePointOne(hMSI)
STRING svRootVer, svMajMin, szApplicationPath, szVirtDir, szK, szS;
NUMBER nvType, nvSize, nIsFlag;
begin
//Check the registry to see how/if ASP.NET 1.1 is configured with IIS
//We'll be looking in the HKLM hive
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);

//initialise to be sure of what started with
svRootVer = "";

//Try and read a value from the registry, which will exist if it is installed and registered
RegDBGetKeyValueEx("SOFTWARE\\Microsoft\\ASP.NET", "RootVer", nvType, svRootVer, nvSize);

StrSub(svMajMin, svRootVer, 0, 4);

//If path key does not exists, ASP.NET 1.1 is not registered with IIS
if (svMajMin != "1.1.") then
//Check it exists
nIsFlag = FILE_EXISTS;
szApplicationPath = WINDIR ^ "\\microsoft.net\\framework\\v1.1.4322\\aspnet_regiis.exe";
//Ensure that the path or filename is correctly enclosed in quotation marks,
LongPathToQuote(szApplicationPath, FALSE);
//Check if the exe file exists
if (Is (nIsFlag, szApplicationPath) == TRUE) then
//Get the name of the virtual dir
nvSize = 256;
MsiGetProperty(hMSI, "IIS_VIRTUAL_DIR", szVirtDir, nvSize);
//build command line arguments
szK = ' -k "W3SVC/1/Root/' + szVirtDir + '"'; //must quote as may contain spaces
szS = ' -s "W3SVC/1/Root/' + szVirtDir + '"';

//Register with IIS without script paths
LaunchAppAndWait(szApplicationPath, " -ir", WAIT);
//Remove any script path associations defaulted to new web application
LaunchAppAndWait(szApplicationPath, szK, WAIT);
//Associate new web application with desired ASP.NET version (1.1)
LaunchAppAndWait(szApplicationPath, szS , WAIT);
endif;
endif;

end;


I run this as a custom action in the Install Exec Sequence, after ScheduleReboot and with the condition 'Not Installed',

Wednesday, March 05, 2008

installscript register ASP.NET 1.1 (if not registered)

For some reason, one of our ASP.NET 1.1 based products is often installed on machines where ASP.NET 1.1 is installed on the machine, but not registered with IIS. (They typically have 2.0 installed and registered though.)

To get around this issue, I have created the following InstallScript function.

function RegisterAspDotNet(hMSI)
STRING svPatAddFolderIconszApplicationPath;
NUMBER nvType, nvSize, nIsFlag;
begin
//Check the registry to see if ASP.NET 1.1 is installed
//We'll be looking in the HKLM hive
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);

//initialise to be sure of what started with
svPath = "";

//Try and read a value from the registry, which will exist if it is installed and registered
RegDBGetKeyValueEx("SOFTWARE\\Microsoft\\ASP.NET\\1.1.4322.0", "Path", nvType, svPath, nvSize);

//If path key does not exists, ASP.NET 1.1 is not registered with IIS
if (svPath == "") then
//Check it exists
nIsFlag = FILE_EXISTS;
szApplicationPath = WINDIR ^ "\\microsoft.net\\framework\\v1.1.4322\\aspnet_regiis.exe";
//To ensure that the path or filename is correctly enclosed in quotation marks,
LongPathToQuote(szApplicationPath,FALSE);
//Check if the exe file exists
if (Is (nIsFlag, szApplicationPath) == TRUE) then
//Register with IIS
LaunchAppAndWait(szApplicationPath, " -i", WAIT);
endif;
endif;

end;

I run this as a custom action in the Install UI Sequence after LaunchConditions. (If you're not doing a UI install, you really should check the software requirements first!)

Tuesday, March 04, 2008

Attention to detail: Strange times and pausing.

If the quality of the simple things which are seen is poor, why should I trust the quality of the more complex things which aren't seen.

Up late in the kitchen one night, I noticed the clock on the oven change through the following times:

23:58
23:59
24:00
00:01
00:02

Hmmm. The hour changing 3 times in 3 minutes? I've never seen that on any other clock. While technically you could argue that it's correct, but it just seems wrong.

If you aren't paying attention to small details which I can see. Why should I trust that you are paying attention to the important things which I can't see.

If you press the volume up and volume down button on the radio in my car when a CD is playing it pauses and the display says 'PAUSE'. If you do the same when the radio is playing the radio is muted, but the display still says 'PAUSE', not 'MUTE'.
It's a small thing, but it bugs me every time I see it. Not a good way to build customer satisfaction. All because, hopefully, something was deemed to unimportant to spend enough time on.