diff --git a/Database/KH/Procedures/SAVE_TEXT_MESSAGE.sql b/Database/KH/Procedures/SAVE_TEXT_MESSAGE.sql index c3dfa6a..3bd9881 100644 --- a/Database/KH/Procedures/SAVE_TEXT_MESSAGE.sql +++ b/Database/KH/Procedures/SAVE_TEXT_MESSAGE.sql @@ -1,3 +1,4 @@ +SET TERM ^ ; /* Definition for the SAVE_TEXT_MESSAGE procedure : */ ------------------------------------------------------------------------------ @@ -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 \ No newline at end of file +END^ \ No newline at end of file diff --git a/Khernet.Installer/KhernetInstaller.iss b/Khernet.Installer/KhernetInstaller.iss index 9a7f69f..e65add4 100644 --- a/Khernet.Installer/KhernetInstaller.iss +++ b/Khernet.Installer/KhernetInstaller.iss @@ -7,8 +7,15 @@ #include #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} @@ -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] @@ -262,4 +284,32 @@ begin RenameFileDirectory(homeDirectoryPath + '\' + versionDirectory, oldVersionDirectory + '\' + versionDirectory + renameSuffix); RenameFileDirectory(homeDirectoryPath + '\' + packDirectory, oldVersionDirectory + '\' + packDirectory + renameSuffix); end -end; \ No newline at end of file +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; diff --git a/Khernet.UI/Khernet.UI.Presentation/Properties/AssemblyInfo.cs b/Khernet.UI/Khernet.UI.Presentation/Properties/AssemblyInfo.cs index afbbc31..4d33316 100644 --- a/Khernet.UI/Khernet.UI.Presentation/Properties/AssemblyInfo.cs +++ b/Khernet.UI/Khernet.UI.Presentation/Properties/AssemblyInfo.cs @@ -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")] diff --git a/KhernetUpdater.xml b/KhernetUpdater.xml index baa85c8..a8af7ef 100644 --- a/KhernetUpdater.xml +++ b/KhernetUpdater.xml @@ -1,7 +1,7 @@ - 0.17.0.0 - https://github.com/lemalcs/Khernet/releases/download/v0.17.0.0/KhernetUpdate-0.17.0.0.exe + 0.18.0.0 + https://github.com/lemalcs/Khernet/releases/download/v0.18.0.0/KhernetInstaller-0.18.0.0.exe /SP- /silent /noicons /NOCANCEL /dir="%path%" https://github.com/lemalcs/Khernet/releases/latest true diff --git a/Resources/Firebird-3.0-x86.zip b/Resources/Firebird-3.0-x86.zip new file mode 100644 index 0000000..0e439a4 Binary files /dev/null and b/Resources/Firebird-3.0-x86.zip differ diff --git a/Resources/izarc/IZARCE.exe b/Resources/izarc/IZARCE.exe new file mode 100644 index 0000000..031c38c Binary files /dev/null and b/Resources/izarc/IZARCE.exe differ diff --git a/Resources/izarc/cabinet.dll b/Resources/izarc/cabinet.dll new file mode 100644 index 0000000..7ac3ea7 Binary files /dev/null and b/Resources/izarc/cabinet.dll differ diff --git a/Resources/izarc/unacev2.dll b/Resources/izarc/unacev2.dll new file mode 100644 index 0000000..fcfa445 Binary files /dev/null and b/Resources/izarc/unacev2.dll differ diff --git a/Resources/izarc/unrar3.dll b/Resources/izarc/unrar3.dll new file mode 100644 index 0000000..9f1be4a Binary files /dev/null and b/Resources/izarc/unrar3.dll differ