MSI 与 nuget 包:哪个更适合持续交付? [英] MSI vs nuget packages: which are is better for continuous delivery?

查看:34
本文介绍了MSI 与 nuget 包:哪个更适合持续交付?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我们讨论以下主题.目前正在使用 xcopy 方法部署应用程序.这种方法使管理依赖项、文件更新等变得困难.有想法在一些包的帮助下开始应用程序部署,就像在 Linux 中一样RPM,但适用于 Windows.

所以我有一个问题:在 windows 经典 windows 安装程序 (msi) 或 nuget 或其他东西上使用什么包系统更好?

解决方案

Ad-Hoc:如何避免 WiX/MSI 部署解决方案中的常见设计缺陷?

  • 对 MSI 文件中发现的常见问题的非常混乱且不太理想的临时摘要.不是很好.有总比没有好?书上没有的东西(太乱了).

<块引用>

重要话题:如何避免在我的 MSI 中意外分发敏感信息?

<块引用>

Need For Speed:WiX 快速入门短版


WiX &微星:

<块引用>

MSI 是公认的企业应用标准.它具有一些主要的企业优势(和简短、简洁的版本) 与旧部署相比技术.WiX 是创建 MSI 文件的全新开源方式.

其他工具:

<块引用>

Hello World &你好 WiX:

<块引用>

视频样本:

<块引用>

更多示例代码:

<块引用>

WiX 快速入门:以下是我发现的一些最佳示例代码链接:

最后:

调试:始终检查所有事件日志应用程序日志MSI日志 - 如果可用.顺便提一下.并使用任何可用的调试工具并在执行任何其他操作之前谷歌搜索确切的错误消息.

并检查是否有任何明显缺失的运行时.例如:.Net.Net CoreJavaSilverlightDirect XVC++ RuntimeMS-XML(旧版)、 等....

<块引用>

自定义操作调试:

MSI 日志记录:

事件查看器:

  • 按住Windows 键,点击R,输入eventvwr.msc,然后按Enter.
  • 转到 Windows 日志 =>应用程序.查找 MsiInstaller 事件.
  • 也检查其他日志(SecuritySystemConfiguration代码>).

一般调试:

调试工具:

错误代码:查找错误代码和异常消息.


<块引用>

部署助记符:考虑部署问题的一般助记符:什么是锁定(使用中, 恶意软件)、阻止什么(权限、防病毒、安全工具)、损坏的内容(磁盘、恶意软件、配置、加密)<代码>什么是意外系统状态(磁盘空间、时间和日期设置、语言、许可、Windows 补丁状态、路径太长、PendingFileRenames 等...),什么是不兼容的产品(不能共存的东西),什么是无法访问或配置错误的(什么指向了错误的位置和资源:网络服务器名称、磁盘路径、URL、数据库、服务、UAT 环境、PROD 环境等...)最后但并非最不重要的:<代码>缺少什么(运行时、资源图像、设置文件等...)?


<块引用>

注意:总是第一(下面的第 8 步):Google 确切的错误消息.

启动调试的快速失败:1) 重启2) 禁用防病毒3) 以管理员身份启动并检查,4) 检查依赖项和运行时(JavaVC++ Runtime.NET等等...).然后,如果需要:5) verbose log, 6) 事件日志7) 尝试虚拟 如果仍然无法正常工作?(许多虚拟机缺乏必要的运行时 - 检查)还是 辅助计算机? 还有 8) google 确切错误消息 并检查用户评论,9) 为有问题的应用程序运行更新?(新安装程序可以消除错误情况).10) 是否也要对恶意软件 进行全面检查?这几天到处都是.11) 某些软件(通常是服务器软件)可能需要整理配置设置(misconfiguration).桌面应用程序可能需要 license 才能启动.


<块引用>

锁?:获得许可和锁后,您可以尝试以提升的权限运行该工具吗?您可能有磁盘损坏 - 磁盘错误?ACL 权限错误?(可能的).您的反病毒套件已锁定 MSI 试图放回原位的某些文件.您可以尝试暂时禁用它以查看.请注意,该文件也可以被隔离(移动到其他地方).


通用技巧? - 消费者问题,安装 setup.exe 失败:

对于无法正确安装的设置.下面的一些通用技巧 - 除了检查事件日志安装-应用程序日志谷歌搜索任何错误消息(也总是这样做——也许是先——但也许只是先重启——在面对所有的复杂性之前):

<块引用>

  1. 重启:安装失败后首先重启,看看是否能解决锁定和挂起的重命名问题.
  2. 其他计算机:尝试在另一台物理机器上安装?
    • 安装介质的重要烟雾测试!
  3. 虚拟:尝试在虚拟机上安装?
    • 经常过时,检查运行时,检查 Windows 更新.
  4. 运行时:确保在所需版本中包含所需的各种类型的运行时:
  5. 辅助帐户:尝试使用不同的管理员帐户在主机上安装.这可以解决由用户个人资料中的错误引起的问题(这种情况并不少见).
  6. 本地安装文件:如果安装文件在调用时位于网络上,则将它们复制到本地(以消除网络错误源).
  7. 本地化问题:以其他语言提供的设置包含原始安装程序(通常是英语)中没有的全新错误并不少见.
    • Murphy Field":我们已经设法在英文版之外的国际化设置中添加了额外的错误".哦,人类说!无赖.
    • 尝试下载英文安装版本并测试安装?
    • 在英文机器或虚拟机上尝试本地化设置?
    • 还调查使用不同语言设置的另一个用户帐户运行.

Setup.exe - 再次 - 常见的拦截器":

<块引用>

  1. 损坏的安装文件:损坏的安装文件.重新下载确定?在浪费一整天之前将其作为第一步完成吗?正确的平台位数?正确的 CPU 架构?
  2. 恶意软件:恶意软件几乎可以导致任何事情"在问题方面.
  3. 安全软件:防病毒防火墙scannersetc... 可能会干扰安装.如果可能,请在需要时暂时禁用.
  4. 磁盘空间:确保足够的磁盘空间!
  5. 代理:如果有网络要求,是否有阻止事物的代理服务器?
  6. 政策:托管网络上可能有一些有效的政策来阻止某些使安装无法进行的功能.试试虚拟?通常限制较少.
  7. 磁盘错误:扫描磁盘以查看是否正常.如果没有,请先修复它.对于没有 UPS 的台式机,现代 NVMe 磁盘可能会因断电而丢失大量数据.
  8. 磁盘安全 ACL:自定义安全 ACL(NTFS 访问配置)配置会导致 Windows 组件和类似软件的运行时错误.永远不要对 Windows 目录使用自定义 ACL,除非您知道自己在做什么.错误是肯定的.

一些链接:


轻松访问:

重新打包、应用程序启动调试:

升级:

其他一些 WiX 链接:


程序:

  • 打开临时文件夹:Windows 键 =>点击 R =>类型:%TEMP% =>按:回车.
  • ARP:去开始 运行 appwiz.cpl ENTER 以打开添加/删除程序小程序(或单击控制面板中的添加/删除程序).
  • 设置 GUI Win8/10:Windows 键 + 点击 I =>Apps &Features.Select entry and uninstall.
  • Quick start of Powershell: hold Windows key, tap R, type in "powershell" and press Enter.
  • Restart Graphics Driver: Windows key + Ctrl + Shift and tap B.

Some good starting links to learn Wix:

Extract Files from Setup.exe WiX Bundle or from an MSI file itself:

As I wrote in my suggested "Wix quick start" post above: Wix is hands-on. Just focus on simple, but complete real-world samples like the one from Codeproject - reading the documentation alone is likely to be merely confusing.

Focus on splitting your application into components and set up a major upgrade. Use one file per component as a rule of thumb, and read this answer for a better understanding of component creation: Change my component GUID in wix?

A major upgrade is the most commonly used upgrade mechanism for deployed software (the other common upgrade type is minor upgrade). It is obviously crucial that you can upgrade what you have deployed already. Get upgrade scenarios working before you deploy your first software version so you have confidence in your deployment solution.

Once you got your components set up and your upgrade solution is working, the rest of the pieces fall into place as you work your way through your application's deployment requirements and check for samples on the Wix tutorial site: https://www.firegiant.com/wix/tutorial/.

For those writing Wix code directly (without a GUI editor), I suggest you check this answer for a way to keep your source files terse: Syntax for guids in WIX?

Further read:

Let's discuss following topic. There is application which currently is being deployed with good to know xcopy method.This approach makes difficult to manage dependencies, file updates etc. There is idea to start application deployment with help of some packages, you know like you do in Linux with help of RPM, but for Windows.

So I have question: what package system is better to use on windows classic windows installer (msi) or nuget or something else?

解决方案

Ad-Hoc: How do I avoid common design flaws in my WiX / MSI deployment solution?

  • a very messy and less-than-ideal ad-hoc summary of common problems found in MSI files. Not great. Better than nothing? The stuff that is not in the books (too messy).

Important Topic: How do I avoid distributing sensitive information in my MSI by accident?

Need For Speed: WiX Quick Start Short Version


WiX & MSI:

MSI is the accepted corporate application standard. It has some major corporate benefits (and the short, concise version) compared to legacy deployment techniques. WiX is the new open source way to create MSI files.

Other Tools:

Hello World & Hello WiX:

Video Samples:

More Sample Code:

WiX Quick Start: Here are some of the best sample code links that I have found:

And finally:

Debugging: Always check all event logs, application logs and MSI logs - if available. Just to mention it. And use any debugging tool available and google the exact error message before doing anything else.

And check for any obviously missing runtimes. For example: .Net, .Net Core, Java, Silverlight, Direct X, VC++ Runtime, MS-XML (legacy), etc....

Custom Action Debugging:

MSI logging:

Event Viewer:

  • Hold down Windows Key, tap R, type eventvwr.msc and press Enter.
  • Go to Windows Logs => Applications. Look for MsiInstaller events.
  • Check the other logs too (Security, System, Configuration).

General Debugging:

Debugging Tools:

Error Code: Looking up error codes and exception messages.


A Deployment Mnemonic: A general mnemonic to think about deployment problems: What is locking (in use, malware), what is blocking (permissions, anti-virus, security tools), what is corrupt (disk, malware, configs, encryption) what are unexpected system states (disk space, time & date settings, language, licensing, windows patch state, path too long, PendingFileRenames, etc...), what are incompatible products (things that can't co-exist), what is unreachable or misconfigured (what points to erroneous locations and resources: network server names, disk paths, URLs, databases, services, UAT environments, PROD environments, etc...) and last but not least: what is missing (runtime, resource image, settings file, etc...)?


NOTE: Always first (step 8 below): Google exact error message.

Express Failure to Launch Debugging: 1) Reboot, 2) disable anti-virus, 3) launch as admin and check, 4) Check dependencies and runtimes (Java, VC++ Runtime, .NET, etc...). Then, if need be: 5) verbose log, 6) event logs, 7) Try on a virtual if you still can't get it working? (many virtuals lack essential runtimes - check) Or secondary computer? Also 8) google exact error messages and check user comments, 9) Run update for the application in question? (new installer could eliminate the error situation). 10) Run a full check for malware too? It is all over the place these days. 11) Some software (often server software) may need configuration settings sorted out (misconfiguration). Desktop applications may need license to launch at all.


Locks?: With permission and locks you can try to run the tool with elevated rights? You could have disk corruption - disk errors? Faulty ACL permissions? (possible). Your anti-virus suite has locked some file that MSI is trying to put back in place. You can try to disable it temporarily to see. Note that the file can have been quarantined as well (moved somewhere else).


Generic Tricks? - Consumer issues, failure to install setup.exe:

For setups that won't install properly. A few generic tricks below - in addition to checking event logs and installation- and application logs and googling any error messages (always do that too - perhaps first - but maybe just do a reboot first - before facing all the complexity):

  1. Reboot: Reboot first after a failed install to see if that solves locks and pending renames.
  2. Other Computer: Try installing on another physical machine instead?
    • Important smoke test of the installation media!
  3. Virtual: Try installing on a Virtual machine instead?
    • Often outdated, check runtimes, check Windows Update.
  4. Runtimes: Ensure required runtimes of various types are on there in the required version:
  5. Secondary Account: Try installing on main box using a different admin account. This can sort out problems caused by errors in the user profile (not at all that uncommon).
  6. Local Installation Files: Copy installation files locally if they are on the network when invoked (to eliminate network error sources).
  7. Localization Issues: It is not uncommon for setups delivered in other languages to contain brand new bugs not seen in the original installer (usually English).
    • "Murphy Field": "We have managed to add additional bugs to the internationalized setups beyond the English version". Oh the humanity say! Bummer.
    • Try to download an English setup version and test install?
    • Try the localized setup on an English machine or virtual?
    • Also investigate running with another user account with different language settings.

Setup.exe - again - the common "blockers":

  1. Corrupt Setup File: Corrupt setup file. Re-download to be sure? Get this done as one of the first steps before wasting a whole day? Correct platform bitness? Right CPU-architecture?
  2. Malware: Malware can cause just about "anything" in terms of problems.
  3. Security Software: Anti-virus, firewalls, scanners, etc... can interfere with installation. Disable temporarily if possible when required.
  4. Disk Space: Ensure enough disk space!
  5. Proxy: If there is a network requirement, is there a proxy server that blocks things?
  6. Policies: There can be policies in effect on managed networks to block certain features making the install impossible. Try on virtual? Usually less restricted.
  7. Disk Errors: Scan disk to see if it is OK. If not, fix it first. Modern NVMe disks can lose a lot of data with power outages for desktops without UPS.
  8. Disk Security ACL: Custom security ACL (NTFS access configuration) configuration that leads to runtime errors for Windows components and software alike. Never use custom ACL for Windows directories unless you know what you are doing. Errors are CERTAIN.

Some Links:


Easy Access:

Repackaging, Application Launch Debugging:

Upgrades:

Some Other WiX Links:


Procedures:

  • Open Temp folder: Windows Key => Tap R => Type: %TEMP% => Press: Enter.
  • ARP: Go start run appwiz.cpl ENTER in order to open the add/remove programs applet (or click add/ remove programs in the control panel).
  • Settings GUI Win8/10: Windows Key + Tap I => Apps & Features. Select entry and uninstall.
  • Quick start of Powershell: hold Windows key, tap R, type in "powershell" and press Enter.
  • Restart Graphics Driver: Windows key + Ctrl + Shift and tap B.

Some good starting links to learn Wix:

Extract Files from Setup.exe WiX Bundle or from an MSI file itself:

As I wrote in my suggested "Wix quick start" post above: Wix is hands-on. Just focus on simple, but complete real-world samples like the one from Codeproject - reading the documentation alone is likely to be merely confusing.

Focus on splitting your application into components and set up a major upgrade. Use one file per component as a rule of thumb, and read this answer for a better understanding of component creation: Change my component GUID in wix?

A major upgrade is the most commonly used upgrade mechanism for deployed software (the other common upgrade type is minor upgrade). It is obviously crucial that you can upgrade what you have deployed already. Get upgrade scenarios working before you deploy your first software version so you have confidence in your deployment solution.

Once you got your components set up and your upgrade solution is working, the rest of the pieces fall into place as you work your way through your application's deployment requirements and check for samples on the Wix tutorial site: https://www.firegiant.com/wix/tutorial/.

For those writing Wix code directly (without a GUI editor), I suggest you check this answer for a way to keep your source files terse: Syntax for guids in WIX?

Further read:

这篇关于MSI 与 nuget 包:哪个更适合持续交付?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆