简体   繁体   English

使用Visual Studio的自定义安装程序

[英]Custom installer with Visual Studio

I need to create an installer for my application that is a Windows Service. 我需要为我的应用程序创建一个Windows服务安装程序。

I want this installer check if the windows service is running before install it. 我希望此安装程序在安装Windows服务之前检查它是否正在运行。 and also check some SQL Server queries. 并检查一些SQL Server查询。

The problem is...I don't know how to execute an pre-install code in Visual Studio Installer. 问题是...我不知道如何在Visual Studio Installer中执行预安装代码。 I'm using VS 2017 我正在使用VS 2017

I want run a code that will check this queries and if the there is a service running before install or upgrade the Windows Service. 我想运行一个代码,该代码将检查此查询以及是否存在在安装或升级Windows Service之前运行的服务。

How can I add a custom Installer with C# code logic in the VS 2017? 如何在VS 2017中添加具有C#代码逻辑的自定义安装程序?

What you're looking for is called "Custom Actions". 您要查找的内容称为“自定义操作”。

Right Click your VS Installer Project > View > Custom Actions. 右键单击VS Installer项目>视图>自定义操作。

This will allow you to execute any code that you like under the context of a variety of installer actions. 这将允许您在各种安装程序操作的上下文中执行所需的任何代码。

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

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