简体   繁体   English

Visual Studio 2017 中的 Windows 安装程序项目

[英]Windows Installer Project in Visual Studio 2017

I've been learning about deployment of various application types (eg. console applications, windows service applications, windows forms, wpf etc) built using Visual Studio 2017.我一直在学习使用 Visual Studio 2017 构建的各种应用程序类型(例如控制台应用程序、Windows 服务应用程序、Windows 窗体、wpf 等)的部署。

In particular I was looking at what I understand are referred to as Setup and Deployment Projects or Windows Installer Setup Projects: https://msdn.microsoft.com/en-au/library/wx3b589t(v=vs.100).aspx特别是我正在查看我所理解的被称为安装和部署项目或 Windows 安装程序安装项目: https : //msdn.microsoft.com/en-au/library/wx3b589t(v=vs.100).aspx

I couldn't locate the Setup and Deployment Projects in Visual Studio 2017 at first.起初我无法在 Visual Studio 2017 中找到安装和部署项目。 However I located an extension to Visual Studio from Microsoft called Microsoft Visual Studio 2017 Installer Projects https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.MicrosoftVisualStudio2017InstallerProjects但是,我找到了来自 Microsoft 的 Visual Studio 扩展,称为 Microsoft Visual Studio 2017 安装程序项目https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.MicrosoftVisualStudio2017InstallerProjects

After installing the extension for Visual Studio I could locate Visual Studio Installer under Other Project Types in the Add New Project window.安装 Visual Studio 扩展后,我可以在“添加新项目”窗口中的“其他项目类型”下找到 Visual Studio 安装程序。 I haven't been able to successfully build an installer however for a project however.但是,我无法为项目成功构建安装程序。

On different occasions and with different solutions using a standard default Windows Form project or a default console application, when I right click the Setup project in the Solution Explorer Window and select build the following happens:在使用标准默认 Windows 窗体项目或默认控制台应用程序的不同场合和不同解决方案中,当我右键单击解决方案资源管理器窗口中的安装项目并选择构建时,会发生以下情况:

  1. A dialog window relating to SQL Management Studio appears with the following出现一个与 SQL Management Studio 相关的对话窗口,其中包含以下内容

    Please wait while Windows configures SQL Server 2008 R2 SP2 Management Studio. Windows 正在配置 SQL Server 2008 R2 SP2 Management Studio,请稍候。

  2. On top of that dialog window a further dialog window appears with:在该对话窗口的顶部会出现一个进一步的对话窗口,其中包含:

    0: Watson 1: 1304 2: STreamSupportFiles 3:streamBinaryToDisk 4:5 5:e:\\sql10_main_t\\sql\\setup\\darmwin\\sqlcastub\\streamca.cpp 6:238 7:sqlcastub.dll 8:sqlrun.msi 0: Watson 1: 1304 2: STreamSupportFiles 3:streamBinaryToDisk 4:5 5:e:\\sql10_main_t\\sql\\setup\\darmwin\\sqlcastub\\streamca.cpp 6:238 7:sqlcastub.dll 8:sqlrun.msi

    and an ok button.和一个确定按钮。

  3. If i pres the ok button on the dialog identified in 2 I end up with a further dialog with a title of SQL Server 2008 R2 SP2 Management Studio.如果我按下 2 中标识的对话框上的确定按钮,我最终会得到一个标题为 SQL Server 2008 R2 SP2 Management Studio 的进一步对话框。 The content of the window is:窗口内容为:

    Error writing to file: Access is denied.写入文件时出错:访问被拒绝。 Verify that you have access to that directory.验证您是否有权访问该目录。 An OK button appears in the window.窗口中出现一个确定按钮。

I'm not sure what "that" directory actually refers to in this context as it wasn't expected.我不确定“那个”目录在这种情况下实际指的是什么,因为它出乎意料。

  1. If I click Ok on the dialog window then I see a Windows Installer dialog window with the message "Preparing to Install" and a cancel button.如果我在对话窗口上单击“确定”,则会看到一个带有“准备安装”消息和一个取消按钮的 Windows 安装程序对话窗口。

  2. After a prolonged period with nothing seemingly occurring, and the Visual Studio main window now having (not responding) as part of its title I ultimately end up clicking the cancel button on the Windows installer dialog.经过很长一段时间似乎没有发生任何事情,并且 Visual Studio 主窗口现在(没有响应)作为其标题的一部分,我最终单击了 Windows 安装程序对话框上的取消按钮。 This results in the installer freezing and ultimately either Visual Studio crashes or has become so unresponsive that I end up terminating it with the task manager.这导致安装程序冻结,最终 Visual Studio 崩溃或变得如此无响应,我最终用任务管理器终止它。

I watched a video in which someone had built a Setup Project for a Windows Service and at no stage did i see the Windows relating to SQL Server or the Windows Installer Preparing to Install window.我观看了一段视频,其中有人为 Windows 服务构建了安装项目,但在任何阶段我都没有看到与 SQL Server 相关的 Windows 或 Windows Installer 准备安装窗口。 I didnt expect to receive any of the mentioned windows, nor Visual Studio to become unresponsive and essentially crash.我没想到会收到任何提到的窗口,也没有想到 Visual Studio 会变得无响应并且基本上崩溃。

I went to Tools > Options > Projects and Solutions and changed the MS build output and log verbosity to Diagnostic, but didnt find anything related to SQL Server 2008.我转到工具 > 选项 > 项目和解决方案并将 MS 构建输出和日志详细程度更改为诊断,但没有找到与 SQL Server 2008 相关的任何内容。

Does anyone have any thoughts as to what may be causing this and how I could resolve?有没有人对可能导致这种情况的原因以及我如何解决有任何想法?

Further, should I perhaps be looking at some other solution/tool to be used for deployment purposes instead of the Setup and Deployment projects?此外,我是否应该考虑其他一些用于部署目的的解决方案/工具,而不是安装和部署项目? Given the nature of the question instead of leaving it at just this perhaps some other questions : 1. Are Setup and Deployment projects still a tool/solution actively used by other developers?鉴于问题的性质,而不是仅仅停留在这个问题上,也许还有其他一些问题: 1. 设置和部署项目是否仍然是其他开发人员积极使用的工具/解决方案? If so, are they extensively used?如果是,它们是否被广泛使用? Or how extensively are they used relatively to other technologies/tools/solutions for deployment?或者相对于其他部署技术/工具/解决方案,它们的使用范围如何?

The problem was resolved on an x64 system by running:通过运行以下命令在 x64 系统上解决了该问题:

regsvr32.exe /u "C:\Program Files (x86)\Common Files\microsoft shared\MSI Tools\mergemod.dll"
regsvr32.exe "C:\Program Files (x86)\Common Files\microsoft shared\MSI Tools\mergemod.dll"

I have the same problem. 我也有同样的问题。 But I am a new developer. 但是我是一个新开发人员。 Can you explain to me a little more the solution please? 您能再给我解释一下解决方法吗?

Gilles Payette 吉尔斯·佩耶特(Gilles Payette)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM