简体   繁体   English

从Powershell构建MSI软件包

[英]Building an MSI package from Powershell

We are setting up a new Azure DevOps pipeline to deploy our (awful) legacy software to our private server. 我们正在建立一个新的Azure DevOps管道,以将(糟糕的)旧版软件部署到我们的私有服务器上。 Our goal is to use a modified Git Flow process to build and deploy our software for the Dev, Stage, and then Production (or Release) servers. 我们的目标是使用经过修改的Git Flow流程为Dev,Stage,然后是Production(或Release)服务器构建和部署我们的软件。 We are using Cake scripts and Powershell scripts for the building of the different pieces of our software. 我们正在使用Cake脚本和Powershell脚本来构建软件的不同部分。

One of the requirements from my Software Manager is to build MSI packages for our software (at least for the Production builds when we version a new release). 我的软件管理器的要求之一是为我们的软件构建MSI软件包(至少在发布新版本时为生产版本构建)。 There are two problems that arise from this: 由此产生两个问题:

1) Back end software is made up of several projects with all kinds of weird dependencies off of each other (and on external SSIS project which we need to consider as a "black box" outside of our project that I have no control over), and 1 executable which uses most, but not all of the DLLs from the building of the other projects. 1)后端软件由几个相互依存的怪异项目组成(以及外部SSIS项目,我们需要将其视为我无法控制的“黑匣子”), 1个可执行文件,该可执行文件使用其他项目中大多数但不是全部的DLL。

The front end software is a Sitecore project which is simply a bunch of DLLs and files that need to be copied from one place to another with an IIS restart to refresh the servers. 前端软件是一个Sitecore项目,它只是一堆DLL和文件,需要通过IIS重新启动来将其从一个位置复制到另一个位置以刷新服务器。

The back end and the front end will likely have separate Setup projects. 后端和前端可能会有单独的安装项目。 But in each setup project, do I just add in all of the built projects' output to the Application Folder and hope for the best that they all get put in the right output folders on MSI install? 但是在每个安装项目中,我是否只是将所有已构建项目的输出添加到“应用程序文件夹”中,并希望最好在MSI安装时将它们全部放入正确的输出文件夹中?

2) How do I instantiate the build of the Setup project (the project which builds the installer) from Cake Build and/or Powershell? 2)如何从Cake Build和/或Powershell实例化Setup项目(构建安装程序的项目)的构建? I want to make sure this only runs for the Release builds that we build from the master branch. 我想确保这仅适用于我们从master分支构建的Release版本。 Is there an Azure tool I need to be made aware of. 是否需要了解一个Azure工具。

Please be understanding as this is my first full DevOps implementation, I haven't built an .NET installer package in 10 years since school, and my Powershell skills suck (came from a Web development/Linux world). 请理解,因为这是我的第一个完整的DevOps实施,自从上学以来10年来我还没有构建.NET安装程序包,我的Powershell技能也很烂(来自Web开发/ Linux世界)。

Windows Installer XML (WiX Toolset) is a language / compiler that builds MSIs. Windows Installer XML(WiX Toolset)是一种生成MSI的语言/编译器。 It has MSBuild / Visual Studio integration support. 它具有MSBuild / Visual Studio集成支持。 It can easily be built in an Azure DevOps pipeline and doesn't require Cake or Powershell to do do. 它可以轻松地构建在Azure DevOps管道中,并且不需要Cake或Powershell来完成。

I have an open source project called Industrial Strength Windows Installer XML (IsWiX) which builds on top of WiX and provides project templates and graphical designers to assist with most of the WiX development. 我有一个名为Industrial Strength Windows Installer XML(IsWiX)的开源项目,该项目建立在WiX之上,并提供项目模板和图形设计器来协助大多数WiX开发。 When you go past what IsWiX provides you can still author the WiX directly to meet your needs. 当您超越IsWiX提供的功能时,您仍然可以直接编写WiX以满足您的需求。 I have some tutorials at: 我在以下位置有一些教程:

https://github.com/iswix-llc/iswix-tutorials https://github.com/iswix-llc/iswix-tutorials

The IsWiX project templates have built in versioning and major upgrade patterns that automatically integrate with Azure DevOps. IsWiX项目模板具有自动与Azure DevOps集成的内置版本控制和主要升级模式。 It's all explained in the tutorial. 在教程中对所有内容进行了说明。

Your taking on a pretty big task. 您承担着相当大的任务。 Consulting services are available for those interested. 有兴趣的人可以使用咨询服务。

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

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