如何拥有“活力”单击一次先决条件
具体来说,SQL Express
。我有一个内部 winform 应用程序,如果他们有笔记本电脑,则需要安装 SQL Express 才能启用某些功能。现在我正在为每个人安装它,因为它不会在花费的时间之外“伤害”桌面用户。我希望在检测到它们是否在笔记本电脑上后安装 SQL。
对于 Click Once,我有哪些选择?据我所知,我需要取消选中 SQL Express
作为先决条件,并在启动代码中手动处理它。我将如何/在哪里实现这一目标?
有更好的办法吗?如果我切换部署模型,更新的工作量/时间不会大幅增加吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
先决条件是 ClickOnce 最容易被误解的部分。 ClickOnce 只是在客户端和服务器之间下载和同步文件的技术。 Visual Studio 创建的引导程序 (setup.exe) 与 ClickOnce 无关,只是在完成后启动 ClickOnce 应用程序。这很令人困惑,因为 Visual Studio 将它们混在一起,所以每个人都认为它们是相关的。
如果您不希望每个人都拥有 SQL Express,请将其从 Visual Studio 先决条件中删除。从那里,只要您的应用程序可以在没有安装 SQL Express 的情况下启动,您就可以在代码中手动处理它。在应用程序启动时,您可以检查注册表以查看是否安装了 SQL Express,然后下载并启动安装程序。我使用 Crystal Reports 安装程序完成了此操作,效果很好。
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.