简体   繁体   English

在Visual Studio中创建自定义安装程序,以允许单独安装客户端和服务器

[英]Creating Custom installer in visual studio that allows separate installation for Client and Server

I have been planning to create a installer using the "Setup Project" included in visual studio. 我一直在计划使用Visual Studio中包含的“安装项目”来创建安装程序。 I want to create this in such a manner that it allows separate Client/Service installation using a single MSI file. 我要以允许使用单个MSI文件进行单独的客户端/服务安装的方式创建此文件。 Can anyone guide me the right direction/Steps to follow. 谁能指导我正确的方向/要遵循的步骤。 To elaborate it a bit more the client application will be a desktop application and the server app will be windows service. 更详细地说,客户端应用程序将是桌面应用程序,服务器应用程序将是Windows服务。

In general, you add a RadioButtons (2) dialog to your setup from the canned list, and make the user choose one, or checkboxes if both are allowed. 通常,您可以从固定列表中向您的设置中添加一个RadioButtons(2)对话框,并让用户选择一个,如果允许两者都选择,则请选中复选框。 If it's radio buttons, there's a property BUTTON2 which will be 1 or 0 depending on which was selected. 如果是单选按钮,则有一个属性BUTTON2,根据选择的内容为1或0。 Then each file for client or server you set a condition BUTTON2=1 as appropriate. 然后,为客户端或服务器的每个文件设置适当的条件BUTTON2 = 1。

There are some nasty gotchas. 有一些讨厌的陷阱。 One is that a repair will go through reinstall and the value of BUTTON2 will be undefined so you'll get unexpected results. 一种是修复将通过重新安装进行,并且BUTTON2的值将不确定,因此您会得到意想不到的结果。 One way to deal with this is to create a registry item with the value [BUTTON2] so that the value is saved in the registry, then you can add a search for that value to re-initialize it in case of repair. 解决此问题的一种方法是创建一个值为[BUTTON2]的注册表项,以便将该值保存在注册表中,然后您可以添加对该值的搜索以在维修时重新初始化它。

VS setups don't have a good way of doing this because they don't have multiple features that you can choose from, and that can be modified by going into Programs&Features and changing them. VS设置没有一个好的方法,因为它们没有可供选择的多种功能,可以通过进入“程序和功能”并进行更改来对其进行修改。 VS setups all have a single feature, so all you can do is condition the files/components being installed based on checkboxes and radio buttons. VS设置都具有一个功能,因此您所要做的就是根据复选框和单选按钮来限制要安装的文件/组件。

The properties window of every file being installed (Solution Explorer pane) includes a Condition property. 每个要安装的文件的属性窗口(“解决方案资源管理器”窗格)都包含一个Condition属性。 Selecting the file in Solution Explorer then doing F4 shows the properties window. 在解决方案资源管理器中选择文件,然后执行F4,将显示属性窗口。

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

相关问题 安装前运行自定义操作 - Visual Studio 安装程序 - Running Custom Action before installation - Visual studio installer 使用Visual Studio的自定义安装程序 - Custom installer with Visual Studio 在Visual Studio 2013中创建安装程序 - Creating installer in Visual Studio 2013 安装后使用“Microsoft Visual Studio 安装程序项目”安装 FTDI 驱动程序(自定义操作) - Using "Microsoft Visual Studio Installer Projects" to Install FTDI Driver after Installation (Custom Action) Visual Studio安装程序未创建.msi文件 - Visual Studio Installer not creating .msi file 在 Visual Studio 2022 上为 windows 服务创建安装程序 - Creating an installer for a windows service on Visual Studio 2022 在Visual Studio安装程序中更改安装路径(应用程序文件夹) - Changing the Installation Path (Application Folder) in Visual studio installer 使用Visual Studio创建链式安装 - Creating a chained installation using Visual Studio 通过保持先前版本安装的数据库完整来更新安装程序-Visual Studio安装程序 - updating Installer by keeping the DB of the previous version Installation intact - Visual Studio Installer 使用Visual Studio为数据库安装程序创建升级补丁 - Creating upgrade patch for database installer using visual studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM