Visual Studio 2005 ->2008/10 服务安装程序项目升级问题 [英] Visual Studio 2005 -> 2008/10 Service Installer Project Upgrade issue

本文介绍了Visual Studio 2005 ->2008/10 服务安装程序项目升级问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将 [.vdproj MSI 生成器项目内置到 VS2008] System.Configuration.Install.Installer 与 ServiceProcessInstallerServiceInstaller 从 Visual Studio 2005 升级到2008. 没有对安装程序类的后果进行自定义(即,不尝试启动或停止服务或注册子项)

RemovePreviousVersions 设置为 true,我正在更改 VersionProductCode.这会在安装过程中触发错误:

错误 1001:指定的服务已经存在"

谷歌搜索产生的东西(但直到现在还没有):- Google 搜索指定的服务已经存在"
迄今为止我见过的最有用的是 http://forums.msdn.microsoft.com/en-US/winformssetup/thread/b2d1bd22-8499-454e-9cec-1e42c03e2557/但这并不能回答基本问题:-

鉴于用户可以选择:
a) 相同的安装位置
或 b) 不同的安装位置
为了确保卸载旧服务并安装新服务,明智地做出哪些最小的代码更改?或者,对于将 v1.0.1 升级到 v1.0.2 的同名服务的基本场景(即签名),是否需要更改代码才能解决此问题

(AIUI 强命名仅在旧安装程序中具有重要卸载步骤而新安装程序中没有的情况下才会发挥作用.)

我在 VS 2008 中生成了一个新的安装程序,但效果并不好.

目前,我的解决方法是停止更新 VersionProductCode,强制用户在被告知他们已经安装了某个版本时手动卸载.

附录感谢 ​​divo 的 探测:虽然可能有效的最简单的 hack 是说如果调用了安装步骤& 它是一个升级,首先调用服务的卸载步骤",我想要一个适当的官方祝福答案!(例如,当服务在升级过程中被重命名时,简单的 hack 如何应对?)

解决方案

这应该能回答你的问题

如何消除指定的服务已经存在"当我安装新版本的软件时?

I've upgraded a [.vdproj MSI generator project built into VS2008] System.Configuration.Install.Installer with a ServiceProcessInstaller and a ServiceInstaller from Visual Studio 2005 to 2008. There are no customisations of consequence to the installer class (i.e., not trying to start or stop services or register children)

RemovePreviousVersions is set to true, and I'm changing the Version and ProductCode. This triggers an error during the install:

"error 1001: the specified service already exists"

Googling yields stuff (but not on SO until now):- Google for "The specified service already exists"
The most useful one I've seen to date is http://forums.msdn.microsoft.com/en-US/winformssetup/thread/b2d1bd22-8499-454e-9cec-1e42c03e2557/ however this doesn't answer the fundamental question:-

Given that the user can pick either:
a) an install location that's the same
or b) an install location that's different
what are the minimal code changes would one sensibly make to ensure that the old service gets uninstalled and the new one gets installed? Or is there something other than a code change required to resolve this for the basic scenario of upgrading v1.0.1 to v1.0.2 of the same service with the same name (i.e., signing)

(AIUI the strong naming only comes into play if one has a significant uninstall step in the old installer that you dont have in the new one.)

I generated a new installer in VS 2008 and it fares no better.

For now, my workaround is to stop updating the Version and ProductCode, forcing the user to manually uninstall when they are told they already have a version installed.

Addendum thanks to divo's probing: While the simplest hack that could possibly work is to say "if install step is called & its an upgrade, call the uninstall step for the service first", I'd like a proper officially blessed answer! (e.g., how does the simple hack cope when the service is being renamed during an upgrade?)

解决方案

This should answer your question

How do I eliminate "The specified service already exists" when I install new versions of my software?

这篇关于Visual Studio 2005 ->2008/10 服务安装程序项目升级问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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