如何标记或自定义二进制文件(例如安装程序) [英] How to tag or customize the a binary (for example of an installer)

查看:171
本文介绍了如何标记或自定义二进制文件(例如安装程序)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用自定义信息标记或修改.msi二进制文件?

How can I tag or modify a .msi binary with custom information?

如何为网站用户提供单独的下载内容,以使他们不必再次在应用程序中登录?

How can I give website users individual downloads, so that they don't have to sign in again in the app?

某些网站提供个人/定制/带标签的安装程序下载.

Some websites offer personal/customized/tagged installer downloads.

运行文件时,可执行文件已经知道您是谁,并自动登录.

When you run the file, the executeable already knows who you are and automatically signs you in.

示例为:

  • join.me(通过演示者角色),触发另一方的下载并自动将其连接到正确的会议上
  • spotify进行了下载,不需要您登录.<​​/li>
  • join.me where passing the presenter role, triggers a download for the other party and automatically connects them into the right conference
  • spotify had a download, that would not need you to sign in.

推荐答案

您可以对MSI文件进行参数化,以便根据通过msiexec.exe命令行传递给它的值使用不同的设置进行安装.您启动的安装可以根据您定义的msiexec.exe开关以静默方式或以交互方式运行.

You can parameterize an MSI file so that it can install with different settings based on the values you pass to it via the msiexec.exe command line. The install you kick off can run silently or interactively based on what msiexec.exe switches you define.

您可以直接使用Java脚本或其他方式直接从网页中自动生成有问题的命令行.您还可以使用更高级的选项来自定义MSI:转换.

You can auto-generate the command lines in question directly from a web-page using Javascript, or in some other fashion. You can also customize the MSI using a more advanced option: transforms.

我不会重写所有内容,而是链接到上一个答案,该答案描述了如何使用在msiexec.exe命令行中设置的 PUBLIC PROPERTIES (公共属性)或 transforms (转换)安装期间在MSI文件中添加: 如何制作更好地使用MSI文件 (有点长,但是第一部分与您的情况有关).

Rather than rewriting it all, I will link to a previous answer which describes how to use PUBLIC PROPERTIES set at the msiexec.exe command line or transforms to modify settings in MSI files during installation: How to make better use of MSI files (a little long, but the first section is all that is relevant in your case).

  1. 您可以使用 PUBLIC PROPERTIES (公共属性)自动生成的示例命令行:
  1. Sample command line you can auto-generate using PUBLIC PROPERTIES:

msiexec.exe /i "MySetup.msi" /L*v "%TMP%\MyLog.log" SERIALKEY="123-456-789" EMAIL="myemail@somedomain.com" LOGINNAME="MyLogin" LOGINPASSWORD="MyPassword"

对于通过命令行推送密码,显然要三思.

Obviously think twice about pushing the password via command line.

  1. 您可以使用转换自动生成示例命令行:
  1. Sample command line you can auto-generate using transforms:

msiexec.exe /i "MySetup.msi" /L*v "%TMP%\MyLog.log" TRANSFORMS="MyTransform.mst"

MyTransform.mst内部,您可以更改和覆盖整个MSI文件中几乎所有所需的内容-包括从属性表"中的第一个样本中设置属性.

Inside MyTransform.mst you can change and override almost anything you want inside the whole MSI file - including setting the properties from the first sample in the Property Table.

您可以 使用MSI API自动生成转换本身 .一会儿我会挖掘出更好的链接.

And you can auto-generate the transform itself using the MSI API. I will dig up a better link when I have a moment.

更新:这里有一整套示例VBScript ,展示了如何以各种方式使用MSI API. widiffdb.vbs 显示了如何生成转换(以及其他操作).还有一个专门用于创建转换的示例: wigenxfm.vbs .

UPDATE: there is a whole family of sample VBScripts showing how to use the MSI API in various ways. The widiffdb.vbs shows how to generate a transform (among other things). And there is a sample dedicated to just creating a transform: wigenxfm.vbs.

这些脚本应与Visual Studio和SDK一起安装 .也许会给安装了此软件的朋友(一个很有耐心的人!)发电子邮件,并在急忙时让他们为您压缩,或者自己安装整个shebang.

These scripts should be installed with Visual Studio and the SDK. Maybe email a friend (one with lots of patience!) with this installed and have them zip it for you if you are in a rush, or install the whole shebang yourself.

可以使用Javascript访问MSI API,但是我遇到了一些笨拙的问题,有些问题太详细了,无法解释. VBScript用于测试对象模型,因此似乎可以更好地工作.

The MSI API can be accessed with Javascript, but I have experienced some clunky issues that are a little too detailed to explain. VBScript was used to test the object model, and hence seems to work better.

应该可以从URL调用Windows Installer .所以他们告诉我.祝你好运:-).我大约17年前尝试过并放弃了它.也许现在更好了.

It should be possible to invoke Windows Installer from an URL. So they tell me. Good luck with that :-). I tried about 17 years ago and abandoned it. Perhaps it is better now.

还有一些类似的答案(这个问题不断出现):

And some similar answers (this question keeps coming up):

  • How to push MSI with parameter using SCCM server.
  • How to make better use of MSI files.
  • Advantages of Transforms(mst) over msi file.

这篇关于如何标记或自定义二进制文件(例如安装程序)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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