简体   繁体   English

Visual Studio 2017 中应用程序的自定义安装程序

[英]Custom installer for application in Visual Studio 2017

I need to generate an installer for my application but first I need to know if it is already installed on the system node.js, npm and other applications我需要为我的应用程序生成一个安装程序,但首先我需要知道它是否已经安装在系统 node.js、npm 和其他应用程序上

Is it possible to include the installation of node.js within the installation of my application and to know if it is already installed?是否可以在我的应用程序安装中包含 node.js 的安装并知道它是否已经安装?

I'm using Visual Studio 2017 and a WPF project for desktop applications我正在使用 Visual Studio 2017 和桌面应用程序的 WPF 项目

When the application is already installed I need to execute npm commands in the console for this reason I need to install them before or verify if they are installed correctly当应用程序已经安装时,我需要在控制台中执行 npm 命令,因此我需要先安装它们或验证它们是否安装正确

I appreciate any help.我很感激任何帮助。

UPDATE : Advanced Installer : How to install a NodeJS web app .更新高级安装程序How to install a NodeJS web app Really excellent videos IMHO.真的很棒的视频恕我直言。


Best Effort : I don't know much about Node.Js , and hence should not answer.尽力而为:我对Node.Js了解不多,因此不应该回答。 But I haven't seen anyone else answering these questions either.但我也没有看到其他人回答这些问题。 Despite lacking experience, let me try to give a few suggestions.尽管缺乏经验,让我尝试提出一些建议。

Windows Installer : There seems to be an MSI you can use to deploy Node.Js . Windows 安装程序:似乎有一个 MSI 可用于部署 Node.Js。 And there are some alternatives listed .并且列出了一些替代方案 (Essentially Chocolatey and Scoop). (基本上是巧克力和勺子)。

Heads-Up : I have answered a more specific deployment question relating to a failed installation of the Node.Js MSI earlier: Node.js installation (windows installer) terminates prematurely on windows 10 64-bit .注意事项:我之前回答了一个与 Node.Js MSI 安装失败有关的更具体的部署问题: Node.js 安装(Windows 安装程序)在 Windows 10 64 位上过早终止 This may or may not be fixed.这可能会或可能不会被修复。

Deployment : To deploy a prerequisite MSI before your own package installation, you can use a deployment tool capable of bootstrapping / sequencing / downloading - in other words to run several installation operations in a given sequence wrapped as a setup.exe .部署:要在您自己的软件包安装之前部署必备的 MSI,您可以使用能够bootstrapping / sequencing / downloadingdeployment tool - 换句话说,以包装为setup.exe的给定顺序运行多个安装操作。 Or you could investigate the Chocolatey approach .或者您可以调查Chocolatey 方法 With regards to the deployment tools, I am a bit tired of writing up the list of capacities these tools have and don't have.关于部署工具,我有点厌倦了写出这些工具具有和不具有的功能列表。 I will link to a few flavors of answers for this:为此,我将链接到一些答案:

Prime Suspects :主要嫌疑人

One of the above tools should be able to do the job.上述工具之一应该能够完成这项工作。 Only WiX Burn is free and open source.只有 WiX Burn 是免费和开源的。 Sometimes you can save a lot of time by going with a commercial tool.有时,您可以通过使用商业工具来节省大量时间。 Obviously especially if your company already have a license for such a tool (which can be a days work to figure out).显然,特别是如果您的公司已经拥有此类工具的许可证(这可能需要几天的时间才能弄清楚)。

Free Tools : In the realm of free-tools only and alternatives to WiX, some people use self-extracting archives made with 7-Zip and WinRAR and some other tools described here: Combine exe and msi file in one installer .免费工具:在仅限免费工具和 WiX 替代品的领域中,有些人使用 7-Zip 和 WinRAR 制作的自解压档案以及此处描述的其他一些工具:将exe 和 msi 文件合并到一个安装程序中 I don't like this for security reasons and other reasons as explained in the link.出于安全原因和链接中解释的其他原因,我不喜欢这个。

Simplicity : For corporate deployment a simple batch file or some custom construct distributed via your deployment system (SCCM, etc...) could suffice.简单性:对于企业部署,一个简单的批处理文件或通过部署系统(SCCM 等)分发的一些自定义构造就足够了。 Or even a zip with an embedded batch file to kick off your zipped installers in sequence could work.甚至一个带有嵌入式批处理文件的 zip 也可以按顺序启动您的压缩安装程序。 All depends on your scenario.一切都取决于您的场景。 I wouldn't roll with such an approach for global distribution.我不会采用这种全球分销方法。

And here are several other answers where I describe available deployment tools :以下是我描述可用部署工具的其他几个答案:


Some Links :一些链接

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

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