从提取的安装文件创建 MSI [英] Create MSI from extracted setup files

查看:16
本文介绍了从提取的安装文件创建 MSI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含第 3 方安装程序的文件夹,该文件夹包含 setup.exe 及其旁边的所有 CAB 文件(以及许多相关文件夹).

I have a folder with a 3rd party installer, the folder contains a setup.exe and all its CAB files next to it (and many related folders).

我希望能够将这个 3rd 方安装程序重新打包成我可以在主应用程序安装程序中作为先决条件(或链接的 msi 包)使用的内容.

I want to be able to re-package this 3rd party installer into something that I can use in my main application installer as a prerequisite (or as a chained msi package).

我不仅要在客户端计算机上提取/复制这些文件,还要运行安装程序.

I want to not just extract/copy those files on the client machine, but run the installer.

是否可以使用 Installshield 从所有这些文件创建 MSI?我似乎找不到可以做到这一点的项目类型.

Is it possible to create a MSI from all those files using Installshield? I can't seem to find a project type that would do it.

推荐答案

问题场景:你的场景是什么?

Problem Scenario: What is your scenario?

  • 您是否正在接管旧设置的处理和更新并需要将其转换为正确的格式?
  • 您是否正在尝试重新打包第三方供应商 setup.exe?
  • 您是否想获取 CAB 中的文件?或者只是提取文件,以便它们可以以其他方式重新打包.出于某种原因?
  • 您是否尝试在静默模式下尽可能轻松可靠地安装整个 shebang?
  • 其他一些问题场景?

静默运行?:如果您只需要静默安装,那么大多数 setup.exe 包装器可让您执行此操作,但用于创建 setup.exe 文件的每个工具都不同.Installshield 的 setup.exe 文件需要一个静默响应文件,其他工具的做法不同.我写了一些关于 Installshield 静默卸载的文章几天前.这里有一篇关于常规静默安装和各种类型的文章Installshield setup.exe 文件.

Silent Running?: If what you need is to just install silently, then there are command line switches for most setup.exe wrappers that will let you do this, but it is different for every tool used to create the setup.exe file. Installshield's setup.exe files require a silent response file, other tools do it differently. I wrote about Installshield silent uninstall a couple of days ago. And here is a piece on regular silent install and various types of Installshield setup.exe files.

记录响应文件:

Setup.exe /r /f1"c:	empmy-answer-file.iss"

基本的静默安装:

Setup.exe /s /f1"c:	empmy-answer-file.iss"

如果 setup.exe 是 MSI 的包装器,并且您有一个分发系统来分发必备组件,那么通常最好提取 MSI,如果您是在企业环境中并使用 MSI 中的标准功能静默运行(/QN 开关用于 msiexec.exe>):

If the setup.exe is a wrapper for an MSI and you have a distribution system to rely on to distribute the pre-requisite components, then it is generally better to extract the MSI if you are in a corporate environment and use the standard features in MSI to run silently (the /QN switch for msiexec.exe):

msiexec.exe /I "C:Your.msi" /QN /L*V "C:msilog.log" TRANSFORMS="C:1031.mst;C:My.mst"

快速参数说明:

/I = run install sequence
/QN = run completely silently
/L*V "C:msilog.log" = verbose logging
TRANSFORMS="C:1031.mst;C:My.mst" = Apply transforms 1031.mst and My.mst (see below).

<小时>

文件提取?:从 setup.exe 中提取文件可能具有挑战性,或者非常具有挑战性简单.这取决于它是用什么构建的,这几乎可以是任何东西"——从已建立的部署工具到由任何人"制作的专有软件.要从各种类型的 setup.exe 中提取文件,您可以在此答案中找到大量信息:


File Extraction?: Getting the files out of a setup.exe can be challenging, or very easy. It depends what it was built with, and that can be pretty much "anything" - from established deployment tools to proprietary software made by "anyone". To extract files from various types of setup.exe you can find extensive information in this answer:

  • Extract MSI from EXE (a plethora of links on the subject)
  • There is also Michael Urman's "hand's-on": Programmatically extract contents of InstallShield setup.exe

基本上,您将 setup.exe/stage_only 用于 Installshield Suite 可执行文件.和 setup.exe/a 用于基本 MSI 和 Installscript MSI 可执行文件.和 setup.exe/s/extract_all 用于旧版 Installscript 可执行文件.澄清如下.

Essentially you use setup.exe /stage_only for Installshield Suite executables. And setup.exe /a for Basic MSI and Installscript MSI executables. And setup.exe /s /extract_all for legacy Installscript executables. Clarifications below.

MSI 导入:如果您设法解压缩文件并在那里看到 MSI 文件,那么您应该能够导入或打开该 MSI 文件Installshield(或其他部署工具).

MSI Import: If you manage to extract the files and you see an MSI file there, then you should be able to import or open that MSI file in Installshield (or other deployment tools as well).

<小时>

我将尝试一个快速的提取选项短名单"(不确定这是否是您真正需要的):


I'll try a quick "short-list" of extraction options (not sure if that is what you really need):

已经是 MSI?:您知道 setup.exe 包含什么吗?从技术上讲,它可能已经是包含 MSI 文件的包装器,也可能是某些旧部署工具的输出,而根本不是 Windows 安装程序.我们只列出几个选项:

Already an MSI?: Do you know what that setup.exe contains? Technically it could already be a wrapper containing an MSI file, or it could be the output of some legacy deployment tool and not be a Windows Installer at all. Let's just list a few options:

  1. 管理安装:尝试从命令提示符执行 setup.exe/a 以查看是否提取文件"对话框.如果是,请指定输出位置并提取所有文件.这表示包含在 setup.exe 中的 MSI 设置
  2. Installscript setup:尝试从命令提示符执行 setup.exe/s/extract_all看看您是否可以从 CAB 中提取文件.这是用于 Installscript 设置.或者也试试 /extract_all:[path].
  3. Installshield 套件设置:尝试做来自命令提示符的 setup.exe/stage_only.这里有很多详细的细节.
  4. 高级安装程序:尝试做setup.exe/extract "C:My work"setup.exe/x
  5. WiX:从命令提示符:dark.exe -x outputfolder setup.exe.只能使用框架本身的 dark.exe 工具提取 WiX setup.exe 文件.换句话说,您需要安装 WiX 才能提取 WiX setup.exe(截至目前).
  6. 明智:Wise 不再销售,但许多旧设置仍然存在.您可以尝试使用 setup.exe/X [path] 提取文件.
  7. 重新打包:从旧式的遗留 setup.exe 安装程序创建 MSI 包的一种方法是使用 应用程序重新打包工具,它监视在 setup.exe 运行时对系统所做的更改运行.
  1. Administrative Installation: Try to do a setup.exe /a from a command prompt to see if you get an "extract files" dialog. If so, specify an output location and extract all files. This indicates an MSI setup wrapped in a setup.exe
  2. Installscript setup: Try to do a setup.exe /s /extract_all from a command prompt to see if you can extract files from the CABs. This is for Installscript setups. Or try /extract_all:[path] as well.
  3. Installshield Suite Setups: Try to do a setup.exe /stage_only from a command prompt. Lots of elaborate details here.
  4. Advanced Installer: Try to do setup.exe /extract "C:My work" or setup.exe /x
  5. WiX: Try the following from a command prompt: dark.exe -x outputfolder setup.exe. A WiX setup.exe file can only be extracted using the dark.exe tool from the framework itself. In other words you need to install WiX to extract a WiX setup.exe (as of now).
  6. Wise: Wise is no longer marketed, but many older setups remain. You can try to extract files with setup.exe /X [path].
  7. Repackaging: One way to create an MSI package from older-style, legacy setup.exe installers, is to "capture" the changes done to the system by using an Application Repackaging Tool which monitors changes made to the system whilst a setup.exe is being run.

不可能涵盖所有不同类型的可能的 setup.exe 文件.它们可能具有各种不同的命令行开关.可以使用的工具太多了.(非 MSI,MSI, admin-tools, 多平台,等等.

It is impossible to cover all the different kinds of possible setup.exe files. They might feature all kinds of different command line switches. There are so many possible tools that can be used. (non-MSI,MSI, admin-tools, multi-platform, etc...).

Inno Setup 等常用工具似乎使提取变得困难(非官方解包器,我没有尝试过,由virustotal运行).而 NSIS 似乎使用标准存档软件可以打开的常规存档.

Commmon tools such as Inno Setup seems to make extraction hard (unofficial unpacker, not tried by me, run by virustotal). Whereas NSIS seems to use regular archives that standard archive software can open.

一般技巧:一种技巧是启动 setup.exe 并在 1) 系统的临时文件夹中查找提取的文件.另一个技巧是使用2) 7-Zip、WinRAR、WinZip 或类似的存档工具来查看它们是否可以读取格式.有些人通过3) 在 Visual Studio 中打开 setup.exe 声称成功.不是我使用的技术.

General Tricks: One trick is to launch the setup.exe and look in the 1) system's temp folder for extracted files. Another trick is to use 2) 7-Zip, WinRAR, WinZip or similar archive tools to see if they can read the format. Some claim success by 3) opening the setup.exe in Visual Studio. Not a technique I use.

一些链接:

  • How do I extract an InstallShield Cabinet file? (this I have never tried)
  • Uninstall and Install App on my Computer silently
  • How to make better use of MSI files

这篇关于从提取的安装文件创建 MSI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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