卸载 VS 安装项目先决条件
我们当前使用 VS 2010(从 2008 升级)安装项目来安装我们的应用程序,并利用 SQL Server 2008 安装先决条件。
您难道不知道吗,管理层已经意识到应用程序安装的所有内容(包括先决条件,但不包括 .net)现在都必须由卸载程序卸载。
所以我试图修改安装程序来卸载 SQL Server Express 2008。
我首先想到我可以修改 sql server 的 package.xml 依赖项来触发正确的安装条件,这样我就可以传递卸载参数,但我不知道这些条件是什么。
然后我考虑使用自定义安装操作和 System.Diagnostics.Process 以编程方式调用具有卸载命令标志的 sql Express 安装程序,但我不确定是否可以保证安装程序能够做到这一点可用于卸载的可执行文件。
有什么想法吗?
We currently use a VS 2010 (upgraded from 2008) setup project to install our application, and utilize the SQL Server 2008 install prerequisite.
Well wouldn't you know, management has got it in their head that everything (including prerequisites, but not .net) that's installed by the application must now be uninstalled by the uninstaller.
So I'm trying to modify the installer to uninstall SQL Server Express 2008.
I first thought that I could modify the package.xml dependency for sql server to trigger the right install conditions so I could pass in the uninstall arguments, but I'm at a loss as to what those conditions would be.
Then I thought about using a custom install action and System.Diagnostics.Process
to programmatically invoke the sql express installer with uninstall command flags, but I'm not sure if I can guarantee that the installer will make that executable accessible for uninstallation.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯,卸载 sql server express 是不好的。如果后来添加另一个依赖于此的应用程序怎么办?您的卸载程序会破坏该应用程序。
不过,管理是正确的:您应该首先卸载您安装的所有内容。
那么解决办法是什么呢?正如他们所说,“如果你这样做,该死,如果你不这样做,该死”。
幸运的是,如果这是针对桌面应用程序,答案很简单:不要使用 Sql Server Express Edition。 Express Edition 实际上是一个服务器级引擎。 Sql Server Compact Edition 更适合这种情况,并将解决您的部署问题。
如果这是针对服务器应用程序,那就有点棘手了。任何行为良好的安装程序都会创建自己的 Sql Server Express 实例。然后,您需要确保仅卸载您的实例(并确保您的安装运行良好)。这并不能真正解决问题,但至少它可以让你说这是他们的错误,而不是你的错误,如果卸载程序运行后出现问题。不幸的是,您仍然必须手动构建这部分。
Um, uninstalling sql server express is bad. What if another application was later added that relies on this? Your uninstaller would break that application.
Management is right, though: you should uninstall everything you installed in the first place.
So what is the solution then? As they say, "damned if you do, damned if you don't".
Fortunately, if this is for a desktop application the answer is simple: don't use Sql Server Express Edition. Express Edition is really a server class engine. Sql Server Compact Edition is much more suited to this scenario, and will solve your deployment issues.
If this is for a server application, it's a little trickier. Any well-behaving installer will create it's own instance of Sql Server Express. You then need to make sure you uninstall only your instance (and also make sure your install is well-behaving). This doesn't really solve the problem, but at least it lets you say it's their bug and not your if something breaks after your uninstaller runs. Unfortunately, you still have to build this part manually.