yesJames.com
ahuh… sure… what ever you say…


Freaky Friday

Posted in Personal,Photography by james on November 13th, 2009

Photographic Art- Upload, Exhibit & Sell Photographic Art Work_1258073099205 (Medium)Photographic Art- Upload, Exhibit & Sell Photographic Art Work_1258073080491 (Medium)

I just got promoted.
One of my photos (well two actually) has just been used to promote the home page of the Photo Art Gallery (a.k.a. PhArt Gallery)

Come see my complete portfolio here: http://www.photoartgallery.com/artist/doublehelix

The rest of my work can of course be found here: http://www.redbubble.com/people/doublehelix

Star Wars

Posted in Photography,Science & Technology by james on November 3rd, 2009

I was lucky enough to attend the Star Wars experience exhibition before it finished here at the ScienceWorks museum in Melbourne last week.

Here are some shots from the show:

James & Jo’s Honeymoon in Italy

Posted in Personal by james on September 24th, 2009

Well, I’m married – and we just spent a whole month travelling Italy with a stopover in Dubai.

Here are some shots from the trip… enjoy.

Vista & Office 2007 Error: “has not been installed for the current user”

Posted in Software by james on May 21st, 2009

If you’re running Microsoft Windows Vista, with Office 2007, you’ll more than likely come across this problem during one of your early automatic Office Updates or Service packs. The error comes as you try to launch your office application for the first time after an office update. It reads something along the lines of “<application> has not been installed for the current user”.

At the core of this issue is a simple malconfiguration of the MSI installer that performs the update and configures the registry. It seems that as the installer creates or modifies executeable files and/or registry keys, it does so as the administrator user. This in turn cases all of the permissions on those files/keys to reset to those of the administrator user, causing the error you see.

Specifically, Update KB951944for Office 2007 seems to be the update causing the issue (according to user who have tested each and every patch for the bug). Skipping this one should avoid the problem all together.

There are several possible resolutions to this problem depending on your specific situation, some simple to solve, some more difficult.

The most obvious, and easiest fo resolve, is permissions on the executable files themselves. Firstly you have to open the Office application folder (normally “C:Program files (x86) Microsoft OfficeOffice 12″ or similar). You’ll need to locate each individual application executable (e.g. “Word” is “winword.exe“.) Right click on the executeable and select the “Properties” menu. In the properties window that opens, select the “Security” tab and click “Edit“. Give “Users” full control. You’ll may (in rare cases) need to re-create your shortcuts from these files.

Amongst the registry keys that are affected are the following:

  • HKLMSoftwareMicrosoftWindowsCurrentVersionInstallerUserDataS-1-5-18Components379E92CC2CB71D119A12000A9CE1A22A
  • HKLMSoftwareMicrosoftWindowsCurrentVersionInstallerUserDataS-1-5-18ComponentsDA42BC89BF25F5BD0AF18C3B9B1A1EE8
  • HKLMSoftwareMicrosoftWindowsCurrentVersionInstallerUserDataS-1-5-18ComponentsDA42BC89BF25F5BD0BF18C3B9B1A1EE8
  • HKLMSoftwareMicrosoftWindowsCurrentVersionInstallerUserDataS-1-5-18ComponentsDA42BC89BF25F5BD0CF18C3B9B1A1EE8
  • HKLMSoftwareMicrosoftWindowsCurrentVersionInstallerUserDataS-1-5-18Components82DE7549CF3F8CCB0DF18C3B9B1A1EE8
  • HKLMSoftwareMicrosoftWindowsCurrentVersionInstallerUserDataS-1-5-18Components6F949E36CB3004C50AF18C3B9B1A1EE8
  • HKLMSoftwareMicrosoftWindowsCurrentVersionInstallerUserDataS-1-5-18Components6F949E36CB3004C50CF18C3B9B1A1EE8
  • HKLMSoftwareMicrosoftWindowsCurrentVersionInstallerUserDataS-1-5-18Components7AA6F3DBF3CE139469FE63D56E7AF446

Any (including any that may not be listed above yet simmilarly afflicted) registry affected in this manner keys need to have thier permissions reset to the same permissions as thier parent key. i.e permissions should be inherited.
If you’re not comfortable doing this by hand, there’s an open-source utility called SetACL (http://setacl.sourceforge.net/) that can help.

WARNING: There are many keys under the “components” key that have nothing to do with Office! do not go and arbitrarily go and reset every single sub-key under “components” to inherited permissions, as this will effectively remove all UAC protection from all installed components (not just office) so don’t do that! You’ll have to inspect individual registry keys.

If you’re in fact going to use SetACL, you can execure the appropriate command-line function like this:

setacl -ot reg -on "HKLMSoftwareMicrosoftWindowsCurrentVersionIn stallerUserDataS-1-5-18Components{GUID}" -actn setprot -op "dacl:np;sacl:nc" -rec yes

Where {GUID} is the ID of the component that requires resetting. It may be easier to copy this command into a batch file if you need to execute it numerous times. Typing this over and over 30 times can be painful.

Well, hopefully one of these solutions has solved the problem fo you. If not, I’ve heard of a later update causing almost the same issue, so you may very well be experiencing a similar problem! Let me know if you do… especially if you figure out another way to solve it.

Thanks to everyone at VistaHeads for following up the problem.

For more information, and to join in discussions on Microsoft products, see the following Microsoft specific Newsgroups:
microsoft.public.office.misc and microsoft.public.word.newusers

Delphi: Declaring and initialising constant arrays

Posted in Delphi,programming,Software by james on February 16th, 2009

In Delphi, arrays are, put simply, a list of values contained within a common variable, that are accessible by their index within that list.

But what if you don’t want your list of values to be able to be altered at run-time? You need them to be contained in a constant rather than a variable.

Example: to declare an array of abbreviated week names:

const
  Days: Array[0..6] of String = (
      'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'
  );

You could then access each name by the index of the day of the week within the Days constant.

i := DayOfWeek(Date); //returns an integer 0-6
ShowMessage('Today is  ' + Days[i]);

Another common use for constant arrays is to describe the values in an ENUM type:

type
  TStatusCodes = [
    scUnknown, scActive, scPending,
    scDisabled, scSuspended
  ];
const
  StatusString = Array[TStatusCodes] of String = (
    'Unknown', 'Active', 'Pending',
    'Disabled', 'Suspended'
  );

Then, the description string for each status code becomes available via the ordinal value of the status code itself:

ShowMessage('Your account is '+ StatusString[scActive]);

Would show a message box with the text “Your account is Active“. Of course in the real world, the status code enumeration value would come from a user object or some such similar method (like “function getAccountStatus(): TStatusCode;” perhaps).

How to find Windows uptime

Posted in Software by james on January 13th, 2009

Ok, so you want to know how long it’s been since your windows workstation or server was last (re)booted. There are two options. The first is built right into windows, the second is an external command-line program provided by Microsoft to help with the problem.

Option 1:

  1. Go to “Start” -> “Run“.
  2. Write “cmd” and press on “Enter” key.
  3. Write the command “net statistics server” and press on “Enter” key.
  4. The line that start with “Statistics since …” provides the time that the server was up from.

* The command “net stats srv” can be use instead.

Option 2:

The Uptime.exe tool allows you to estimate Server Availability with Windows NT 4.0 SP4 or Higher.

Uptime.exe is a standalone program. To install the tool, simply copy the file into your Windows directory. You may then run the tool at a command prompt.

For extended help on this tool, type the following at a command prompt:

uptime /help

This tool is most accurate when run with administrator privileges, however, even without administrator privileges, the tool attempts to make a best estimate based on available information. In all cases, the results should be considered estimates.

The uptime.exe program can be downloaded from Microsoft here:
http://download.microsoft.com/download/winntsrv40/install/uptime_1.01/nt4/en-us/uptime.exe

See also:

http://support.microsoft.com/kb/555737
http://support.microsoft.com/kb/232243