VS2010安装项目迁移问题

发布于 2024-10-14 18:32:38 字数 979 浏览 5 评论 0原文

我已经从 VS2008 迁移到 VS2010。安装 Windows 服务曾经是一件轻而易举的事,但现在这个过程却很糟糕。首先,我升级的安装项目导致 MSI 与 2008 年构建的 MSI 不兼容。实际上有两个原因:组件 GUID 在某处以某种方式更改,这会导致如果您将 MSI 作为更新运行,则大多数 DLL 都会被删除(不是全新安装,这有效......有时,请继续阅读)。 但是,嘿,我使用构建后脚本来更改我的 MSI,这是与 InstallExecuteSequence 表,不用担心...对吧。 其次,您会收到“服务已准备就绪”错误,因为您正在安装的 Windows 服务在更新期间不会停止或删除,但安装程序会尝试在注册表中注册该服务。 但是,嘿,没问题,更改了我的自定义操作以停止服务并删除注册表项(最后一部分通过启动一个新进程来完成非常丑陋,该进程使用一些参数调用 sc.exe,而不显示控制台......很好)。 所以现在我的 Windows 服务升级期间没有错误。是的,关闭票证,继续前进。不太快:因为在复制文件之前服务没有停止,所以当服务准备好运行时,必须重新启动系统才能完成安装。那么现在我们的客户必须重新启动整个服务器,从而导致所有正在运行的进程停机?当然不能接受。

干得好,MS,这在 VS2008 中从来不是问题!您是否尝试过为 Windows 服务制作安装程序?当然希望您正在阅读本文...

抱怨够了,我还有最后期限要完成:如何在复制所有文件之前停止我的服务? 移动 MSI InstallExecuteSequence 表中的某些项目?有谁知道是哪些吗?或者有人知道 MS 修复安装项目可以解决我的问题吗?

I have migrated from VS2008 to VS2010. Installing a Windows Service used to be a breeze and now the procedure stinks. 1st of all, my upgraded setup project result in an MSI which is not compatible with the MSI built with 2008. Two reasons actually: component GUIDs are changed somewhere, somehow, which results in most DLL's being removed if you run the MSI as an update (not fresh install, this works...sometimes, just read on).
But hey, I use a postbuild script to ALTER MY MSI, something todo with InstallExecuteSequence table, no sweat...right.
Second, you get the 'Service allready exists' error, because the windows Service you are installing is not stopped or removed during an update, but the installer does try to register the service in registry.
But, hey, no problem, changed my custom action to stop the service AND remove the registry entries (last part done very ugly by starting a new process, which call sc.exe with some parameters, without showing console...nice).
So now no errors during an upgrade of my windows service. Yeay, close the ticket, move on. Not so fast: because the service is not stopped BEFORE the files are copied, the system has to be rebooted to finish the install when the Service is allready running. So now our customers have to REBOOT theire entire server resulting in downtime of all running processes? Unacceptable of course.

Nice job MS, this never was a problem with VS2008! Did you even try to test making an installer for a windows service? Sure hope you're reading this...

Enough complaining, I have deadlines to make: how to get my service stopped before all files are copied?
Moving around some items in the InstallExecuteSequence table of the MSI? Anyone know which ones? Or does anyone know of a MS fix for setup projects which solves my problems?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

废弃 VS 安装项目并转向 WiX。我在经历了 VS 的设置项目多年的痛苦之后才做到了这一点,并且我花了不到一天的时间来完善我的 WiX 项目并做好生产准备。

您可以首先将现有的 .msi 逆向工程到 WiX 项目中,然后手动编辑它并更改为 WiX UI 对话框,并应用人类可读的名称,而不是 VS 安装程序项目 MSI 中类似长 GUI 的名称。

http://wix.codeplex.com/ 下载 3.5(截至 2011 年 1 月的当前稳定版本) - 您永远不会回头。

Scrap the VS setup project and move on to WiX. I did that after having suffered for years with VS's setup projects, and I spent less than a day on getting my WiX project polished up and production-ready.

You can start by reverse-engineering your existing .msi into a WiX project, then edit it manually and change to the WiX UI dialogs and apply human readable names instead of the long guid-like things from VS installer project MSIs.

Download 3.5 (current stable release as of Jan 2011) from http://wix.codeplex.com/ - you'll never look back.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文