Blog Home 
public interface IGrocholski - Friday, February 23, 2007

RSS 2.0 Atom 1.0 CDF  
 
Sign In
 
 Friday, February 23, 2007

Service Pack 2 for all editions of SQL Server 2005 was released on Monday. Unfortunately for us .NET developers, the Visual Studio Bootstrapper we were hoping would ship with the release did not. Mike on the SQL Server Express team is working on it and hopes to release it by mid March. You can read more on his work here.

I'm not a patient guy so I decided to create my own. (After all, shouldn't I, since I've been raving about the bootstrapper as of late?)

Here's what it does:
1. Check if SQL Express is installed
2. If SQL Express is not installed, it install SQL Express SP2
3. If SQL Express RTM is installed, it upgrades RTM to SP2
4. If SQL Express SP1 is installed, it upgrades SP1 to SP2
5. If SP2 or later is installed, it does nothing

These checks are performed by my SqlExpressSP2 application. All these does is read the CurrentVersion value of the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\SQLEXPRESS\MSSQLServer\CurrentVersion registry key.

I tested the boostrapper on installs on Windows XP SP2 and Windows Vista business. The installs worked without problem. I created an installer for the bootstrapper, but it's file size was over 55Mb, a little to big to dump on the blog. So, if you want a the bootstrapper you'll need to create it yourself via the following steps:

1. Create the following directory: [drive]:\[program files]\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\SqlExpressSP2.

2. Copy these files to the folder created in step 1 above:
     2.1. product.xml (.55 KB)

     2.2. SqlExpressSP2Chk.exe (16 KB)

3. Download SQL Server 2005 Express Edition Service Pack 2 from the download page

4. Create the following directory Create the following directory: [drive]:\[program files]\Microsoft Visual Studio 8

\SDK\v2.0\BootStrapper\Packages\SqlExpressSP2\en.

5. Copy the following files to the the direction created in step 4 above:
     5.1. SQLEXPR32.EXE (downloaded in step 3 above)

     5.2. package.xml (9.61 KB)

     5.3. eula.txt (8.03 KB)

To use the bootstrapper follow the steps:

1. Fire up Visual Studio 2005.

2. Create a Setup and Deployment project.

3. Go to the Projects menu and click Properties.

4. Click the Prerequisities button.

5. You should see an entry in the prerequisites list for SQL Server Express Edition SP2.

6. Select the prerequisite(s) you want and select the "Download prerequisites from the same locations as my application" option.

7. Click OK.

8. Click Apply and OK.

9. Build you Setup and Deployment project.

10. SQL Server Express 2005 SP2 will now be deployed with your application.

Hope this helps.

ag

2/23/2007 7:19:01 AM (Central Standard Time, UTC-06:00)  #    Comments [3]   .NET Development | Tools  |  Trackback
 Tuesday, February 13, 2007

In order to verify the integrity of a package file the Visual Studio Bootstrapper keeps track of either a Hash or PublicKey value.  These are indicated by attributes in the Bootstrapper package manifest. However, what if you don't know the Hash or PublicKey value? I ran into this situation recently when creating a Bootstrapper for a third part application I needed to include with my application. To resolve the issue I created a couple of utilities that will determine the Hash and PublicKey of a given file (if signed). I then put these values into the bootstrapper's package.xml file and everything worked as expected.

Here's the file containing the utilities: blogs.rba.agrocholski.20070213.001.file.001.zip (75.71 KB)

ag

2/13/2007 12:17:15 PM (Central Standard Time, UTC-06:00)  #    Comments [0]   .NET Development | Tools  |  Trackback
 Thursday, February 08, 2007

One of my favorite features in Visual Studio 2005 is the new Bootstrapper functionality. You can get an overview of it here. In short, it replaces the merge modules of old. It allows you to make your application a prerequisite that you can then bundle with other applications.

When you dig into it, you'll see that it's essentially based on a couple of xml configuration files (package.xml and product xml). These configuration files allow you to specify which files to include in te bootstrapper, any prerequisites required by your application, and and any install checks (i.e. registry key evaluation) that needs to be performed during install.

Managing these config files isn't the easy of things as their schemas aren't well documented. However, David Guyer has created a tool that can help you modify and created these xml files. You can get the tool here. One word about the tool, I've usually had to tweak the files generated by this tool to get everything to work properly.

So, you may be asking yourself "Why would I really want to use this?" Well, I can name two instances off hand were it's come in handy for me.

1. I needed to install a named instance of Sql Server Express with network connectivity enabled. To do this, I tweaked the package.xml and product.xml files for the SQL Server 2005 Express Edition bootstrapper that comes with Visual Studio.

2. I needed to install Sql Server Express SP1. This required the creation of a custom bootstrapper from scratch. This wasn't to hard but I also had to create an application that would determine if Sql Server Express was installed, and if it was install which version. If Sql Server Express was not installed or Sql Server Express RTM was installed SP1 would then be installed. If not, the installation is bypassed.

There are a number of other uses for this unheralded feature. Take a look at it when you have the time.

ag

2/8/2007 9:53:44 PM (Central Standard Time, UTC-06:00)  #    Comments [0]   .NET Development | Tools  |  Trackback
 Wednesday, January 31, 2007

A while back Mike posted a link to all the various keyboard shortcuts in visual studio. Rob Caron recently posted some nice artwork that includes some of the shortcuts. While it doesn't have everything, it can come in pretty handy (ok - bad pun).

ag

1/31/2007 8:00:36 AM (Central Standard Time, UTC-06:00)  #    Comments [0]   .NET Development  |  Trackback
 Thursday, January 25, 2007

We agree, I hope, that test driven development is one of the founding pillars of solid software construction. However, have you ever been on a project that contained so many dependencies that you found yourself writing more configuration and tear down code than actual unit tests?

For example, a typical scenario these days has a database, a web app, some web service, and a windows app. The web app updates the database and the client app calls the web service to pull down data. However, how do you adequately test the client code that calls the web service. Do you write a bunch configuration code to have the web app insert data? But what if the data already exists? You'll need to write more configuration code to clean out the database. Ok, maybe you could write a couple of lines to drop the database and attach an .mdf file. Or...

Wait a minute, is this really unit testing? No, it's integration testing. All you want to do is test the client code that calls the web service. You don't care what the web service does. Enter mock objects. By using mock objects you can eliminate the dependencies by mocking them. Essentially what you do is interecept calls to the real objects and substitute mock objects in their place. This gives you the power to control what gets returned from your calls and allows  you to actually test your objects without having to worry about dependencies.

I've used a number of mock objects over the past year or so, including EasyMock.NET, Rhino Mocks , TypeMock, and  NMock. Of these NMock has been my favorite. Unlike the mock object frameworks in order to mock an object with NMock you must define an interface that the object implements. A little more work, but this a good practice anyway. Best of all NMock is free.

So, if you want to make implementing test driven development easier try mocking something (just not me).

ag

1/25/2007 4:08:36 PM (Central Standard Time, UTC-06:00)  #    Comments [0]   .NET Development | Tools  |  Trackback
Copyright © 2008 RBA Consulting.