I would create a setup program for my Java application. It uses a MySQL database. So the installation of my program must include the installation of MySQL server 5.5, the configuration of server and loading of my database. I use Inno Setup to do this, but I found some problems. I found this code but it is a little old.
[Files]
Filename: msiexec; \
Parameters: "/i mysql-5.5.11-win32.msi /qn INSTALLDIR=""C:\mysql"""; \
WorkingDir: C:\Users\Gabriele\Desktop\setup; \
StatusMsg: Sto installando Mysql 5.5.11; Flags: runhidden
Filename: C:\mysql\bin\mysqld-nt.exe; \
Parameters: --install; WorkingDir: C:\mysql\bin; \
StatusMsg: Sto installando il Servizio MySQL; \
Description: Installing MySQL Service; Flags: runhidden
Filename: net.exe; Parameters: start mysql; \
StatusMsg: Sto Avviando il Servizio MySQL; \
Description: Avvio Servizio MySQL; Flags: runhidden
Filename: C:\mysql\bin\mysql.exe; \
Parameters: "-e ""insert into mysql.user(host,user,password) values ('localhost','root', PASSWORD('emmaus');"" -u root"; \
WorkingDir: {tmp}; StatusMsg: Configurazione del Server della Base di Dati; \
Flags: runhidden
Filename: C:\mysql\bin\mysql.exe;
Parameters: "-u root -h localhost -e ""create database ata";
Filename: C:\mysql\bin\mysql.exe; \
Parameters: "-e ""grant all privileges on ata.* to ata;"" -u root"; \
WorkingDir: {tmp}; StatusMsg: Configurazione Server Base di Dati; \
Flags: runhidden
Filename: C:\mysql\bin\mysql.exe; \
Parameters: "-e ""flush privileges;"" -u root"; \
WorkingDir: {tmp}; StatusMsg: Configurazione Server Base di Dati; \
Flags: runhidden
Filename: C:\mysql\bin\mysql.exe; \
Parameters: "-u root -h localhost -e ""use ata; source ata.sql;"; \
WorkingDir: {tmp}; StatusMsg: Caricamento base di dati; \
Flags: runhidden
When I debug, it generates an error after the first statement. Can not find the specified program in the second instruction. I tried to use mysqld
instead of mysqld-nt
but nothing changes.
Can someone help me?
所有评论(0)