Jump to content
  • Revista PROGRAMAR: Já está disponível a edição #60 da revista programar. Faz já o download aqui!

samesdavis

Criar instalador contendo configuração do MySQL

Recommended Posts

samesdavis

Pessoal,

Tenho pouca experiência com o MySQL, o que sei é apenas acessar a base de dados e configurar de forma LOCAL em meu notebook, Só que desejo gerar um instalador que contenha o MySQLConnector, o servidor MySQL e o arquivo .sql que contém as tabelas do sistema. Para que quando o sistema for instalado, a base de dados seja instalada no servidor.

Estou utilizando o VS2010.

Sames

Share this post


Link to post
Share on other sites
samesdavis

Olá pessoal,

Estou voltando com esse assunto porque faltou apenas um detalhe, eu não estou conseguindo inserir a base de dados no servidor, alghuém pode me ajudar com o inno Setup?

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Controle de Loja [babiluca]"
#define MyAppVersion "2.6"
#define MyAppPublisher "SD SOFT"
#define MyAppExeName "Babiluca.exe"
[setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{217F1A41-CEB5-4933-B431-BE844C524430}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=Setupsdsoft
Compression=lzma
SolidCompression=yes
[Languages]
Name: brazilianportuguese; MessagesFile: compiler:Languages\BrazilianPortuguese.isl
[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
[Files]
Source: D:\SISTEMAS\Babiluca\bin\Release\Babiluca.exe; DestDir: {app}; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
Source: Database.sql; DestDir: {app}; Flags: deleteafterinstall ignoreversion
Source: mysql_server.msi; DestDir: {app}; Flags: deleteafterinstall ignoreversion
Source: ..\..\..\..\mysql-connector-net-6.5.4.msi; DestDir: {app}; Flags: deleteafterinstall
Source: ..\..\..\..\ReportViewer.exe; DestDir: {app}; Flags: deleteafterinstall
Source: MySql.Data.dll; DestDir: {app}; Flags: ignoreversion
Source: mysqldump.exe; DestDir: {app}; Flags: ignoreversion
Source: mysql.exe; DestDir: {app}; Flags: ignoreversion
[icons]
Name: {group}\{#MyAppName}; Filename: {app}\{#MyAppExeName}
Name: {commondesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: desktopicon
[Run]
Filename: msiexec; Parameters: "/q /i ""mysql_server.msi"" INSTALLDIR=""c:\MySQL""  /qn"; WorkingDir: {app}; StatusMsg: Instalando o servidor MySQL...; Tasks: ; Languages: ; Flags: runhidden
Filename: C:\MySQL\bin\mysqld.exe; Parameters: --install; WorkingDir: {app}; StatusMsg: Instalando o serviço MySQL; Flags: runhidden
Filename: net.exe; Parameters: start mysql; StatusMsg: Inicializando o serviço MySQL...; Flags: runhidden; WorkingDir: {app}
Filename: C:\MySQL\bin\mysql.exe; Parameters: "-e update mysql.user set password='46049' where user='root'; -u root"; WorkingDir: {app}; StatusMsg: Configuring MYSQL; Flags: runhidden
Filename: C:\MySQL\bin\mysql.exe; Parameters: "-e flush privileges; -u root -padmin"; WorkingDir: {app}; StatusMsg: Configuring Database Servers...; Flags: runhidden
Filename: C:\MySQL\bin\mysql.exe; Parameters: "-u root -padmin -h localhost --execute=SOURCE ""database.sql"""; WorkingDir: {app}; StatusMsg: Loading Database...; Flags: runhidden
Filename: msiexec; Parameters: "/q /i ""mysql-connector-net-6.5.4.msi"" /qn"; StatusMsg: Instalando conexão com o servidor...; WorkingDir: {app}; Flags: runhidden
Filename: {app}\ReportViewer.exe; Parameters: /q:a /passive; StatusMsg: Instalando relatórios do sistema...; WorkingDir: {app}; Flags: runhidden
Filename: {app}\{#MyAppExeName}; Description: {cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}; Flags: nowait postinstall skipifsilent

Share this post


Link to post
Share on other sites
Nelson Sousa

Sames,

A inserção da base de dados vc pode fazer pelo seu sistema.

É uma execução de consulta.

Uma vez conectado ao servidor é só criar o BD e as tabelas via código.


Um Abraço,

Nelson Sousa

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.