views:

36

answers:

1

Specifically, SQL Express. I have an internal winform app that, if they have a laptop, needs to install SQL Express to enable certain functionality. Right now I am installing it for everyone as it doesn't 'hurt' the desktop users outside of the time it takes. I would like to have it install SQL after I detect if they are on a laptop.

With Click Once, what are my options? From what I can see, I would need to uncheck SQL Express as a Prerequisite and handle it manually in my startup code. How/Where would I accomplish that?

Is there a better way? If I switch deployment models won't the trade off be a drastic increase in effort/time for Updates?

+3  A: 

Prerequisites are the most misunderstood part of ClickOnce. ClickOnce is just the technology that downloads and syncs files between a client and the server. The bootstrapper (setup.exe) that Visual Studio creates has nothing to do with ClickOnce other than launching the ClickOnce app after it finishes. It's confusing because Visual Studio mashes it all together so everyone thinks they're related.

If you don't want everyone to have SQL Express, then remove it from your Visual Studio prereqs. From there, you can handle it manually in your code as long as your application can start without SQL Express installed. On app startup you can check the registry to see if SQL Express is installed, then download it, and launch the installer. I did this with a Crystal Reports installer and it worked out OK.

whatknott