Skip to content

Commit

Permalink
Add installer for version 0.18.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
lemalcs committed Nov 30, 2021
1 parent 115286d commit 8522c03
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Database/KH/Procedures/SAVE_TEXT_MESSAGE.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
SET TERM ^ ;
/* Definition for the SAVE_TEXT_MESSAGE procedure : */

------------------------------------------------------------------------------
Expand Down Expand Up @@ -116,4 +117,4 @@ BEGIN
INSERT INTO MESSAGE_NOTIFICATION(ID_SENDER,ID_MESSAGE,CONTENT_TYPE)
VALUES(:ID_SENDER_TOKEN,:ID_MESSAGE,:CONTENT_TYPE);
END
END
END^
56 changes: 53 additions & 3 deletions Khernet.Installer/KhernetInstaller.iss
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@
#include <idp.iss>

#define ApplicationName "Khernet"
#define CurrentVersion "0.17.0.0"
#define CurrentVersion "0.18.0.0"
#define AppDirectoryName "khernet-app"
#define SQLScript "SAVE_TEXT_MESSAGE.sql"
#define IzarcDirectory "izarc"
#define IzarcExec "IZARCE.exe"
#define FirebirdDirectory "firebird"
#define FirebirdCompressed "Firebird-3.0-x86.zip"
#define IsqlName "isql.exe"
#define ScriptDirectory "Scripts"

[Setup]
AppName={#ApplicationName}
Expand Down Expand Up @@ -52,13 +59,28 @@ Name: portablemode; Description: "Portable Mode"
Name: "{group}\{#ApplicationName}"; Filename: "{app}\{#ApplicationName}.exe"; WorkingDir: "{app}"
Name: "{group}\Uninstall {#ApplicationName}"; Filename: "{uninstallexe}"

[Dirs]
Name: {tmp}\{#FirebirdDirectory}; Flags: deleteafterinstall;
Name: {tmp}\{#ScriptDirectory}; Flags: deleteafterinstall;
Name: {tmp}\{#IzarcDirectory}; Flags: deleteafterinstall;


[Files]
; Remove old versions of main executable.
Source: "..\bin\Khernet.UI\{#ApplicationName}.exe"; Check:FileExists(ExpandConstant('{app}\{#AppDirectoryName}\app\{#ApplicationName}.exe')); DestDir: "{app}\{#AppDirectoryName}\app"; AfterInstall:RemoveFile(ExpandConstant('{app}\{#AppDirectoryName}\app\{#ApplicationName}.exe'));

; Install the new main executable.
Source: "..\bin\Khernet.UI\{#ApplicationName}.exe"; DestDir: "{app}"; AfterInstall:DeployFileSystem(ExpandConstant('{app}\{#AppDirectoryName}'));
Source: "..\bin\Khernet.UI\{#ApplicationName}.exe"; DestDir: "{app}"; AfterInstall:DeployFileSystem(ExpandConstant('{app}\{#AppDirectoryName}'));

; Install compress utility
Source: "..\Resources\izarc\cabinet.dll"; DestDir:"{tmp}\{#IzarcDirectory}"; Flags: deleteafterinstall;
Source: "..\Resources\izarc\unacev2.dll"; DestDir:"{tmp}\{#IzarcDirectory}"; Flags: deleteafterinstall;
Source: "..\Resources\izarc\unrar3.dll"; DestDir:"{tmp}\{#IzarcDirectory}"; Flags: deleteafterinstall;
Source: "..\Resources\izarc\{#IzarcExec}"; DestDir:"{tmp}\{#IzarcDirectory}"; Flags: deleteafterinstall;

; Modify database
Source: "..\Database\KH\Procedures\{#SQLScript}"; DestDir: "{tmp}\{#ScriptDirectory}"; Flags: deleteafterinstall;
Source: "..\Resources\{#FirebirdCompressed}"; DestDir:"{tmp}"; AfterInstall:ExecuteDatabaseScript(ExpandConstant('{app}\{#AppDirectoryName}\data\msgdb')); Flags: deleteafterinstall;


[Run]
Expand Down Expand Up @@ -262,4 +284,32 @@ begin
RenameFileDirectory(homeDirectoryPath + '\' + versionDirectory, oldVersionDirectory + '\' + versionDirectory + renameSuffix);
RenameFileDirectory(homeDirectoryPath + '\' + packDirectory, oldVersionDirectory + '\' + packDirectory + renameSuffix);
end
end;
end;
// Uncompress the Firebird database engine
function UncompressDatabaseEngine(compressor: String; enginePath: String): Boolean;
var
ResultCode: Integer;
begin
if not Exec(compressor, ' -e -d ' + enginePath + ' -p'+ExpandConstant('{tmp}\{#FirebirdDirectory}'), '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
MsgBox('Error while installing database change ' + IntToStr(Resultcode) + ': ' + SysErrorMessage(ResultCode), mbInformation, MB_OK);
result:= false;
end
else
result:=true;
end;
// Executes script to modify database.
procedure ExecuteDatabaseScript(databasePath: String);
var
ResultCode: Integer;
begin
if UncompressDatabaseEngine(ExpandConstant('{tmp}\{#IzarcDirectory}\{#IzarcExec}'), ExpandConstant('{tmp}\{#FirebirdCompressed}')) then
begin
if not Exec(ExpandConstant('{tmp}\{#FirebirdDirectory}\{#IsqlName}'), databasePath + ' -user SYSDBA -password blank -i ' + ExpandConstant('{tmp}\{#ScriptDirectory}\{#SQLScript}'), '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
MsgBox('Error while installing database change ' + IntToStr(Resultcode) + ': ' + SysErrorMessage(ResultCode), mbInformation, MB_OK);
end;
end;
end;
4 changes: 2 additions & 2 deletions Khernet.UI/Khernet.UI.Presentation/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
ResourceDictionaryLocation.SourceAssembly
)]

[assembly: AssemblyVersion("0.17.0.0")]
[assembly: AssemblyFileVersion("0.17.0.0")]
[assembly: AssemblyVersion("0.18.0.0")]
[assembly: AssemblyFileVersion("0.18.0.0")]
4 changes: 2 additions & 2 deletions KhernetUpdater.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>0.17.0.0</version>
<url>https://github.com/lemalcs/Khernet/releases/download/v0.17.0.0/KhernetUpdate-0.17.0.0.exe</url>
<version>0.18.0.0</version>
<url>https://github.com/lemalcs/Khernet/releases/download/v0.18.0.0/KhernetInstaller-0.18.0.0.exe</url>
<args>/SP- /silent /noicons /NOCANCEL /dir="%path%"</args>
<changelog>https://github.com/lemalcs/Khernet/releases/latest</changelog>
<mandatory>true</mandatory>
Expand Down
Binary file added Resources/Firebird-3.0-x86.zip
Binary file not shown.
Binary file added Resources/izarc/IZARCE.exe
Binary file not shown.
Binary file added Resources/izarc/cabinet.dll
Binary file not shown.
Binary file added Resources/izarc/unacev2.dll
Binary file not shown.
Binary file added Resources/izarc/unrar3.dll
Binary file not shown.

0 comments on commit 8522c03

Please sign in to comment.