Membuat paket instalasi vb + firebird dengan inno setup

Posted by Kamarudin • 3 minute read • Comments

Menyambung postingan saya sebelumnya Membuat paket instalasi vb + mysql dengan inno setup kali ini database yang kita paketkan adalah Firebird. Adapun hal-hal yang perlu dipersiapkan :

  1. File Setup Firebird (saat postingan ini dibuat versi Firebird-2.1.3.18185_0_Win32)
  2. File OdbcFb32.dll hasil dari instalasi Firebird ODBC yang ada di c:\windows\system32
  3. Inno Setup

Karena semua persiapan sudah oke, berikut skrip instalasinya :

;Skrip instalasi by k4m4r82
;http://coding4ever.wordpress.com

[Setup]
AppName=Retail Manager Pro
AppVerName=Retail Manager Pro Versi 1.0.0.50
AppPublisher=K4m4r82's Laboratory
AllowCancelDuringInstall = yes
DefaultDirName={pf}\RetailManagerPro
DefaultGroupName=Retail Manager Pro
Compression = lzma
SolidCompression = yes
OutputBaseFilename=SetupRetailManagerPro
AllowNoIcons = yes
AlwaysRestart = no
AlwaysShowComponentsList = no
DisableProgramGroupPage = yes
AppendDefaultDirName = yes
CreateUninstallRegKey = yes
DisableStartupPrompt = yes
LanguageDetectionMethod=none
ShowLanguageDialog=no
Uninstallable = yes
UninstallFilesDir={app}\uninst
UninstallDisplayIcon={app}\RetailManager.exe,0
UninstallDisplayName=Retail Manager Pro
WindowVisible = no
AppCopyright=Copyright © 2009 K4m4r82's Laboratory
FlatComponentsList = yes
PrivilegesRequired = admin
VersionInfoVersion=1.0.0.50
SetupIconFile=Setup.ico
WizardImageFile=SetupModern21.bmp
WizardSmallImageFile=SetupModernSmall21.bmp

[Languages]
Name: ina; MessagesFile: compiler:Indonesia.isl
Name: en; MessagesFile: compiler:Default.isl

[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked

[Files]
;Visual Basic Runtime
Source: dll&ocx\VB6STKIT.DLL; DestDir: {sys}; Flags: uninsneveruninstall onlyifdoesntexist
Source: dll&ocx\COMCAT.DLL; DestDir: {sys}; Flags: uninsneveruninstall sharedfile regserver onlyifdoesntexist
Source: dll&ocx\stdole2.tlb; DestDir: {sys}; Flags: uninsneveruninstall sharedfile regtypelib
Source: dll&ocx\asycfilt.dll; DestDir: {sys}; Flags: uninsneveruninstall onlyifdoesntexist
Source: dll&ocx\olepro32.dll; DestDir: {sys}; Flags: uninsneveruninstall sharedfile regserver onlyifdoesntexist
Source: dll&ocx\oleaut32.dll; DestDir: {sys}; Flags: uninsneveruninstall sharedfile regserver onlyifdoesntexist
Source: dll&ocx\msvbvm60.dll; DestDir: {sys}; Flags: uninsneveruninstall sharedfile regserver onlyifdoesntexist

;file hasil instalasi firebird odbc
Source: C:\WINDOWS\system32\OdbcFb32.dll; DestDir: {sys}; Flags: restartreplace sharedfile regserver onlyifdoesntexist

;file installer database firebird sesuaikan dengan versi yang Anda download
Source: main\Firebird-2.1.3.18185_0_Win32.exe; DestDir: "{tmp}"; Flags: deleteafterinstall

;My Application Runtime
Source: main\RetailManager.exe; DestDir: {app}; Flags: ignoreversion
Source: main\RetailManager.pdf; DestDir: {app}; Flags: ignoreversion
Source: main\RETAIL_MANAGER.FDB; DestDir: {app}\Db; Flags: onlyifdoesntexist
Source: main\RetailManager.exe.manifest; DestDir: {app}; Flags: ignoreversion

Source: dll&ocx\cTreeOpt6.ocx; DestDir: {sys}; Flags: uninsneveruninstall sharedfile regserver onlyifdoesntexist
Source: dll&ocx\vbalDTab6.ocx; DestDir: {sys}; Flags: uninsneveruninstall sharedfile regserver onlyifdoesntexist
Source: dll&ocx\vbalExpBar6.ocx; DestDir: {sys}; Flags: uninsneveruninstall sharedfile regserver onlyifdoesntexist
Source: dll&ocx\mscomctl.ocx; DestDir: {sys}; Flags: uninsneveruninstall sharedfile regserver onlyifdoesntexist
Source: dll&ocx\vbalIml6.ocx; DestDir: {sys}; Flags: uninsneveruninstall sharedfile regserver onlyifdoesntexist
Source: dll&ocx\cPopMenu6.ocx; DestDir: {sys}; Flags: uninsneveruninstall sharedfile regserver onlyifdoesntexist
Source: dll&ocx\LVbuttons.ocx; DestDir: {sys}; Flags: uninsneveruninstall sharedfile regserver onlyifdoesntexist
Source: dll&ocx\MyTextBox.ocx; DestDir: {sys}; Flags: uninsneveruninstall sharedfile regserver onlyifdoesntexist
Source: dll&ocx\MSCOMCT2.OCX; DestDir: {sys}; Flags: uninsneveruninstall sharedfile regserver onlyifdoesntexist
Source: dll&ocx\vbalMDITabs6.dll; DestDir: {sys}; Flags: uninsneveruninstall sharedfile regserver onlyifdoesntexist
Source: dll&ocx\SSubTmr6.dll; DestDir: {sys}; Flags: uninsneveruninstall sharedfile regserver onlyifdoesntexist
Source: dll&ocx\scrrun.dll; DestDir: {sys}; Flags: uninsneveruninstall sharedfile regserver onlyifdoesntexist
Source: dll&ocx\cNewMenu6.dll; DestDir: {sys}; Flags: uninsneveruninstall sharedfile regserver onlyifdoesntexist
Source: dll&ocx\msado21.tlb; DestDir: {sys}; Flags: uninsneveruninstall sharedfile regtypelib

[Icons]
Name: {group}\Retail Manager Pro; Filename: {app}\RetailManager.exe; WorkingDir: {app}
Name: {group}\Retail Manager Pro User Manual; Filename: {app}\RetailManager.pdf; WorkingDir: {app}

Name: {userdesktop}\Retail Manager Pro; Filename: {app}\RetailManager.exe; WorkingDir: {app}; Tasks: desktopicon
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\Retail Manager Pro; Filename: {app}\RetailManager.exe; WorkingDir: {app}; Tasks: quicklaunchicon

[Registry]
;mencatat lokasi instalasi program, ini dibutuhkan jika kita ingin membuat paket instalasi update
Root: HKCU; Subkey: "Software\K4m4r82`s Laboratory\RetailManager"; ValueName: "installDir"; ValueType: String; ValueData: {app}; Flags: uninsdeletevalue

[INI]
Filename: "{app}\infoProgram.ini"; Section: "Sistem"; Key: "serverName"; String: "127.0.0.1"
Filename: "{app}\infoProgram.ini"; Section: "Sistem"; Key: "dbPath"; String: "{app}\Db"

[Run]
;install firebird
Filename: "{tmp}\Firebird-2.1.3.18185_0_Win32.exe"; Parameters: "/SP- /NORESTART /NOCPL /NOICONS /SILENT /FORCE /COMPONENTS=""servercomponent\superservercomponent, SuperServerComponent, ServerComponent, ClientComponent, DevAdminComponent"""; StatusMsg: "Instalasi Firebird 2.0 Server..."

;daftarkan port firebird (3050) ke windows firewall
Filename: "{sys}\netsh.exe"; Parameters: "firewall add portopening TCP 3050 ""Service Firebird Server"""; StatusMsg: "Mendaftarkan port Service Firebird ..."; Flags: runhidden; MinVersion: 0,5.01.2600sp2
Filename: "{sys}\netsh.exe"; Parameters: "firewall add allowedprogram ""{pf}\Firebird\Firebird_2_0\bin\fbserver.exe"" ""Firebird Server"" ENABLE ALL"; StatusMsg: "Mendaftarkan Firebird Server ..."; Flags: runhidden; MinVersion: 0,5.01.2600sp2

;menjalankan service firebird
Filename: "{pf}\Firebird\Firebird_2_0\bin\fbserver.exe"; Parameters: "-a"; StatusMsg: "Menjalankan service firebird"; Flags: waituntilidle

[UninstallRun]
Filename: "{sys}\netsh.exe"; Parameters: "firewall delete portopening protocol = TCP port = 3050"; Flags: runhidden; MinVersion: 0,5.01.2600sp2
Filename: "{sys}\netsh.exe"; Parameters: "firewall delete allowedprogram ""{pf}\Firebird\Firebird_2_0\bin\fbserver.exe"""; Flags: runhidden; MinVersion: 0,5.01.2600sp2

Selamat mencoba :blush:

Comments