问题标签 [installutil]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
3312 浏览

windows-services - Installutil 一直告诉我“未找到公共安装程序”。有任何想法吗?

我正在尝试安装刚刚在 Visual Studio 2008 中创建的 Windows 服务。Install.log 文件一次又一次地告诉我以下信息:

我的服务有一个安装程序“serviceInstaller1”,它是公共的并且具有正确的服务名称。它还有一个也是公共的 serviceProcessInstaller1。

为什么 InstallUtil 在我的服务程序集中找不到安装程序?

0 投票
7 回答
154847 浏览

c# - 安装在 Visual Studio 中创建的 Windows 服务

当我在 Visual Studio 2010 中创建新的 Windows 服务时,我收到一条消息,说明使用 InstallUtil 和 net start 来运行该服务。

我尝试了以下步骤:

  1. 创建新项目文件 -> 新建 -> 项目 -> Windows 服务
  2. 项目名称:TestService
  3. 按原样构建项目(Service1 构造函数、OnStart、OnStop)
  4. 打开命令提示符,运行“C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe”TestService.exe
  5. 运行net start TestService

步骤 4 的输出

运行事务安装。

开始安装的安装阶段。

查看日志文件的内容以了解 C:\Users\myusername\Documents\Visual Studio 2010\Projects\TestService\TestService\obj\x86\Debug\TestService.exe 程序集的进度。

该文件位于 C:\Users\myusername\Documents\Visual Studio 2010\Projects\TestService\TestService\obj\x86\Debug\TestService.InstallLog。

安装程序集“C:\Users\myusername\Documents\Visual Studio 2010\Projects\TestService\TestService\obj\x86\Debug\TestService.exe”。

受影响的参数是:

登录控制台 =

日志文件 = C:\Users\myusername\Documents\Visual Studio 2010\Projects\TestService\TestService\obj\x86\Debug\TestService.InstallLog

程序集路径 = C:\Users\myusername\Documents\Visual Studio 2010\Projects\TestService\TestService\obj\x86\Debug\TestService.exe

在 C:\Users\myusername\Documents\Visual Studio 2010\Projects\TestService\TestService\obj\x86\Debug\TestService.exe 程序集中找不到具有 RunInstallerAttribute.Yes 属性的公共安装程序。

安装阶段成功完成,提交阶段开始。

查看日志文件的内容以了解 C:\Users\myusername\Documents\Visual Studio 2010\Projects\TestService\TestService\obj\x86\Debug\TestService.exe 程序集的进度。

该文件位于 C:\Users\myusername\Documents\Visual Studio 2010\Projects\TestService\TestService\obj\x86\Debug\TestService.InstallLog。

提交程序集“C:\Users\myusername\Documents\Visual Studio 2010\Projects\TestService\TestService\obj\x86\Debug\TestService.exe”。

受影响的参数是:

登录控制台 =

日志文件 = C:\Users\myusername\Documents\Visual Studio 2010\Projects\TestService\TestService\obj\x86\Debug\TestService.InstallLog

程序集路径 = C:\Users\myusername\Documents\Visual Studio 2010\Projects\TestService\TestService\obj\x86\Debug\TestService.exe

在 C:\Users\myusername\Documents\Visual Studio 2010\Projects\TestService\TestService\obj\x86\Debug\TestService.exe 程序集中找不到具有 RunInstallerAttribute.Yes 属性的公共安装程序。

删除 InstallState 文件,因为没有安装程序。

提交阶段成功完成。

事务安装已完成。

步骤 5 的输出

服务名称无效。

键入 NET HELPMSG 2185 可获得更多帮助。

0 投票
1 回答
2688 浏览

configuration - WIX InstallUtil/InstallUtilLib 和配置文件部署 为什么 InstallUtil 不好?

我经常发现引用“InstallUtil.exe”是一个丑陋的模式或“不要使用 InstallUtil.exe”,我应该使用原生 WIX 或安装包模式,但我仍然不明白为什么。

我不再使用 InstallUtil 来安装 .NET 服务,因为我终于了解到为此类操作编写注册表项应该是不可安装的操作 - 我已经接受了这一点,认为这是正确的。

由于我一直在为一个相对复杂的产品使用 WIX 安装程序,因此我发现自己需要创建或更新 SQL Server 数据库、创建或更新 IIS 应用程序以及最后更新或创建配置文件。

我的每个组件(功能)都是可选的,但它们都共享相同的配置文件。由于我的产品使用统一,重要的是要注意这个库包含对从 Unity 配置块读取/更新/删除组件的强大支持,因此对我来说,我应该通过安装组件(即 InstallUtil ) 在安装时创建或更新我的配置文件。

在这里要清楚一点,我的安装程序本身并不包含我的应用程序的配置文件:在安装时,安装程​​序不知道它的形状,因为它基于所选的功能。当然,我应该将这些知识嵌入到要部署的每个模块中,而不是安装程序的职权范围内,而安装程序现在是一个完全独立的项目?即使我们在谈论安装,这不会破坏 OO 原则吗?

我真的很感激一些关于这是否是好的做法的指导?我是在阅读“InstallUtil”对安装服务不好,还是说使用“InstallUtil”是不好的句号?如果是这样,我有哪些智能更新配置文件的选项?

0 投票
1 回答
3400 浏览

powershell - 从 Powershell 将参数传递给 InstallUtil

我正在尝试从 Power-shell 安装 Windows 服务,如下所示。

我收到以下异常。

但是以下命令有效。

我正在尝试使用动态名称安装 Windows 服务并使用 Power-shell 传递服务名称。任何帮助表示赞赏。

答案对于 VS 2008 是正确的。但在 VS 2012 中会失败。因为 InstallUtil 已修改。

你应该使用 $sn = """" + $serviceName + " " + $exeName + """"

原因是 InstallUtil(2.0) 会自动添加引号,因此我们应该忽略它们(如答案所示)。但是 InstallUtil(4),如果字符串在任何位置包含引号(这是一个错误? - 他们应该检查字符串的开头和结尾是否有引号 - 目前这会破坏所有 2.0 代码),则会跳过此操作。

反射器是你的朋友。

0 投票
1 回答
158 浏览

wix - Can I stop parameters passed to InstallUtil from showing up in the install log?

I have created a custom task that is used to create SQL compact databases as part of setup. When use InstallUtil to execute this task I use a parameter for the (environment specific) password to use when creating the local database. The problem is that the install log contains the unencryped password which is not good from a security standpoint.

Can I stop parameters passed to InstallUtil from showing up in the install log?

0 投票
2 回答
766 浏览

.net - 在 Win 2003 R2 64 位上注册 WMI 事件时出现“找不到文件”

我正在尝试在 Win 2003 R2 64 位服务器上安装包含普通 .Net 程序集的 WMI 事件,但我总是收到此错误:

System.IO.FileNotFoundException:找不到文件“C:\WINDOWS\system32\WBEM\Framework\root\MyApp\WMIEvents\Common\MyApp.MyModule.WmiEvents_SN__Version_1.0.53.0.mof”。

  • 我的用户是管理员
  • 我在具有完整权限的命令提示符下运行 InstallUtil
  • 我正在运行 64 位 InstallUtil

我在这里没有选择,欢迎任何帮助......

完整的 InstallUtil 输出如下:

更新 我一直在用 procmon 浏览,似乎 installutil 正在尝试打开该文件。

0 投票
3 回答
22433 浏览

.net - 如何在没有 InstallUtil.exe vb.net 的情况下安装 .NET windows 服务

我在 vb.net 中创建了一个 Windows 服务。无论如何我可以为它创建一个不需要使用 installutil 的安装吗?

0 投票
1 回答
708 浏览

.net - 我可以 XCOPY 部署 Windows 服务吗?

我有一个已经安装在服务器上的 Windows 服务,并且我有一个新版本的可执行程序和链接程序集。我用于安装新版本的正常程序是:

  1. 停止服务
  2. 使用卸载服务InstallUtil /u
  3. 用新的覆盖服务可执行程序和链接的程序集
  4. 使用安装服务InstallUtil
  5. 启动服务

我在想是不是我做的太多了?仅执行以下操作是否有任何问题:

  1. 停止服务
  2. 用新的覆盖服务可执行程序和链接的程序集
  3. 启动服务

我认为不需要卸载/安装,但找不到任何正式确认。

0 投票
2 回答
5457 浏览

c# - 如何调试自定义 Windows 服务的安装?

我在 C# (4.0) 中创建了一个 Windows 服务,并尝试在命令行中使用 installutil 工具安装它。但是我得到一个例外。我设法找出我的代码的哪一部分导致了异常 - 使用了一些糟糕的日志记录,但无论如何 - 但现在我想了解原因。所以我想做的是调试我的 Windows 服务的安装。

我知道如何调试服务本身,但是在这里,我想在Installer.Install(IDictionary stateSaver)服务中调试我的方法的内容。

我试图将调试器附加到 cmd.exe 进程,但它显然不起作用。我也在考虑将调试器附加到 installutil 进程,但我不知道如何做到这一点。

我看过这篇文章:如何调试正在安装的 Windows 服务?还有其他几个,但在这种情况下,由于某种原因,这个人似乎已经在 services.msc 中提供了他的服务,这不是我的情况。

我怎样才能做到这一点?

0 投票
3 回答
12705 浏览

c# - 使用 Installutil 安装服务

我要在 Windows 上安装 WCF 服务。

现在我想将它安装在运行 Windows 的服务器上并安装了 v3.5 .net 框架。

该服务已在框架 4 中编写,因此它不会运行。

我的问题是我可以使用框架 3.5 中的“installutil”来安装服务吗?为什么?

=== 更新===

我有在里面运行 wcf 的 Windows 服务。