Blog

Installation and MSBuild Fun

As I promised, I’ll be posting entries about work on the new Debugging, Testing, and Tuning .NET Applications. That way you’ll get to see exactly how the sausage is made. 😛 I had a little vacation over the American Memorial Day weekend and an emergency debugging session to handle so here’s a summary of what’s been going on over the last 10 days or so.

As anyone who’s gotten one of my books in the past knows, there’s tons of source code included with the book. This one will not be any different so I wanted to get my source plan in order before I really started adding the code. As I’ve always advocated building the installation first, that’s exactly what I did.

Originally, my intention was to use the very interesting Windows Installer XML Toolset (WiX) as it was open source and my code could serve as an example for others. However, the best plans don’t always work out. While WiX is cool, I quickly realized that 1) the WiX documentation was not complete, and 2) the installation stuff in Windows has gotten massively more complicated than the last time I worked on an installation! In order to use WiX to build my moderately complicated installation, I was going to have to devote a minimum of a month to becoming an installation expert.

Instead, I opted for using Wise for Windows Installer Professional, which is working out quite nicely. The only problems I’ve had with it were related to its licensing. I’m a big believer as running with Least User Access so I logged in as an Administrator to install Wise. Everything went fine, except when I logged back into my LUA main account. Every time I started Visual Studio .NET 2003, I was greeted with an error message that Wise couldn’t find the license file for its VSIP integration. Turns out Wise is licensed on a per user/account basis instead of machine basis and they assume that only folks logged in as Administrators are ever going to be running Visual Studio .NET. I would have been fine with that, but oddly, their installation does not allow you to opt out of installing the VSIP integration at all. (Interestingly, I’ve found the stand alone Wise development tool is outstanding so I would much prefer not to have the IDE integration at all).

After a call to tech support I was given permission to install in both my Administrator and John accounts without breaking the EULA. Overall, I’ve been very happy with the Wise toolset. It’s allowed me to build a decent installation in one percent of the time I would have done with WiX or weak Visual Studio Setup Wizard.

I have had a couple of problems with my installation, but those are all related to the complexity of the Microsoft Installation API.  For example, I wanted the exit page of the installation to offer check box options to start the read me file and connect to the book web site.  I managed to get the check boxes working, by adding them to the exit dialog, but now they are active even if you do a maintenance install or repair.  I haven’t quite figured out how to get them to only appear on normal installation.  If anyone knows how to fix this, shoot me an email (‘john’ care of this company.)

To have something to install, I decided the read me should be in a .CHM file so it would be easier to read and search for specific items.  The HTML Help Workshop works great, but I needed to edit the raw HTML files.  Word’s HTML output is not so great so I broke down and installed FrontPage, (which I last used a million years ago and wasn’t too impressed) because I had it with my MSDN Universal subscription.  The 2003 version, which I’m using right now, certainly is a million times better.  Wow!

After getting the installation and read me going, I turned to the build system.  Not having spent much time with MSBuild, I knew I was going to have to make an investment to get my head around it.  Having been an NMAKE maestro in the past, I had the concepts down, but realized the main learning curve was all the fiddly details.  I wouldn’t call myself an expert yet, but I think I have the hang of it.

The first coding I did was to build a few of MSBuild Tasks I needed.  The first was to wrap HHC.EXE, the HTML Help Workshop help compiler.  The second and third are for automatically generating the build number and the appropriate AssemblyFileVersion source files.  I’ll next tackle a task to handle calling the Wise installer.

The Latest I’m Totally Loving about Visual Studio .NET 2005

  • The new resource editor and autogenerated Resources class are completely and totally heavenly!
  • MSBuild compatible files being used for all projects
  • Pressing enter in an XML Doc comment automatically places the “///” or “”'” on the new line

The Latest Problems I’m Having with Visual Studio .NET 2005 Beta 2

  • It’s got a bit of a memory leak problem. 🙂
  • The FxCop integration does not pick up CustomDictionary.XML
  • Visual Studio Team Test needs some work
    – When you start a test from the IDE, the working directory is off somewhere in the user’s application data folder instead of the directory where the tests are defined so you are stuck hard coding complete paths to any files you want a test case to use. (Yeech!)
    – Code coverage only works if the binary is started from the IDE and under TeamTest.  I haven’t figured out how to get code coverage on my MSBuild Tasks since my test spawns off MSBUILD.EXE, which loads my task so it’s not under the IDE.
    – The usage model is a little more complicated that I think it needs to be.

What’s up Next?

  • Finish off the Wise MSBuild task
  • Finish off master build project
  • Start work on the WinDBG/SOS/ADPlus chapters
  • Set up my new supercomputer box arriving next week! (Think dual processor, dual core). w00t!
John Robbins

View Comments

  • Jonathan,
    I read everything I could find on the web about WiX and especially Rob's blog. Additionally, I nearly memorized everything at: http://www.tramontana.co.hu/wix/! I think my main problem really isn't WiX, but my lack of understanding of the installation API. If you understand the installation API, WiX rocks!
    Even with that said, there's certainly something awesome about Wise's wildcard file adding to your installation. Point your .WSI at a directory and it will automatically add any files matching your widecard specifications (it also includes excludes wildcards). For a ton of source code like I'm doing, this is worth it's weight in gold.
    John.

  • Hey John, I'm not quite sure where else to go with this question, your help would be greatly appreciated.
    Seeing your beautiful MSDN-type documentation for PowerCollections, I'm wondering: How can I generate MSDN-type docs from my .NET 2.0 assemblies?
    email: smtih458[at]msu.edu

  • John,
    Check out Inno Setup http://www.jrsoftware.org. Its free and very very easy to use. The only big drawback is the [code] section uses a Pascal scripting language.
    I was able to make very compilcated installs within a day or two that installs my main product along with other software like MDAC, MSDE and including a custom WebUpdate feature that updates the installer during the installation process. It has a preprocessor built in and the script file is setup like an ini file. After working with XML for the past couple of years it is amazing how simple an ini file looks. <g>
    Simple stuff is easy and the hard stuff can be done with minimal sweat.
    -- Robert

  • Hi John,
    I'm using Wise for VS.Net. I have a batch file that I run during the installation but do not want it to run during maintenance or uninstall. I use the Wise INSTALLED property to check if the application is installed or not. If INSTALLED is false, I run the batch, otherwise it doesn't run. You can add the if statement via the MSI script editor. This should fix your checkbox dialog problem.
    Hope this helps.
    Keith

  • I initially had the same problem with FxCop not picking up CustomDictionary.xml, but I discovered that it works if you drop the file in %USERPROFILE%Application DataMicrosoft FxCop1.312. A potentially sticky point is that it seems to ignore full product names in mixed case since it treats them as separate words. In other words, adding RssBandit had seemingly no effect but adding Rss works.
    As for generating documentation from embedded XML comments, I use the open source NDoc. It works great for creating MSDN style help files from XML comments in one or more assemblies.

Recent Posts

8-Step AWS to Microsoft Azure Migration Strategy

Microsoft Azure and Amazon Web Services (AWS) are two of the most popular cloud platforms.…

2 weeks ago

How to Navigate Azure Governance

 Cloud management is difficult to do manually, especially if you work with multiple cloud…

3 weeks ago

Why Azure’s Scalability is Your Key to Business Growth & Efficiency

Azure’s scalable infrastructure is often cited as one of the primary reasons why it's the…

1 month ago

Unlocking the Power of AI in your Software Development Life Cycle (SDLC)

https://www.youtube.com/watch?v=wDzCN0d8SeA Watch our "Unlocking the Power of AI in your Software Development Life Cycle (SDLC)"…

2 months ago

The Role of FinOps in Accelerating Business Innovation

FinOps is a strategic approach to managing cloud costs. It combines financial management best practices…

2 months ago

Azure Kubernetes Security Best Practices

Using Kubernetes with Azure combines the power of Kubernetes container orchestration and the cloud capabilities…

2 months ago