From e109947a5f8ee3ecfe03b4107eb4dfa1152c80c4 Mon Sep 17 00:00:00 2001 From: gbamber Date: Mon, 30 Jan 2017 08:51:14 +0000 Subject: [PATCH] To v1.2.7.0 ReadMe now bundled as resource git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5731 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../latest_stable/updatepack/umainform.lfm | 1 + .../latest_stable/updatepack/umainform.pas | 35 ++++++++++++++++-- .../latest_stable/updatepack/updatepack.lpi | 5 ++- .../latest_stable/updatepack/updatepack.res | Bin 5092 -> 7180 bytes 4 files changed, 36 insertions(+), 5 deletions(-) diff --git a/components/lazautoupdate/latest_stable/updatepack/umainform.lfm b/components/lazautoupdate/latest_stable/updatepack/umainform.lfm index 61704000f..0651830fa 100644 --- a/components/lazautoupdate/latest_stable/updatepack/umainform.lfm +++ b/components/lazautoupdate/latest_stable/updatepack/umainform.lfm @@ -717,6 +717,7 @@ object mainform: Tmainform VersionCountLimit = 1000000 DownloadCountLimit = 10000000 ZipfileName = 'updatepack.zip' + WorkingMode = lauUpdate ShortCut.ShortcutName = 'MyShortcutName' ShortCut.Category = scAudioVideo Left = 424 diff --git a/components/lazautoupdate/latest_stable/updatepack/umainform.pas b/components/lazautoupdate/latest_stable/updatepack/umainform.pas index 8b0526308..2ddeab46f 100644 --- a/components/lazautoupdate/latest_stable/updatepack/umainform.pas +++ b/components/lazautoupdate/latest_stable/updatepack/umainform.pas @@ -38,7 +38,8 @@ interface uses Classes, SysUtils, LazUTF8, LazFileUtils, FileUtil, Forms, Controls, Dialogs, Buttons, Menus, StdCtrls, EditBtn, Spin, ComCtrls, ulazautoupdate, inifiles, - eventlog, umemoform, Zipper, strutils, asyncprocess, lclintf, types; + eventlog, umemoform, Zipper, strutils, asyncprocess, lclintf, types,LResources, + LCLVersion; type // Use FillVersionString and FillVersionInteger @@ -238,6 +239,10 @@ type var mainform: Tmainform; + sReadMePath:String; + aLRes: TLResource; + S: TResourceStream; + F: TFileStream; implementation @@ -382,6 +387,7 @@ begin ProfileConfig := TINIFile.Create(GetAppConfigDir(False) + C_PROFILECONFIGNAME); ProfilenameList := TStringList.Create; ProfileRec.DragFileStringList := TStringList.Create; + if FileExistsUTF8('readme.txt') then begin memo_intro.Lines.LoadFromFile('readme.txt'); @@ -672,8 +678,8 @@ end; procedure Tmainform.edt_WhatsNewTextFileChange(Sender: TObject); begin edt_WhatsNewTextFile.InitialDir := ExtractFileDir(ProfileRec.WhatsNewPath); + // ForceDirectoriesUTF8(ProfileRec.WhatsNewPath); ProfileRec.WhatsNewPath := edt_WhatsNewTextFile.Filename; - ForceDirectoriesUTF8(ProfileRec.WhatsNewPath); bCurrentProfileSaved := False; end; @@ -1033,7 +1039,7 @@ begin cmb_profile.Clear; cmb_profile.Items := ProfileNameList; // Set last item in list as current - cmb_profile.ItemIndex := cmb_profile.Items.Count - 1; + // cmb_profile.ItemIndex := cmb_profile.Items.Count - 1; bCurrentProfileSaved := False; end else @@ -1419,5 +1425,26 @@ begin LAUTRayINI.Free; end; end; - +initialization +// Unpack readme.txt +if (lcl_major > 0) and (lcl_minor > 6) then + begin + sReadMePath:=ProgramDirectory + 'readme.txt'; + // This uses a resource file added via Project/Options (Laz 1.7+) + if not FileExistsUTF8(sReadMePath) then + begin + // create a resource stream which points to the po file + S := TResourceStream.Create(HInstance, 'README', MakeIntResource(10)); + try + F := TFileStream.Create(sReadMePath, fmCreate); + try + F.CopyFrom(S, S.Size); // copy data from the resource stream to file stream + finally + F.Free; // destroy the file stream + end; + finally + S.Free; // destroy the resource stream + end; + end; + end; end. diff --git a/components/lazautoupdate/latest_stable/updatepack/updatepack.lpi b/components/lazautoupdate/latest_stable/updatepack/updatepack.lpi index 0ca97aca4..c394e92aa 100644 --- a/components/lazautoupdate/latest_stable/updatepack/updatepack.lpi +++ b/components/lazautoupdate/latest_stable/updatepack/updatepack.lpi @@ -14,6 +14,9 @@ + + + @@ -23,7 +26,7 @@ - + diff --git a/components/lazautoupdate/latest_stable/updatepack/updatepack.res b/components/lazautoupdate/latest_stable/updatepack/updatepack.res index d79b33defa3458fa42815b6749102c1f01bbee6f..ab4b62fdb2f12e1578ed8fe378743d4687fd909c 100644 GIT binary patch delta 2130 zcmZuy&2Ah;5T0;I6ibov2z8qzayHz^fs0wk$P&Z|Z?M4fp?9Wcw{dUxsJqAO@nyuF z8!y2Tlq2r|FTrCVg|E72ypCag*!4`;&-YW+f0sYM{_W3)4<5b$>*4R8JoxOFpC11) z{PUE~#;zzEU>_U3BB)(1*wy z`i_0j&eEr|^!H@%$=;V7qqZwLjmk%^<dI|e zXW2%IPNF;=AHJcU<33eJqZhO zMWI_Z&eZIwH0nkHS(gCk;8!hRs}<+}N@~2@pso&t&Svy3aOy%rbJ)zZm!)JLk=?_j zEndX|jhCm1Ih<8Xa?ONa`7Q{~OxIB=r#GmAu=I`49WfKCT)UppZAa&$K6hwYb}>RC zWE!e9gFo=}3W6p|z({JrK{K!>A)(9pmP)Q4ibC(QBEN|t2)Yzxkw@ex*tpW|1 zKX4G(AYLrDbk|AoJDzyU+Y8EYCj^eFwX$PxLwNu&AR?1g?o)Zv#kPxds6Em;-1e^%@dyo-39IF7AMlaDmh~=fqpg0KiwA*)W+Q@yAM2uckcV1hA}9x$e(F(N zF%lnU$TIeDVvV*Kz)Tsv1rKFnTT=aRrn5CeXQVrydzRrH%^)*;K{^b1fVc*|IQ4^W zNyx?;ImRFA5 z;6TuIsx~b;!IDXnkY*Qcg*E2(ZUE}_NupL^0cBsL9RZtW)1DvHR|?juX`z-E`PrF9 zyK^_R{lYWMHTgD~l}Yq**7S)LB*KGvkVk#N1FAnSd{Ps<}~}!Rr6``l%gs&=HAK zQGpfUWE+Jb(9&7Aj997qicOzogy!%+mQ~;=Yo=u%Ma=|ag@Z}`+%j#1Gb|mDiEV>- ze2w#(Wo7O9TY&L0rlzqI$9qqvA^>P2f>>4S+od+7-fA6Mqx$?_re>ZmDvO0o&$8oH zgVH&;{AiZT=S0W2KLxmmE>6ammg(7~J9CX|SzCFLxWBa*M(Q=+Q+~d?Pv_1ydewQp XNH-I5R?gxg?|3$wz5jgg*T???zQoxM delta 25 hcmeCNc%r`H92+Cs=JRYDnHbF`H*)UYoFcS>699pr34Z_p