Thursday, November 22, 2007

My Top Ten Favorite Things I am Thankful to God For

  1. My Redemption
  2. My wife
  3. My children
  4. My father
  5. My family
  6. My friends
  7. My country - The United States of America
  8. My state - Texas
  9. My freedoms
  10. My values
  11. My abilities
This is my late and delayed Thanksgiving Day post :)
Actually posted on 12/4/2007

Thursday, November 15, 2007

Microsoft Project 2007

Background
The Microsoft Office 2007 Office System is using a new wrapper/bootstrap system to install the various Office MSI's. The primary bootstrap file is named, reasonably enough, setup.exe. This setup file uses separate xml files for each product as install-configuration files (setup.xml, config.xml).

Setup.exe also has several switches that can be used to perform several useful tasks, following are the switches I have found to be the most useful:

/admin - launches the Office Customization Tool, this tool will allow you to create an MSP to modify the install

/adminfile – this will allow you to use the MSP created above

/config – allows you to point to a Config.xml in a location other than
the default location

/uninstall - this switch gave me the most problems

My Experience
Recently, at work, I was asked to build a deployment for Microsoft Project 2007. I have re-packaged and built deployments for several versions of Office and for many Microsoft products and I knew that sometimes it is easy and sometimes not so easy.

Working on this deployment turned out to be easy, once I got past an unusual issue, and once I figured out how to correctly run the install and uninstall (not to mention the repair).

The issue occurred pretty quickly when I ran the install. I got the following error:

When I clicked "Close" this dialog popped up:

I clicked “What data does this error report contain?” and got this message:

Then I clicked “View the contents of the error report” to get the name of the log file. From there I copied the path to the log file, pasted it into the run dialog and clicked ok opening the log file (which is mostly just several MSI log files and the setup.exe’s log all together). As always when troubleshooting a MSI install I searched for ‘value 3’. I found two instances of “return value 3” but little in the way of useful information.

So I opened the event viewer and in the application log looked for events with MsiInstaller or “Microsoft Office 12” as the Source. And there I found one of each type of the events I was looking for that were related to this issue. The "Microsoft Office 12" event was mostly useless, but I hit the jackpot with the MsiInstaller event:
Event Type: Error
Event Source: MsiInstaller
Event Category: None
Event ID: 11933
Date: 11/15/2007
Time: 12:55:19 PM
User: USERNAME
Computer: COMPUTERNAME
Description:
Product: Microsoft Software Update for Web Folders (English) 12 -- Error 1933. The Windows Installer service cannot update one or more protected Windows files. SFP Error: 21. List of protected files:\r\nc:\program files\common files\microsoft shared\web server extensions\40\bin\fp4autl.dll


As you can see there is a reference to the file fp4autl.dll. A quick browse through the Microsoft Dll Database (EDIT: As per their website "The DLL Help application was retired on February 8, 2010 and is no longer accessible." Microsoft has discontinued one if it's best online tools. I hope there is some kind of replacement available. ) showed that this file should have been in place, since I am testing on Windows XP SP2.

I checked on several of my systems for the file to no avail, but finally found a copy of the file on the system I use for email and web access. So I copied the file to the system I was testing on (here: C:\Program Files\Common Files\Microsoft Shared\web server
extensions\40\bin\fp4autl.dll). Just to be on the safe side I also tested with regsvr32 to see if it needed to be self registered which it did not.

So I tested the install and it worked!

Now that I knew that I could get it to install I wanted to create an MSP to automate the install process.

I ran “Setup.exe /Admin”, which brought up the Office Customization Tool and this popup:

I left it at the default since I needed to create a new MSP and clicked ok. There were a number of options but what I needed was:
  1. Install location and organization name
    1. This allowed me to set the Organization name
  2. Licensing and user interface
    1. This allowed me to put in the product key, to accept the License Agreement, and set the display level to Basic.
  3. Add registry entries
    1. In order to suppress an initial popup I set the following values:
      1. HKLM\SOFTWARE\Microsoft\Office\12.0\User Settings\ShownOptIn\
        1. Count=1 (REG_DWORD)
        2. Order=1 (REG_DWORD)
      2. HKLM\SOFTWARE\Microsoft\Office\12.0\User Settings\ShownOptIn\Create\Software\Microsoft\Office\12.0\Common\General\
        1. ShownOptIn=1 (REG_DWORD)
        2. ShownOptInFix=Applied (REG_SZ)

Once I was finished with that I saved the changes and named the new file Project_Pro_CompanyName.MSP.

Now that I had an MSP that could be used to automate my install. I used the following command line to test the install and it ran smoothly:
setup.exe /adminfile Project_Pro_CompanyName.MSP

But I ran into another issue when I tried to test the uninstall of Microsoft Project 2007. I first tried using the following string:
setup.exe /Uninstall {90120000-003A-0000-0000-0000000FF1CE}

But that would generate this error:
'This product installation has been corrupted. Run setup again from the CD, DVD, or other original installation source.'

I was able to uninstall from Add/Remove programs, but I needed to be able to automate the process.

So I took a look in the registry. Very often there is an uninstall string that gives the command line needed to remove an installation. The first location I looked in was: [HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{90120000-003A-0000-0000-0000000FF1CE}]

Name: "UninstallString"
Type: REG_EXPAND_SZ
Data: MsiExec.exe /X{90120000-003A-0000-0000-0000000FF1CE}

So I tried running "MsiExec.exe /X{90120000-003A-0000-0000-0000000FF1CE}" and it worked, but it seemed to me that there should be some way to use the setup.exe, it has the /uninstall switch so it should work somehow.

It took a long time to figure out the correct string:
"C:\Program Files\Common Files\Microsoft Shared\OFFICE12\Office Setup Controller\SETUP.EXE" /uninstall PRJPRO /dll OSETUP.DLL

I found it in this registry key:
[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\prjpro]

Apparently the first key I looked under was just for the one MSI installing the core Project files, but the second registry key I looked at was for the entire Project setup.

Using that string worked but it brought up a dialog requiring user interaction and at the end it rebooted. Neither of these events was desirable.

So after a little more digging and experimenting I figured out that I needed to modify a copy of the config.xml to suppress the dialog and the reboot, and I needed to point to the alternate config.xml, which I placed in the temp directory. I modified the following lines in the xml file, first removing the remark characters “ <!-- -->” then changing the values to match what I needed:

<Display Level="None" CompletionNotice="no" SuppressModal="no" AcceptEula="no" />
<Setting Id="SETUP_REBOOT" Value="Never" />


And the command line that I ended up using was:
"C:\Program Files\Common Files\Microsoft Shared\OFFICE12\Office Setup Controller\setup.exe" /config %temp%\config.xml /uninstall PRJPRO /dll OSETUP.DLL

At this point I thought that I was done, then I realized that I needed to provide for repairing, luckily that was pretty simple:
“C:\Program Files\Common Files\Microsoft Shared\OFFICE12\Office Setup Controller\setup.exe” /repair PRJPRO

And finally I was finished. The deployment tool we use is able to install, repair and uninstall the package all automatically.

Wednesday, November 14, 2007

My Top Ten Favorite Poems

  1. Jabberwocky by Lewis Carroll
  2. The Shropshire Lad XIII by A. E. Housman
  3. Paul Revere's Ride by Henry Wadsworth Longfellow
  4. That Look by Elizabeth Barrett Browning
  5. Tommy by Rudyard Kipling
  6. Holy Sonnet 10 (Death be not Proud) by John Donne
  7. Sonnets from the Portuguese (Sonnet 43) by Elizabeth Barrett Browning
  8. The Lady of Shallott by Sir Alfred, Lord Tennyson

Package This

I have recently come across a tool for creating local copies (Hxs or Chm files) of data found on Microsoft's MSDN and Technet sites. The program is called Package This it is hosted on CodePlex.com Microsoft's open source hosting site.
You will need MS .Net 2.0 installed at a minimum and if you want to export the files to a help file then you will need either the .hxs SDK (MSHelp 2.0), which is a part of the Visual Studio 2005 SDK, or the .chm SDK (HTML Help Workshop).

Once you have everything installed launch the Package This exe and it will load a window that looks like this:

You can browse to the section containing the information that you need and checkmark all the boxes of the pages that you want to get or you can right click and choose 'Select This Node and All Children...'


Once you have all the pages you want to copy check marked, you can choose 'Export to Hxs File...' or 'Export to Chm File...' from the file menu and this will create the project files needed to make a help file.


I do a lot of Windows Installer packaging and re-packaging and have always kept a help file handy that covered the Windows Installer reference. And since Windows Installer 4.5 will be released in the not too distant future I started looking for an updated chm. But it seems that no one has made one, so I decided to.

So I launched 'Package This' and browsed to the MSDN section about Windows Installer right clicked and chose 'Select This Node and All Children...'. This part took several minutes as it automatically checked each page in the section I chose. After that since I want to create a Chm file I chose 'Export to Chm File...' and the following dialog popped up:

I clicked on browse, browsed to the desktop and named my chm file MSI.chm and titled it "Windows Installer 4.5" and clicked ok. This step also had to process for a few minutes but it was much quicker than the last step.

At this point I was expecting a chm file to appear on my desktop but nothing seemed to happen.

After a several tries both at home and at work I figured out what was happening. When it was done with the last step it had created all the files needed for a HTML Help Workshop project in a folder in my Temp directory (C:\Documents and Settings\USERID\local Settings\Temp\ipjfe4ee.o31\).

I browsed to my temp directory and found the most recently created folder and under that folder I saw two sub-folders, raw and chm. (TIP: Make a copy of this folder to work with. I found out the hard way that this folder will be deleted when you close 'Package This'.)

Under the chm folder I found all of the HTML Help project files and an html folder containing all the html pages and the style sheet, Classic.css. (TIP: I usually open the style sheet and change the "margin-left: 0;" to "margin-left: 10;", that is change the 0 to a 10. Without doing this the text will be flush with the left side of the page, and I don't like that myself.)

From here I ran 'HTML Help Workshop' (installed with the chm SDK) from the shortcut on my start menu and I clicked file ---> compile. Which produced a nice CHM file that I can keep on my thumb drive with my other references and my portable apps.

One thing that I noticed is that it does not create an index, which I like to have so I am now in the process of creating that index.


Saturday, November 10, 2007

No Game Last Night

One of my players had to work so we did not get to continue the game last night, so the characters are still trapped in the now insecure temple.

But one of my players and I stayed up till almost 5AM programming. We had been talking about creating an Ars Magica [link] character creation and tracking tool for a while and we decided last night to start tackling the project. As usual for us we are using Python with the wxPython toolkit for this project.

One really enjoyable thing about this peer programming session was that I had an opportunity to learn some of the refactoring techniques that are mentioned in wxPython In Action by Noel Rappin and Robin Dunn.

The session was probably one of the most fruitful programming session we have had. We accomplished a lot in a relatively short time and I really learned a lot.

Friday, November 9, 2007

A poem to my wife

Love has no flawless voice,

Whose words can express

Nor perfect song

Whose notes can sing

A single moment of

Your full worth to me


Beauty’s strokes livening the heavens

And the Poets lines expressing True Love

Are pale and shadowy imitations of your grace and my love for you

Tuesday, November 6, 2007

Currently reading #1

Currently I am reading The Amazing Dr. Darwin : The Adventures of Charles Darwin's Grandfather a book of short stories by Charles Sheffield.

Sheffield obviously had great respect for his subject and that respect shines through in his writing. Each of the stories I have read so far have been well crafted and, as with any good story, they make you feel like you are really there. The setting in the stories, 18th century Britain, often evokes a wistful almost nostalgic feeling in me and it does not fail to do so here.

I will write more about this and other books in this blog, as the post title might imply it is my intention to post regularly on the books that I am reading.

Demoshield

If you have to work on a Demoshield installation, keep in mind that the Demoshield part is not the actual install. It is a wrapper / player that is created, usually for a CD autorun, to provide a menu interface to one or more installers.

The actual installer may be of any number of install types including an InstallShield EXE, or a regular MSI.

If you have to script an install or deployment you can probably skip the Demoshield part altogether and just run the installer itself.

Demoshield is a discontinued product of MacroVision, the same people who produce InstallShield.

Sunday, November 4, 2007

Sunday WoW

Played WoW for 7 hours last night, mostly because my wife was out with her co-workers singing karaoke till all hours of the night, and I find it hard to sleep while she is out. But I had fun, it was the longest I had played any video game in years and I enjoyed it.

Of course my wife had a hangover today, and even though we liked having the extra hour, neither of us remembered about the extra hour until she was about to leave for work :)

Speaking of WoW I thought that I would list some of the sites that I have found to be useful with WoW:
I play WoW on my Windows system and keep these sites open in FireFox on my Ubuntu Linux system.



I was informed this morning that my daughter had an art project to do for school she was supposed to make a cutout in construction paper of the person she most admires. She chose me. That is the most humbling event that I have experienced in a long time. When my wife told me with my daughter sitting at the kitchen table, she looked up at me with the most sincere and open expression and it was all I could do not to cry :)

It is my earnest and heartfelt prayer that I can be worthy of the respect that my children show me.

Saturday, November 3, 2007

Last night's game

Was actually pretty good. It didn't last as long as I would have preferred, but it worked anyway. I had my players trapped in a small temple in an abandoned village. The temple was still consecrated which is the only thing keeping the undead out. But the skeletons and zombies outside kept trying to get in. It made for a very tense scene. Of course when the undead (with a little help) were able to desecrate the temple they began to break in. We left the game with dawn an hour away and the front door of the temple breached.

All in all I think it went pretty well.

Friday, November 2, 2007

Friday night game

Most of the gamers are here, and the last of them should be here soon and I still am not ready to run the game. And speaking of gaming tomorrow is the World Wide D&D Game Day. It is supposed to be a day to get together at various game stores and play D&D. Of course I will not have the free time to go, but thems the breaks.

Stick Figure Man

Stick figure man
With a stick figure dog
In a stick figure land
Breathing stick figure smog

Stick it to me stick man

Subinacl is great but...

It can not set permissions on a registry key that has an * in the name.

This actually came up for me today when working on a MSI package and NetInstall deployment for an application (that will go unnamed).

For those who are not aware, subinacl updates the ACL - Access Control List - on MS Windows.

In this particular scenario subinacl gives a message that says it is skipping the key (and sub-keys) due to a wildcard (*).

I love subinacl, it is very useful for modifying permissions on files, folders and in the registry. Especially since within Windows Installer, the permissions functionality is, or at least seems to be, broken.

I ended up using SetAcl a sourceforge project of great use.



Here are a couple of examples of how to do what I was trying to do with both tools:
  • subinacl.exe /subkeyreg \HKEY_LOCAL_MACHINE\SOFTWARE\Vendor Name /grant=Users=F
  • SetACL.exe -on "hklm\software\vendor name" -ot reg -actn ace -ace "n:Users;p:full"