1

I want to silently install MySQL 5.0 in NSI. I tried the following code in NSI:

  ExecWait 'msiexec /i "$INSTDIR\mysql-essential-5.0.27-win32.msi" /qn'
  ExecWait "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqlinstanceconfig.exe -i -q ServiceName=MySQL RootPassword=root ServerType=DEVELOPMENT    DatabaseType=MYISAM Port=3306 RootCurrentPassword=root"

This installs the MySQL but doesn't cofigure it.

I want to configure it with

  • pass=root
  • port=3306
  • servicename=Mysql
  • and enable root access from remote machine

EDIT1

Now it's getting configured...

For serverhost as localhost or 127.0.0.1 it works, but not for the ip addreses of the other systems .which are on network.

If I try to access the database on silently installed database from PC on network I get the following error:

enter image description here

I think this is because I need to pass some parameter for and enabling root access from remote machine..

pradnya
  • 113

2 Answers2

0

Try quoting the mysqlinstanceconfig.exe filename, like this:

ExecWait 'msiexec /i "$INSTDIR\mysql-essential-5.0.27-win32.msi" /qn'
ExecWait "$\"C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqlinstanceconfig.exe$\" -i -q ServiceName=MySQL RootPassword=root ServerType=DEVELOPMENT    DatabaseType=MYISAM Port=3306 RootCurrentPassword=root"

The reason for this is that you have spaces in the path to the executable name. That path must be surrounded with quotes so it can form a single path.

Ove
  • 1,607
0

The whole command passed to ExecWait should be enclosed in '' if it contains spaces.

The parameters inside your parameters, need to be enclosed in "" if they contain spaces. You can see a perfect example of how to do it correctly in your first call to ExecWait.

Note, if the command could have spaces, you should put it in quotes to delimit it from parameters. e.g.: ExecWait '"$INSTDIR\command.exe" parameters'.

Source: Documentation

Oliver Salzburg
  • 89,072
  • 65
  • 269
  • 311