开发者

How to have a "dynamic" Click Once prerequisite

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 开发者_JAVA百科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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜