安装自定义Windows服务时出现错误1001 [英] Error 1001 when installing custom Windows Service

查看:155
本文介绍了安装自定义Windows服务时出现错误1001的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个在Framework 4.0上运行并在VS 2015中运行的Windows服务. 我还创建了一个安装项目(免费的Installshield版本).

I wrote a windows service that runs on Framework 4.0 and running in VS 2015. I also created a setup project (free Installshield version).

我的服务在安装后未显示在services.msc下,因此根据一些其他帖子,我不得不将InstallShield中的主输出标记为安装程序类",但是当我这样做时,运行时出现错误1001 setup.exe.

My service did not show under services.msc after I installed it, so according to some other posts I had to mark the Primary Output in InstallShield as 'Installer Class', but when I do that I get Error 1001 when I run the setup.exe.

帖子指出错误代码1001总是表示安装程序类自定义操作失败."而且我不应该使用自定义操作.我目前不使用任何自定义操作.

This post states that "Error code 1001 ALWAYS means a failure in the Installer class custom action." and that I should not use Custom Actions. I'm not using any custom actions at the moment.

此站点上的大多数解决方案都具有Installshield 2010的说明,而这些步骤不适用于2015.

Most of the solution on this site have instructions for Installshield 2010, and the steps does not work for 2015.

该错误同时出现在我的开发机和所有客户端计算机上. 有什么建议吗?

The error appears on both my dev machine as well as all client machines. Any suggestions?

事件查看器显示无法创建还原点(进程= C:\ Windows \ system32 \ msiexec.exe/V;描述=已安装我的应用程序名称;错误= 0x80070422).

The event viewer displays "Failed to create restore point (Process = C:\Windows\system32\msiexec.exe /V; Description = Installed My App Name.; Error = 0x80070422).

推荐答案

我发现了一些可以解决该问题的方法,但是它确实创建了一个新问题,尽管这是一个更为简单且不那么关键的问题.

I found something to get rid of the problem, but it does create a new question, albeit a much simpler and less critical one.

引起我问题的原因是我不得不从ServiceInstaller的AfterInstall中删除以下代码:

What caused my problem is that I had to remove the following code from my ServiceInstaller's AfterInstall:

new ServiceController(ServiceInstaller.ServiceName).Start();

此内容已添加,可在安装后自动启动我的服务.现在,我将手动启动该服务.

This was added to auto start my service once it has been installed. For now I will just manually start the service.

这篇关于安装自定义Windows服务时出现错误1001的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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