rfxavier
Posts: 6
Joined: Mon Sep 14, 2015 12:01 am

MySql server installation fails with MySQLInstallerConsole as custom action

Hello,

I have a problem when installing MySql server from the command line, using MySQLInstallerConsole.exe, as a custom action in Advanced Installer.

I managed to author a package that successfully installs MySql silently, with mysql-installer-community-5.6.26.0.msi as a prerequisite, having /qb in install command lines. This gets MySql Installer - Community installed correctly. Since it is a silent installation, MySql requires a second step, which is installing an actual instance using the MySQLInstallerConsole utility (as of version 5.6.26 which is the case here).

For this last step to get MySql installed silently, I managed to configure a custom action with sequence, just after Add Resources Execution Stage, deferred and run under LocalSystem account.

File to launch: [ProgramFilesFolder]MySQL\MySQL Installer for Windows\MySQLInstallerConsole.exe
Command Line: community install server;5.6.26;X86:*:servertype=Server;passwd=manager -silent

I get this custom action fired correctly when executing the authored package (command window shows progress), but in the end MySql server instance is not installed. I have tried several combinations on the configuration of the custom action (execution time and execution options) with no sucess. I double checked that the Advanced Installer project has "Run as Administrator" in Install Parameters, and also in launch file properties.

Please notice that: immediately after package installation fails, I CAN install the desired MySql instance, by calling cmd.exe run as Administrator, then simply executing File to launch content + command line content, from the command line (MySQLInstallerConsole.exe community install server;5.6.26;X86:*:servertype=Server;passwd=manager -silent). This shows there is nothing wrong with my custom action command syntax. The only difference is that it fails when executed in the context of Advanced Installer authored package and is successfull when executed from cmd.exe as Administrator.

Attached files are msi install log and also .aip Advanced Installer project definition, used for reproducing the behavior described here.

Please advise,

Thank you
Attachments
MSI3ac27.LOG
(136.46 KiB) Downloaded 446 times
testeMySql.aip
(17.99 KiB) Downloaded 530 times
Dan
Posts: 4513
Joined: Wed Apr 24, 2013 3:51 pm

Re: MySql server installation fails with MySQLInstallerConsole as custom action

Hello and welcome to Advanced Installer forums,

Please note that the Run as administrator option is enabled in the Install Parameters page and also the same option is enabled in the Launch File custom action.

The benefit of elevating the bootstrapper application is that privileges are elevated only once (if necessary and at the beginning of the installation) and these privileges are inherited by all of the installation's prerequisites and the MSI file without requiring multiple elevation prompts.

So, you can disable the Run as administrator option from the Launch File custom action. Also, you should disable the Run under the LocalSystem account with full privileges (no impersonation) option from the Launch File custom action properties.

However, please be aware of the SQL limitation installation as a feature-based or post-install prerequisite (similar scenario as yours). For details, please check the Why the SQL Server installation hangs? article.

Let me know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rfxavier
Posts: 6
Joined: Mon Sep 14, 2015 12:01 am

Re: MySql server installation fails with MySQLInstallerConsole as custom action

Hello,

Thanks for the reply.

Your information on elevation of privileges only once was helpful. The behavior now though, is still failed installation.

My intent is simple: to have a silent installation of MySql using latest versions (5.6.26). I based my authoring of this test package on this post:

http://www.advancedinstaller.com/forums ... 641#p82550

In this post, it refers to MySql 5.0, which used MySQLInstanceConfig.exe as the configuration method.

Now, in version 5.6.26, it has another configuration method, using MySQLInstallerConsole.exe.

Both of these methods are execution of command line statements performed after the silent installation of the MySql INSTALLER through a pre-requisite msi package (in this regard, it is not similar to the post you mentioned about Microsoft SQL Server DB, which involves SQL Server setup attempting to shut down msi installer being executed).

In my case, the only failing point is the execution of an executable configuration utility as a custom action (as I mentioned, pre-requisite installation of msiexec /i mysql-installer-community-5.6.26.0.msi /qb works normally. The custom action step "long after" this pre-requisite installation is the one that fails. It is the execution of a command from a file called MySQLInstallerConsole.exe, which is installed successfully by pre-requisite mysql-installer-community-5.6.26.0.msi.

What intrigues me the most is that the very file to launch + command line configured as Advanced Installer custom action CAN BE sucessfully executed manually outside the context of the executing Advanced Installer's authored package. It is as simple as that, considering the resulting fail/success scenario using the same command...
rfxavier
Posts: 6
Joined: Mon Sep 14, 2015 12:01 am

Re: MySql server installation fails with MySQLInstallerConsole as custom action

Could you reproduce the issue?

Any help with the above? How to achieve a silent install of MySql latest version (5.6.26)?
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: MySql server installation fails with MySQLInstallerConsole as custom action

Hello,

Can you please try to configure your installation project as it is exposed in the "How to install mysql server 5.0 and Connector silently" thread and see if this helps?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rfxavier
Posts: 6
Joined: Mon Sep 14, 2015 12:01 am

Re: MySql server installation fails with MySQLInstallerConsole as custom action

Hello,

As I already mention on my second interaction on this thread, I based my authoring of a test package on exactly the same thread you mentioned:

"How to install mysql server 5.0 and Connector silently"

Let me retell the steps taken, quoting from the content of the referred thread:

This is what the thread you mentioned states:


Here it is a detailed step by step configuration you can implement into your project:
1. go to "Install Parameters" page and enable the "Run as administrator" option

DONE

2. go to "Prerequisites" page and add your prerequisite setups (MySQL Server and MySQL Connector/ODBC) as pre-install prerequisites

DONE.
Prerequisite was set as Use files from disk, the file is mysql-installer-community-5.6.26.0.msi
This is the latest version, as of today, from MySql website: https://dev.mysql.com/downloads/installer/

3. select, in turn, the added prerequisite items and in their "Setup Files tab -> Install Command Lines fields" add the following command:

Code: Select all

/qn
DONE.
Added /qn command on 3 Install Command Lines options: Full UI, Basic UI, Silent (no UI).

4.go to "Custom Actions" page and add a "Launch file" custom action with sequence, scheduled as deferred with no impersonation just after "Install Execution Stage -> Add Resources" action group, configured like this:

File to launch:

Code: Select all

[ProgramFilesFolder]MySQL\MySQL Server 5.0\bin\MySQLInstanceConfig.exe
Command line:

Code: Select all

-i -q "-l[WindowsVolume]mysql_install_log.txt" "-nMySQL Server 5.0" "-p[ProgramFilesFolder]MySQL\MySQL Server 5.0" "-t[ProgramFilesFolder]MySQL\MySQL Server 5.0\my-template.ini" ServerType=DEVELOPMENT DatabaseType=MIXED ConnectionUsage=DSS SkipNetworking=yes StrictMode=yes Port=3311 ServiceName=MySQL RootPassword=password

DONE.

"with no impersonation" was not set according to the referred thread, because it was instructed otherwise on this very thread:
So, you can disable the Run as administrator option from the Launch File custom action. Also, you should disable the Run under the LocalSystem account with full privileges (no impersonation) option from the Launch File custom action properties.
Please notice that file to launch and command line are now different. The referred thread you mentioned is about MySql version 5.0. Now in latest versions (starting from MySql 5.5), it no longer uses MySQLInstanceConfig.exe.
For version 5.6.26, it is instructed that the configuration tool is MySQLInstallerConsole. This is according to documentation on MySql website: https://dev.mysql.com/doc/refman/5.5/en ... nsole.html

Then, step 4 from the referred thread is as follows:

File to launch:

Code: Select all

[ProgramFilesFolder]MySQL\MySQL Installer for Windows\MySQLInstallerConsole.exe
Command line:

Code: Select all

community install server;5.6.26;X32:*:servertype=Server;passwd=manager -silent
5. rebuild and test the project

DONE.

Also, I've attached the sample project used to reproduce what was suggested on your referred thread, on the first interaction on this very thread, which implement the above settings.
The installation was NOT successful, tested on two machines: Windows 7 x64 and Windows 8.1 x32.

The installation of the prerequisite MySQL Server, along with Install Command Lines fields = /qb, is successful.
The configured custom action with sequence is NOT successful (nothing gets installed, command window is shown, it shows progress but fails).

Please, notice that, as a "counter-proof", just after the install package authored using Advanced Installer fails, I can have what was configured as the custom action command to work, doing the following:

Start cmd.exe run as Administrator, issue the command:

Code: Select all

C:\Program Files (x86)\MySQL\MySQL Installer for Windows\MySQLInstallerConsole.exe community install server;5.6.26;X32:*:servertype=Server;passwd=manager -silent
It then gets MySql installed correctly (not executed by Advanced Installer authored package, though).

This is exactly the content from File to launch + Command line configured on the custom action.
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: MySql server installation fails with MySQLInstallerConsole as custom action

Hello,

First of all I apologize for not seeing that you already had read the "How to install mysql server 5.0 and Connector silently" thread. I was a bit in a hurry and didn't read thoroughly your previous post.

Looking over the MySQL 5.6.26.0 installation scenario it seems that the MySQL effective installation is done through "MySQLInstallerConsole.exe" installer tool. The MySQL service installation (launched by your custom action) fails because Windows Installer cannot run two installation processes at the same time. Therefore, your custom action should be scheduled after "Install Execution Stage -> Finish Execution" action group and should have the "Wait for custom action to finish before proceeding" and "Wait for return code at the end of the sequence" execution options disabled. In this way the custom action will be launched asynchronously at the end of the main installation process, thus the main installation process won't interfere with the MySQL installation process triggered by the custom action.

I've edited accordingly your setup project and attached to this thread.
testeMySql.aip
(18.02 KiB) Downloaded 718 times
Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rfxavier
Posts: 6
Joined: Mon Sep 14, 2015 12:01 am

Re: MySql server installation fails with MySQLInstallerConsole as custom action

Hello,

Thank you for your accurate reply!

After the changes you pointed, it now successfully installs MySql 5.6.26 silently.

But there is another issue now. Since the custom action was configured to be executed after the end of the main installation process, how am I supposed to configure sql scripts (to create database and tables, for example) for MySql instance just installed? It looks like Advanced Installer's option under SQL Databases (Operations on SQL Databases during install) is part of the main installation process. This way, anything configured under SQL Databases operations fails for this case, because MySql will be effectively installed just later on.

How do you suggest that, authoring one single package in Advanced Installer, MySql gets installed and also scripts for creating database and tables are run on top of this same MySql installed by the package?
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: MySql server installation fails with MySQLInstallerConsole as custom action

Hello,

I'm afraid this is not possible. As a workaround you can create a separate project which will install and configure MySQL and add the built setup as a pre-install prerequisite of your main project which will run the SQL scripts.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rfxavier
Posts: 6
Joined: Mon Sep 14, 2015 12:01 am

Re: MySql server installation fails with MySQLInstallerConsole as custom action

Ok, understood. The workaround is to have two packages to accomplish MySql silent installation plus scripts on top of the installed database.
goldeneaglesteam
Posts: 25
Joined: Tue Feb 20, 2018 12:42 am

Re: MySql server installation fails with MySQLInstallerConsole as custom action

thank you ..
it work ,
but root password do not changed !!!

Code: Select all

 install server;5.7.21;X86:*:servertype=Server;Port=3309;ServiceName=serviccccc;passwd=123 -silent
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: MySql server installation fails with MySQLInstallerConsole as custom action

Hello,

I am not sure why this happens.

Can you try to manually install the MySQL server and see if the above command succeeds (i.e. the password is applied)?

If so, can you please give us a detailed step by step test case you follow when manually installing the MySQL server and also send us by email to support at advancedinstaller dot com your AIP (project file) so we can compare its settings against the manual installation steps?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ikkhan71
Posts: 1
Joined: Mon Oct 22, 2018 2:33 pm

Re: MySql server 5.7.17 installation fails with MySQLInstallerConsole as custom action

Hello,
i create this custom action to install mysql server 5.7.17 but succeeded, when i try to install mysql server 5.0 it install properly, and mysql server showing in services, but when i am trying to install mysql server 5.7.17, i fail i tried every solution but not succeeded, please help me. i got frustrated, i totally stack,please please help me guys, i am attaching me .aip please look it and help me.
these are some link that i follow:
viewtopic.php?t=34943
viewtopic.php?t=30962
Attachments
setup - Copy.aip
(22.98 KiB) Downloaded 421 times
Catalin
Posts: 6584
Joined: Wed Jun 13, 2018 7:49 am

Re: MySql server installation fails with MySQLInstallerConsole as custom action

Hello and welcome to our forums,

First of all, I apologize for the delayed reply.

Could you please give me some more details about what exactly is not working? Does the setup hangs, or it simply fails with an error? If it fails with an error, could you please tell me which error are you encountering?

P.S: I have had a look over your project and it seems configured well (plus the fact that it was working well when trying to install the 5.0 version of the MySQL Server). Creating a log of the installation process would be really useful in this case.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”