ISWIX, LLC View Christopher Painter's profile on LinkedIn profile for Christopher Painter at Stack Overflow, Q&A for professional and enthusiast programmers

Thursday, September 25, 2008

HOWTO: Use Regsvr32.exe with WIX

I was surfing the blogosphere tonight when I came across this interesting blog from a Microsoft employee developer using WiX demonstrating how to use an EXE custom action to call Regsvr32:

For those of you who don’t recognize this dll, its a required library by Add-in Express, we are using it to ease our development of GhotIt (http://www.ghotit.com) plug-in(s) for Microsoft Office applications.

Now I'm currently too tired to give another `don't believe what you read` article so I'll just leave at where are the setup police when we need them?

Monday, September 22, 2008

Different year, Same Problem...

5 years ago I was working at Continental Airlines learning MSI with Windows Installer 2.0. One of the biggest pain points was troubleshooting why services wouldn't start. Some programs just had horrible COM/ATL issues relating to COM extraction not working and /regsvr having race problems.

One of the more aggravating scenarios was for a program called Gate Reader that had a windows service with a dependency on a active directory service account.

Inevitably one of two things would go wrong: Either someone had locked the account out ( and no installs would work for up to the next 15 minutes ) or the service account had never been assigned the SeServiceLogonRight priv on the machine being installed to.

Now we can talk about eliminating the dependency by eliminating the service account but at the end of the day development typically doesn't give a flying brown mass about deployment/operational problems.

So it's the later that always irritated me. Why in the world is it that Windows Installer has columns in the ServiceInstall table for describing a service account but when it creates the service it doesnt' grant the SeServiceLogonRight priviledge?

A quick hop over to Services and type in the username and password gets you a dialog that says the account has been granted logon as service.

I know I'm not the only one to have this problem because there are many threads where setup developers suggest using the not-quite-redistributable NTRIGHTS.EXE to get around the problem.

So anyways, it's now 2008 and I'm running MSI 4.5 and sure enough, it's still a problem. Ugh. The good thing is I've since learned C# ( Gatereader was a .NET 1.1 application at the time ) and I've got DTF at my disposal. This allows me to make use of a project that was available on CodeProject some five years ago that at the time meant nothing to me:

LsaUtility.SetRight( session.CustomActionData["ServiceAccount"], "SeServiceLogonRight" );

Nice, thank you DTF! Now my real implementation is datadriven using the ServiceInstall table but I wanted to show how simple the problem is to solve with just one line of C# thanks to a freely available class file and DTF.

So while some things stay the same, some things actually do get better.

Sunday, September 21, 2008

35 and Counting



Anyone who knows my wife knows that she loves to make a big deal out of birthdays. So when my 35th birthday came around she pulled out all of the stops for me. The trip to Best Buy to let me pick out a new LCD monitor was a real treat not to mention a productivity improvement. The trip to Rudy's BBQ for brisket, sausage, turkey, chicken and all the sides was great also. A Dairy Queen ice cream cake was a prerequisite also. After all of that excitement and food I just had to get an hour and a half massage also.

But the best was having my sister-in-law take care of the girls while Cheryl and I spent the entire day together at Six Flags Fiesta Texas in San Antonio. We had visited back in August as part of our South Padre vacation but today was just two people totally in love with each other having a great time as adults with no kid duties. What a day! It felt like a second honeymoon 11 years in the making.

Wednesday, September 10, 2008

Generating GUIDs Easily

Bob Arnson (MSFT) recently posted a blog where he provides sound advise about when to use a new UpgradeCode. He also posts a link to a `reputable online retailer` that provides GUIDs.

Now I'm sure Bob was being funny when he says `reputable online retailer`. However, should you really have to go through a multiple step process using an external tool just to generate a GUID? Shouldn't your MSI Editing Tool provide this functionality?

Well, if you are using an Industrial Strength Household Name MSI Editing Tool, it does. Just about every designer in InstallShield will either auto generate a GUID ( like when creating a new component ) or provide a one click button for generating and applying a different one (like when defining multiple product configurations that may or may not share an UpgradeCode as Bob mentions).

Also if you need to do any GUID manipulation at build time there is an automation interface that includes a GUID generator and classes that represents all aspects of the project that you can apply the GUID to.

This may seem like a trivial disagreement, but I work on installs full time and every single feature like this helps me to improve my productivity. Besides, we all know what happens when you don't provide this level of automation and the developer doesn't seek out a `reputable online retailer` of GUIDs.

WixBinaries.2.0.lib {DEADBEEF-DEAD-BEEF-DEAD-BEEFDEAD3010}
WixBinaries.2.0.doc {DEADBEEF-DEAD-BEEF-DEAD-BEEFDEAD3009}
WixBinaries.3.0.doc {DEADBEEF-DEAD-BEEF-DEAD-BEEFDEAD3009}
Templates.UISample {DEADBEEF-DEAD-BEEF-DEAD-BEEFDEAD0014}

Monday, September 8, 2008

Fact Check: InstallAware First and Only to Support SQL Server 2008 and .NET 3.5 Service Pack 1

I received the following boasting claim via email today:

InstallAware 8 is the first and only installation toolkit to support Microsoft's newest technologies released with Visual Studio 2008 Service Pack 1 - Microsoft SQL Server Express 2008, .NET Framework 3.5 with Service Pack 1, and Visual Studio 2008 MFC Runtime with Service Pack 1. We're making this support available in just two weeks after Microsoft released Visual Studio 2008 Service Pack 1 to manufacturing, preserving our tradition of always being[sic] all other vendors to it, including InstallShield!


I found InstallAware's statement very interesting because I've just finished a sprint where I delivered 10 installs in 2 weeks. Each of these installs are components of an SOA based system heavily relying on .NET 3.5 SP1 and SQL Server 2008. It's a brand new product line for our company written by a team that's dedicated to being on the cutting edge of Microsoft technologies.

But how could I have possibly done this work if InstallAware is just now the first vendor ( including InstallShield!! ) to support these technologies?

Easily, I used InstallShield.

As I previously posted, InstallShield has a flexible feature called Prerequisites that allow you to define how to detect and install a component via setup.exe. This is similar to what the WiX team is trying to achieve with burn only InstallShield has had it for years. ( As an aside, burn looks promising, but since it was dropped from WiX release 3.0 due to rosario ship considerations don't expect it to be released for quite a long time to come. ) Using the prerequisite editor, it's a simple 5 minute job to include .NET 3.5 SP1 and the latest MFC runtime ( which we don't use thankfully ) in your install.

Additionally InstallShield's SQL scripts pattern continues to work very well with SQL Server 2008. True, there isn't a dedicated setting that says "Support SQL 2008" but there is a customize checkbox that is far more powerful:



As I've previously posted, don't believe everything you read on the internet.

Thursday, September 4, 2008

Microsoft Application Virtualization 4.5 RTMs

I haven't had time to look more closely at this, but I noticed that Microsoft's Application Virtualization 4.5 product ( formerly SoftGrid ) has RTM'd. Until I have a chance to learn more, here's a link to follow.
Pulling this down and playing with it has to be more productive and interesting then playing Setup Police and berating Google for their setup violations.

Tuesday, September 2, 2008

Google Chrome: Steal this browser

I was reading an interesting article from Ed Burnette at ZDNet:

Google announced a new web browser today called Chrome. Analysts who wonder if this spells “doom” for Firefox, or if it’s an “IE killer” are missing the point. Like Gears, Chrome is Google’s latest attempt to lead by example, and push the envelope of the web experience.


The article includes this comic strip panel from Google:



Now I have such a one track mind sometimes that I couldn't help think about WiX and other setup tools vendors. My observations are that while WiX is open sourced, Rob Mensching tends to get very irritated companies other then Microsoft take his code and turn it into a revenue generating product. Case in point being is his comments aimed at InstallAware when WiXAware was first released. I also happen to know another well known tools vendor is very hesitant to include WiX technology in their product. I also believe that this is not an engineering reason rather a fear of opening a can of worms.

The truth is there are some things in WiX that are very good and it would be really interesting if the Google model could be followed. We'd probably all end up with better tools.