diff --git a/.github/build_ubuntu.sh b/.github/build_ubuntu.sh index cbc8d41e..e5e9e220 100755 --- a/.github/build_ubuntu.sh +++ b/.github/build_ubuntu.sh @@ -52,6 +52,8 @@ chmod +x linuxdeploy-x86_64.AppImage curl -L -O https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage chmod +x linuxdeploy-plugin-qt-x86_64.AppImage -VERSION= ./linuxdeploy-x86_64.AppImage -e transgui --create-desktop-file \ +app_ver=$(cat ../VERSION.txt) +VERSION=$app_ver ./linuxdeploy-x86_64.AppImage -e transgui --create-desktop-file \ --appdir AppDir --output appimage -i ../transgui.png --plugin qt -sha256sum transgui--x86_64.AppImage +sha256sum transgui-${app_ver}-x86_64.AppImage +mv transgui-${app_ver}-x86_64.AppImage transgui-x86_64.AppImage diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 1c40c5a1..5a52b3c6 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -30,4 +30,4 @@ jobs: - uses: actions/upload-artifact@v3 with: name: TransGUI Linux - path: units/transgui--x86_64.AppImage + path: units/transgui-x86_64.AppImage diff --git a/VERSION.txt b/VERSION.txt index 391dca82..73efe935 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.18.0 +5.18.0.f diff --git a/main.pas b/main.pas index 5e9d402b..7e9c8ed6 100644 --- a/main.pas +++ b/main.pas @@ -43,11 +43,11 @@ interface Graphics, Dialogs, ComCtrls, Menus, ActnList, LCLVersion, httpsend, StdCtrls, fpjson, jsonparser, ExtCtrls, rpc, syncobjs, variants, varlist, IpResolver, zipper, ResTranslator, VarGrid, StrUtils, LCLProc, Grids, BaseForm, utils, AddTorrent, Types, - LazFileUtils, LazUTF8, StringToVK, passwcon, GContnrs,lineinfo, RegExpr; - -const - AppName = 'Transmission Remote GUI'; - AppVersion = '5.18.0'; + LazFileUtils, LazUTF8, StringToVK, passwcon, GContnrs,lineinfo, RegExpr, + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + fileinfo, winpeimagereader, elfreader, machoreader; resourcestring sAll = 'All torrents'; @@ -793,6 +793,8 @@ TMainForm = class(TBaseForm) procedure _onException(Sender: TObject; E: Exception); end; +function AppName: string; +function AppVersion: string; function ExcludeInvalidChar (path: string): string; // PETROV function GetBiDi: TBiDiMode; function CheckAppParams: boolean; @@ -979,10 +981,36 @@ implementation SizeNames: array[1..5] of string = (sByte, sKByte, sMByte, sGByte, sTByte); var + FAppName: string; + FAppVersion: string; TR_STATUS_STOPPED, TR_STATUS_CHECK_WAIT, TR_STATUS_CHECK, TR_STATUS_DOWNLOAD_WAIT, TR_STATUS_DOWNLOAD, TR_STATUS_SEED_WAIT, TR_STATUS_SEED: integer; +function AppName: string; +begin + Result := FAppName; +end; - {$ifdef windows} +function AppVersion: string; +begin + Result := FAppVersion; +end; + +procedure ReadVersionInfo; +var + file_ver_info : TFileVersionInfo; +begin + {{ https://wiki.lazarus.freepascal.org/Show_Application_Title,_Version,_and_Company }} + file_ver_info := TFileVersionInfo.Create(nil); + try + file_ver_info.ReadFileInfo; + FAppName := file_ver_info.VersionStrings.Values['ProductName']; + FAppVersion := file_ver_info.VersionStrings.Values['ProductVersion']; + finally + file_ver_info.Free; + end; +end; + +{$ifdef windows} function WndCallback(Ahwnd: HWND; uMsg: UINT; wParam: WParam; lParam: LParam):LRESULT; stdcall; begin if (uMsg=WM_HOTKEY) and (WParam=HotKeyID) then @@ -995,7 +1023,7 @@ function WndCallback(Ahwnd: HWND; uMsg: UINT; wParam: WParam; lParam: LParam):LR result:=CallWindowProc(PrevWndProc,Ahwnd, uMsg, WParam, LParam); end; - {$endif windows} +{$endif windows} function IsHash(Hash: String): boolean; var i: integer; @@ -8032,6 +8060,7 @@ procedure TMainForm.FillSpeedsMenu; initialization {$I main.lrs} + ReadVersionInfo; finalization try diff --git a/transgui.lpi b/transgui.lpi index 947eface..32e5d50c 100644 --- a/transgui.lpi +++ b/transgui.lpi @@ -266,7 +266,7 @@ - +