加快 WiX-Installer 的构建过程 [英] Speed up Build-Process of WiX-Installer

查看:21
本文介绍了加快 WiX-Installer 的构建过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我的 Wix 项目,我通过 Visual Studio 的预构建事件收集了 4 个目录,这将产生大约 160MB 的数据和大约 220 个文件,但构建过程花费了很长时间.

For my Wix project I am harvesting 4 directories, via the pre-build-event of visual studio, which will result in about 160mb of data, and about 220 files, but the build process tooks very long.

我怎样才能加快这个过程?我有一个嵌入的 media.cab 文件,它可以保存所有文件.是文件的大小还是数量会减慢进程?或者是在预构建事件中使用加热工具进行收获?使用 HeatDirectory 元素会更快吗?

How can i speed that process up? I have one embedded media.cab file which will hold all the files. Is it the size or the amount of files that will slow the process down? Or is it the harvesting with the heat tool in the pre-build-event? Would it be faster with the HeatDirectory element?

有人在加快速度方面有过一些经验吗?

Anyone made some experience with speeding this up?

推荐答案

WiX 帮助文件:如何:优化构建速度.换句话说:1) 机柜重用2) 多线程 cab 创建 是 WiX 中用于加快构建速度的内置机制.

WiX Help File: How To: Optimize build speed. In other words: 1) Cabinet reuse and 2) multi-threaded cab creation are built-in mechanisms in WiX to speed up builds.


硬件:不可避免的向它扔硬件".新的 SSDNVMe 磁盘比旧的 IDE 驱动器快得多,您可能想尝试将它们作为另一个提高构建速度和安装速度的方法.显然是的,但非常重要.它确实可以提高开发速度.查看此答案.

NVMe 驱动器面临挑战?:1) 它们运行很热,2) 它们通常具有有限的容量(大小),3) 它们可能比旧的 2.5"更容易受到攻击.在笔记本电脑中使用的驱动器(我不确定 - 请记住,某些 NVMe 驱动器被牢固地焊接到笔记本电脑的主板上),4) 数据拯救可能有点如果您没有优质的外部外壳(外形等),则具有挑战性,5) 据说 NVMe 驱动器会随着时间的推移而烧坏,6) 它们仍然有些昂贵 - 特别是容量较大的驱动器,并且肯定还有进一步的挑战 - 但总的来说:这些驱动器很棒.

压缩:您可以尝试使用不同的压缩级别(例如 用于调试版本).没有压缩使构建速度更快.以下是执行相反操作的插图,设置更高的压缩率(出于您的目的,只需使用 none 而不是 high):

Compression: You can try to compile your setup with a different compression level (for example none for debug builds). No compression makes builds faster. Here are illustrations for doing the opposite, setting higher compression (just use none instead of high for your purpose):

关于压缩的相关答案:WhatMSI文件使用的压缩方法是什么?

单独设置:如果您仍然进行压缩,您可以将先决条件合并模块放在<强>单独设置以避免为每个构建压缩它们(如果您在 Installshield 中,则使用发布标志,或检查 Wix 中的预处理器功能).

Separate Setup: If you still go compressed, you could put prerequisites and merge modules in a separate setup to avoid compressing them for every build (or use release flags if you are in Installshield, or check the Preprocessor features in Wix).

外部源文件:如果可以接受,我想您可以使用外部源文件 - 那么您就没有冗长的压缩操作在构建过程中发生,只是一个文件副本(它会越来越快 - 特别是使用闪存驱动器).

External Source Files: I suppose you could use external source files if that's acceptable - then you don't have a lengthy compression operation taking place during the build, just a file copy (which keeps getting faster - especially with flash drives).

填充:另一种技术是将您安装的所有文件填充1 KB,如果您正在测试的是设置本身及其 GUI 和自定义操作.那么它只是一个外壳"设置 - 这是测试设置的新自定义操作的好方法.许多人为此编写了工具,但我没有给你的链接.总是有 github.com 可以搜索.

Shim: Another technique is to shim all the files you install to be 1 KB if what you are testing is the setup itself and its GUI and custom actions. It is then just a "shell" of a setup - which is a great way to test new custom actions to your setup. Many have written tools for this, but I don't have a link for you. There is always github.com to search.

发布标志:另一种节省时间的方法是使用特殊的发布标志(仅限 Installshield)来编译较小版本的安装程序目前正在开发中(省略了许多功能).WiX 通过其预处理器 具有类似的可能性.更多关于 WiX 预处理器的实际使用.

Release Flags: Another way to save time is to use special release flags (Installshield only) to compile smaller versions of the setup you are working on at the moment (leaving out many features). WiX has similar possibilities via its preprocessor. More on WiX preprocessor practical use.

调试构建:我通常使用这些技术的组合来进行调试构建.

  • 我通常在试验和添加新功能时使用外部源文件,并一直重建和安装设置.
  • 发布标志以仅编译部分设置、机柜重用和发布标志的组合可以节省大量时间,具体取决于您的设置大小、文件数量和硬件配置.
  • 在我看来,也许最有效的是单独设置(前提是它稳定且不经常更改).不过要注意:Wix 安装多个应用程序(安装多个应用程序时涉及的问题)谈到拆分设置).
  • I normally use external source files when I experiment and add new features and keep rebuilding and installing the setup all the time.
  • Release flags to compile only part of the setup, cabinet reuse and release flags combined can save a lot of time depending on the size of your setup, the number of files and your hardware configuration.
  • Perhaps the most effective is a separate setup in my opinion (provided it is stable and not changing that often). Beware though: Wix to Install multiple Applications (the problems involved when it comes to splitting setups).

我的看法:选择仅限先决条件的单独设置.这也适用于大规模部署场景,在这些场景中,企业用户想要使用自己的标准化先决条件,并且对大量嵌入的垃圾"软件感到恼火.在一个巨大的设置中.大公司的很多包准备时间都花在去除过时的运行时和先决条件上.您还可以提供对这些先决条件的更新,而无需重新构建整个设置.很好的解耦.

My take on it: go for a prerequisites-only separate setup. This is good also for Large Scale Deployment scenarios where corporate users want to use their own, standardized prerequisites and are annoyed with lots of embedded "junk" in a huge setup. A lot of package preparation time in large companies is spent taking out outdated runtimes and prerequisites. You can also deliver updates to these prerequisites without rebuilding your entire setup. Good de-coupling.

链接:

这篇关于加快 WiX-Installer 的构建过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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