unit ReleaseForm; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ShellAPI, SynCommons; type TForm1 = class(TForm) Label1: TLabel; Label2: TLabel; Edit1: TEdit; Button1: TButton; Memo1: TMemo; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private public end; var Form1: TForm1; implementation {$R *.dfm} {$R vista.RES} // includes Win10 manifest - use .RES for linux cross-compilation procedure TForm1.Button1Click(Sender: TObject); var SearchVersion, Text, Head: string; procedure ProcessFile(const FN: TFileName); var SL: TStringList; s,tag,title: string; i,j,k,l: integer; first,titledone: boolean; begin SL := TStringList.Create; try SL.LoadFromFile(FN); first := false; titledone := false; for i := 0 to SL.Count-1 do begin s := trim(SL[i]); if s='' then continue; if not titledone and (s[1]='/') then begin while (s<>'') and (s[1] in [' ','/']) do delete(s,1,1); if s='' then continue; if s[1]='-' then titledone := true else title := title+s+' '; end; if SameText(s,'interface') then exit else if IdemPChar(pointer(s),'UNIT ') then first := true else if first and (copy(s,length(s)-length(SearchVersion)+1,length(SearchVersion))=SearchVersion) then begin s := ExtractFileName(FN); tag := copy(s,1,pos('.',s)-1); Head := Head+#13#10'
  • '+s+' - '+trim(title)+';
  • '; Text := Text+#13#10'

    Unit '+s+'

    '#13#10; for j := i+1 to SL.Count-1 do begin s := trim(SL[j]); if s='' then break; if s[1]='-' then begin delete(s,1,1); if first then begin first := false; Text := Text+''#13#10; exit; end; end; finally SL.Free; end; end; procedure Search(const Folder: TFileName); var SR: TSearchRec; begin if FindFirst(Folder+'*.pas',faAnyFile,SR)<>0 then exit; repeat if IdemPChar(pointer(SR.Name),'SYN') or IdemPChar(pointer(SR.Name),'MORMOT') then ProcessFile(Folder+SR.Name); until FindNext(SR)<>0; FindClose(SR); end; begin SearchVersion := Edit1.Text; Search(ExtractFilePath(paramstr(0))+'..\..\..\'); // D:\Dev\Lib Search(ExtractFilePath(paramstr(0))+'..\..\..\SynDBDataSet\'); Search(ExtractFilePath(paramstr(0))+'..\..\'); // D:\Dev\Lib\SQLite3 Head[length(Head)-5] := '.'; Text := '

    Our Open Source '+ 'mORMot framework is now available in revision '+ SearchVersion+'.

    '#13#10#13#10+ '

    The main new features are the following:

    '#13#10+ '

    Go down to the download and forum links.'#13#10+ '

    Synopse mORMot '+SearchVersion+' fixes and enhancements

    '#13#10+ '

    This is a per-unit list of changes for the '+SearchVersion+ ' release of mORMot:

    '#13#10'

    Changes in details:
    '#13#10+Text+#13#10'


    '+ '

    Synopse mORMot download

    '+ 'To get it, go to this '+ 'download page, or use the '+ 'source...

    Do not forget to get and read the '+ 'full reference documentation available there (mainly the "SAD" - Software Architecture Design - document).

    '#13#10+ '

    Feedback and questions are welcome in our forum, just '+ 'as usual.

    '; Memo1.Text := Text; end; procedure TForm1.Button2Click(Sender: TObject); var FN: TFileName; version, content: string; begin version := Edit1.Text; content := Memo1.Text; if content='' then begin Button1Click(nil); content := Memo1.Text; end; FN := ChangeFileExt(paramstr(0),'_'+Version+'.htm'); with TFileStream.Create(FN,fmCreate) do try content := ''+Caption+' '+Version+''+ ''+Content+''; Write(content[1],length(content)); finally Free; end; if DebugHook=0 then ShellExecute(0,nil,pointer(FN),nil,nil,SW_SHOWNORMAL); end; end.