从ClickOnce更新中排除文件. [英] Exclude a file from ClickOnce updates.

查看:120
本文介绍了从ClickOnce更新中排除文件.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

您可以使用ClickOnce从更新中排除某些文件吗?
我不想更新例如本地数据库(因此它再次为空).

谢谢.

Hello,

Can you exclude certain files from an update with ClickOnce?
I don''t wanna update for example the local database (so it''s empty again).

Thanks.

推荐答案

处理此问题的最佳方法之一是在用户首次运行应用程序时复制文件.
该解决方案也适用于UAC和多个用户(不共享数据).

当应用程序要使用该文件时(通常在我的文档"的子目录中),如果数据库文件不存在,则可以复制与应用程序一起安装的空文件.
One of the best way to handle this would be to copy the file the first time the user run the application.

That solution also works nicely with UAC and multiples users (that don''t share the data).

When the application want to use the file (typically in a subdirectory of "My documents"), if the database file does not exists, then you copy the empty file that was installed with your application.


对于数据库,如果尚不存在,则在运行时创建文件甚至可能是更好的解决方案.

此方法有2个优点:

  • 安装文件通常会更小,这对于小型应用程序来说尤其有趣
  • 如果通过代码创建多个数据库,则支持多个数据库会更容易
For database, it might even be a better solution to create the file at run-time if it does not yet exist.

There are 2 advantages to this method:

  • The setup file will typically be smaller which is interesting particulary for small application
  • It is somewhat easier to support multiple databases if they are created by code


这篇关于从ClickOnce更新中排除文件.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆