【发布时间】:2016-04-19 22:03:19
【问题描述】:
我在 Visual Studio 2013 中使用 c# 创建了一个窗口服务。 Windows 服务运行良好。
当我创建一个安装项目并在不同的计算机上运行 .msi 文件时,它给了我一个错误
我做的步骤:
1.右键解决方案->其他项目类型->Visual Studio安装程序-安装项目
2.添加名称后文件系统编辑器->选择应用程序文件夹->右键->添加->项目输出->添加项目输出组弹出 项目:选择我的主要输出项目
- 选择自定义动作编辑器 -> 安装 -> 右键单击 -> 添加自定义动作 -> 选择应用程序文件夹和项目输出。
对卸载重复相同的操作
- 构建安装程序。
.msi 和 setup.exe 文件在文件夹中创建。
我看到了 https://www.youtube.com/watch?v=cp2aFNtcZfk 教程来做到这一点。
谁能告诉我如何解决这个问题。
谢谢
编辑:我的项目中有 projectInstaller
namespace certify4byd_ver2._0
{
partial class ProjectInstaller
{
private System.ComponentModel.IContainer components = null;
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();
this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller();
//
// serviceProcessInstaller1
//
this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalService;
this.serviceProcessInstaller1.Password = null;
this.serviceProcessInstaller1.Username = null;
//
// serviceInstaller1
//
this.serviceInstaller1.Description = "Quick Source specific development to allow ftp files to be send to ByDesign envir" +
"onment";
this.serviceInstaller1.DisplayName = "Quick Source Certify4ByDesign";
this.serviceInstaller1.ServiceName = "qs_certify4byd_v2.0";
this.serviceInstaller1.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
this.serviceInstaller1.AfterInstall += new System.Configuration.Install.InstallEventHandler(this.serviceInstaller1_AfterInstall);
//
// ProjectInstaller
//
this.Installers.AddRange(new System.Configuration.Install.Installer[] {
this.serviceProcessInstaller1,
this.serviceInstaller1});
}
#endregion
private System.ServiceProcess.ServiceProcessInstaller serviceProcessInstaller1;
private System.ServiceProcess.ServiceInstaller serviceInstaller1;
}
}
【问题讨论】:
-
看看stackoverflow.com/questions/9021075/… - 你可能错过了什么?
-
@DirkVollmar:不,我没有错过任何东西。
标签: c# visual-studio visual-studio-2010 visual-studio-2012 visual-studio-2013