2009-07-12

Inno Setup & MySQL. Full script

Hi !
Thx a lot to inno-developers team. Excellent job - guys!!

At this post I'll publish full script for mysql setup patch creation.

1. We'll use mysql-essential package
2. Put prepared my.ini to the mysql package
3. ... and script :)


#define RequirementsBin "pathTo\mysql_light\db"
#define BasePath "pathTo\mysql_light"
#define IncludeFramework true

[Setup]
AppName=[...]
AppVerName=[...]
AppPublisher=[...]
AppPublisherURL=[...]
DefaultDirName={pf}\[...]
DefaultGroupName=[...]
VersionInfoVersion=1.0
VersionInfoCompany=[...]
VersionInfoCopyright=copyrights 2009
VersionInfoDescription=[...]
AppCopyright=[...]
UsePreviousAppDir=true
PrivilegesRequired=admin
LicenseFile={#BasePath}\COPYING.txt
SolidCompression=true
InternalCompressLevel=max

[Icons]
Name: {group}\Uninstall MySQL; Filename: {uninstallexe}

[Languages]
Name: ru; MessagesFile: compiler:Languages\Russian.isl

[Run]
Filename: {app}\bin\mysqld; Parameters: --install; WorkingDir: {app}\bin; Flags: postinstall runhidden; StatusMsg: MySQL service installing; AfterInstall: InitializeService; Languages:

[UninstallRun]
Filename: {sys}\net; Parameters: stop MySQL; WorkingDir: {sys}
Filename: {app}\bin\mysqld; Parameters: --remove; WorkingDir: {app}\bin

[Files]
Source: {#RequirementsBin}\EXCEPTIONS-CLIENT; DestDir: {app}
Source: {#RequirementsBin}\COPYING; DestDir: {app}
Source: {#RequirementsBin}\my.ini; DestDir: {app}
Source: {#RequirementsBin}\bin\*; DestDir: {app}\bin; Flags: ignoreversion recursesubdirs
Source: {#RequirementsBin}\data\*; DestDir: {app}\data; Flags: ignoreversion recursesubdirs
Source: {#RequirementsBin}\include\*; DestDir: {app}\include; Flags: ignoreversion recursesubdirs
Source: {#RequirementsBin}\lib\*; DestDir: {app}\lib; Flags: ignoreversion recursesubdirs
Source: {#RequirementsBin}\share\*; DestDir: {app}\share; Flags: ignoreversion recursesubdirs

[Dirs]
Name: {app}\bin
Name: {app}\data
Name: {app}\include
Name: {app}\lib
Name: {app}\share

[Code]
procedure InitializeService();
var
ErrorCode: Integer;
begin
ShellExec('', ExpandConstant('{sys}\net.exe'),' start mysql', '', SW_SHOW, ewNoWait, ErrorCode);
end;

3 comments:

Livio said...

Gracias..funciona!!!

Livio said...

Gracias..funciona!!!

Sergio said...

Hola saludos desde colombia.

Tienes algun tutorial donde explique como crear el instalador , que instale el mysql ,cree los usuarios de mysql y cree la base de datos ahi mismo

Gracias.