如何安装无人值守的MySQL自定义设置? [英] How to install MySQL unattended with custom settings?

查看:179
本文介绍了如何安装无人值守的MySQL自定义设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是用于静默安装 MySQL 的命令行,

This is the command-line used install MySQL silently,

/quiet

但是如何运行无人值守的 MySQL 安装程序在安装程序中?

But how to run the MySQL installer unattended with custom settings in the installer?

推荐答案

更新:此处分为几个阶段.我将全部保留.建议的技术解决方案/解决方法已移至顶部.

UPDATE: Several stages of answers here. I will leave them all in. The proposed technical solution / workaround moved to the top.

实例的实际配置 似乎已从与MySQLInstanceConfig.exe相同的MySql 5.6在哪里,用于编辑配置文件?请尝试 MySQLInstallerConsole.exe (注意:链接到8.0版,而不是5.7版)应用程序,示例:

The actual configuration of instances seems to have been moved from MySQLInstanceConfig.exe to the installer itself: Where is the MySql 5.6 equivalent of `MySQLInstanceConfig.exe` to edit configuration files? Please try the MySQLInstallerConsole.exe (note: that links to version 8.0, not 5.7) application, sample:

静默安装 :该控制台应用程序似乎可以在以下环境中静默运行安装: 多种口味,使以下步骤成为可选步骤.

Silent Installation: It seems this console appliation can run the installation silently in various flavors, making the procedure below optional.

MSI软件包

我对我认为是mysql-5.7.22-winx64.msi文件的文件进行了测试(主要文件中嵌入了许多MSI文件,请参见下文). 我的最佳建议 :与供应商联系,以确定他们是否已积极尝试防止静默安装.他们可能拥有,然后您可能会随着时间而与风车作战.如果您问我,他们应该改进此设计-尽管这不是我见过的最糟糕的情况.

MSI Packages

I did a test run of what I believe was the mysql-5.7.22-winx64.msi file (there are many MSI files embedded in the main one, please see below). My best tip: get on the phone with the vendor to determine if they have actively tried to prevent silent installation. They just might have, and then you might be fighting windmills over time. They should improve this design if you ask me - though it is not the worst I have seen.

通过启动原始的大型MSI并启用 自动记录 (请参见该链接中的部分:"对于计算机上的所有设置都是全局的"),然后通过其内置的自定义GUI运行并开始实际安装然后检查temp文件夹中生成的实际日志文件中的"CommandLine"条目-看起来它设置了以下属性: REBOOT ADDLOCAL INSTALLDIR INSTALLLOCATION ARPINSTALLLOCATION INSTALL_ROOT DATADIR .实际的日志条目如下:

By launching the original, large MSI and enabling automatic logging (see section in that link: "Globally for all setups on a machine"), then running through its built-in, custom GUI and kicking off the actual install and then checking the "CommandLine" entry in the actual log file generated in the temp folder - it looks like it sets the following properties: REBOOT, ADDLOCAL, INSTALLDIR, INSTALLLOCATION, ARPINSTALLLOCATION, INSTALL_ROOT, DATADIR. Actual log entry below:

 ******* Product: C:\ProgramData\MySQL\MySQL Installer for Windows\Product Cache\mysql-5.7.22-winx64.msi
 ******* Action: 
 ******* CommandLine: REBOOT=ReallySuppress  ADDLOCAL=RegKeys,ALWAYSINSTALL,Readme,MISC,Server_Scripts,ProgramMenu,MYSQLSERVER,Client,DEVEL,SharedLibraries,UserEditableDataFiles INSTALLDIR="C:\Program Files\MySQL\MySQL Server 5.7" INSTALLLOCATION="C:\Program Files\MySQL\MySQL Server 5.7" ARPINSTALLLOCATION="C:\Program Files\MySQL\MySQL Server 5.7" INSTALL_ROOT="C:\Program Files\MySQL\MySQL Server 5.7"  DATADIR="C:\ProgramData\MySQL\MySQL Server 5.7" ALLUSERS=1 

换句话说,这些是由通常运行安装过程的自定义安装GUI设置的属性. 您应该能够对需要安装的所有嵌入式MSI文件使用此过程 .然后,您只需从大型MSI中提取所需的这些MSI文件,并使用找到的命令行以某种方式依次运行它们.您也可以根据需要应用变换.

These are in other words the properties set by the custom setup GUI that normally runs the installation process. You should be able to use this procedure for all the embedded MSI files you need to install. Then you simply extract these MSI files that you need from the large MSI and run them in sequence in some fashion, with the command lines you have found. You can also apply transforms if need be.

要表达明显的意思 :在与先决条件和公司用例作斗争时,这可能需要一些时间才能正确.我会去 试点 .找到一个有活力的团队,并迅速将他们的东西放在他们的测试PC上,并告诉他们尽快进行测试:-).提到它,您已经有机会了.如果没有一些不幸的,耗时的迭代,我将永远做不到这些事情.

To state the obvious: this might take you some time to get right as you struggle with pre-requisites and your corporate use case. I'd go for piloting. Find a dynamic team and get your stuff on their test PCs quickly and tell them to give it a trashing asap :-). Chances are you already do, just mentioning it. I for one can never get these things right without some unfortunate, time-consuming iterations.

过程摘要 :

Summary of procedure:

  1. 启用 自动记录 (MSI专家Stefan Kruger的信息)
  2. 通过具有适当设置选项的自定义安装程序GUI安装
  3. %temp% folder的日志文件中查找要设置的属性.
    • 日志文件将具有随机名称,按数据排序并打开最近更改的日志文件.
  1. Enable automatic logging (MSI expert Stefan Kruger's info)
  2. Install via custom setup-GUI with options set as appropriate
  3. Find properties to set in the log file in the %temp% folder.
    • Log file will have random name, sort by data and open most recently changed log file.
  • 获取行政安装-本质上是精美的文件摘录,但应用程序打包程序每天都使用MSI的一个很好的功能
  • Get hold of an MSI tool for viewing / editing MSI files (list towards bottom)
  • Delete launch conditions from wrapper setup (LaunchCondition table)
  • Extract content like this: msiexec.exe /a mysql-installer-community-5.7.22.1.msi TARGETDIR=C:\YourFolder
  • Tha above command kick off an administrative installation - essentially a glorified file extract, but a very good feature of MSI used by application packagers every day

示例 :

Sample:

msiexec.exe /i mysql-5.7.22-winx64.msi REBOOT=ReallySuppress ADDLOCAL="RegKeys,ALWAYSINSTALL,Readme,MISC,Server_Scripts,ProgramMenu,MYSQLSERVER,Client,DEVEL,SharedLibraries,UserEditableDataFiles" INSTALLDIR="C:\Program Files\MySQL\MySQL Server 5.7" INSTALLLOCATION="C:\Program Files\MySQL\MySQL Server 5.7" ARPINSTALLLOCATION="C:\Program Files\MySQL\MySQL Server 5.7" INSTALL_ROOT="C:\Program Files\MySQL\MySQL Server 5.7" DATADIR="C:\ProgramData\MySQL\MySQL Server 5.7" ALLUSERS=1 /QN

以及一些参数信息:

ADDLOCAL="..." - list of features to install locally
REBOOT=ReallySuppress - prevent spontaneous reboot
ALLUSERS=1 - install per machine
/QN - crucial addition to the command line found in the log file. this makes the install run in silent mode


不寻常的MSI设计 :我知道这是不寻常的MSI,但通常您会致电供应商或搜索其网站以获取诸如此类的部署文档,然后按照我在下面概述了此过程(也请在此处添加链接:如何更好地利用MSI文件),请使用 PUBLIC properties transforms 修改安装.


Unusual MSI Design: I know this is an unusual MSI, but generally you call the vendor or search their website to obtain documentation for deployment such as this and follow the procedure I outline below (let me add the link here too: How to make better use of MSI files) using PUBLIC properties or transforms to modify the installation.

但是,在快速检查此MSI之前,我写了以下部分.快速浏览后发现无数 embedded MSI packages .一点也不好. MSI也没有GUI,并且其启动安装会阻止其管理安装(文件提取).实际上,这是非常糟糕的设计.您可以使用Orca或等效工具删除启动条件,然后进行以下操作:

However, I wrote the section below before I did a quick check of this MSI. A quick look revealed a myriad of embedded MSI packages. Not at all good. The MSI also has no GUI, and its administrative installation (file extraction) is blocked with a launch condition. Quite terrible design in fact. You can make an administrative installation by deleting the launch conditions using Orca or an equivalent tool and going:

msiexec.exe /a mysql-installer-community-5.7.22.1.msi TARGETDIR=C:\YourFolder

看来,这是一个包装MSI,它将启动专有的GUI(基于.NET?),然后可以使用该GUI安装MySQL工具套件所需的点点滴滴.如果此启动器是使用 WiX Burn Installshield an equivalent tool .

It seems the idea is that this is a wrapper MSI which will launch a proprietary GUI (.NET based?) that you can then use to install the bits and pieces you need of the MySQL tool suite. It would have been much better if this launcher was a setup.exe built with WiX Burn, Installshield, Advanced Installer or an equivalent tool.

推荐步骤 :诚实的答案是我不知道.如果可能的话,我会选择call the vendor,通常是check their user forumsdo some further googling.我希望大多数嵌入式MSI文件都可以以静默方式安装.

Recommended Procedure: The honest answer is that I don't know. I would call the vendor if possible, check their user forums and do some further googling in general. Most of the embedded MSI files should be possible to install in silent mode, I would hope.

现实世界中的方法可能是使用上述管理安装技巧来提取所有MSI文件,尽管有一定的原因它们会阻止管理安装-我不知道. 他们很可能不希望通过选项支持静默安装? (给他们打电话?).然后,您获取所需的单个MSI文件,并查看它们是否将使用 功能控件是一个非常复杂的主题 (推荐脱脂).

The real-world approach would probably be to extract all the MSI files using the above administrative installation trick, although there must be a reason why they block administative installations - which I am unaware of. Most likely they do not want to support silent installation with options? (give them a call?). Then you take the individual MSI files you need, and see if they will install in silent mode using the approach described here with PUBLIC properties and / or transforms. There are many features in these setups, and you can use ADDLOCAL at the command line to define which ones to install and not. See the linked answer below. However, as I state below as well; feature control is a very complex topic (recommended skim).

当心必备的运行时要求.可能有几种,例如.NET框架和各种运行时.我看到其中一些是由自定义安装GUI安装的.

Beware of pre-requisite runtime requirements. There may be several, such as the .NET framework and various runtimes. I see several of these being installed by the custom setup GUI.

我下面的原始通用答案 :

My original, generic answer below:

MSI :该安装程序看起来像Windows Installer格式,即MSI文件. MSI文件在静默安装和自定义参数的配置方面非常灵活,这让您很幸运.但是,这取决于设计良好的包装,但情况并非总是如此.

MSI: It looks like this installer is in Windows Installer format, in other words an MSI file. You are in luck in the sense that MSI files are very flexible with regards to silent installation and the configration of custom paramenters. It is, however, dependpent on the package being well-designed, which is not always the case.

公共属性和转换 :在这里,关于自定义MSI安装的主题有一个古老的答案:

PUBLIC PROPERTIES and Transforms: I have an ancient answer here on the topic of customizing MSI installations: How to make better use of MSI files (just the first parts, the ending flies a bit off the handle with other topics). As you will see in the linked answer, you essentially set available PUBLIC properties at the command line, or create a transform to customize anything you want in the installer. The latter is what most corporations do for deployment.

配置 :可以在命令行设置哪些属性(有什么作用),在不同的设置之间有所不同.设置创建者必须具有这些属性-并在设置中围绕它们创建了功能-才能对其进行配置.典型的参数化值将包括license keysURLs to license serversuser and company names and emails等.对于更重大的更改(例如更改快捷方式或类似内容),人们通常求助于使用变换.您还可以使用ADDLOCAL property定义要安装的功能(如果为ADDLOCAL指定值,则不会安装所有其他功能).功能控件是MSI的内置属性,您可以从命令行或通过转换来详细控制功能选择.但是, 功能控件是一个非常复杂的主题 (建议略读).

Configuration: What properties can be set at the command line (that has any effect), varies between different setups. The setup creator must have made these properties - and built functionality around them in the setup - for them to be configurable. Typical parameterized values would include license keys, URLs to license servers and user and company names and emails and similar. For more substantial changes (such as changing shortcuts or similar), people usually resort to using a transform. You also use the ADDLOCAL property to define which features to install (all other features will not be installed if you specify a value for ADDLOCAL). Feature control is a built-in property of MSI, and you can control feature selection in detail from the command line or via a transform. However, feature control is a very complex topic (recommended skim).

具体示例 :如上所述,您需要根据所涉及的设置来设置属性和值.这意味着您必须点击有关设置的文档,以确定什么是可设置的".

Concrete Sample: As mentioned above you need to set properties and values as appropriate for the setup in question. This means you have to hit the documenation for the setup in question to determine what is "settable" or not.

某些链接 :

Some Links:

  • https://downloads.mysql.com/docs/refman-5.7-en.pdf
  • https://dev.mysql.com/doc/mysql-installation-excerpt/5.5/en/windows-using-installer.html

这篇关于如何安装无人值守的MySQL自定义设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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