• R/O
  • SSH

wp2latex: Commit

WP2LaTeX sources.


Commit MetaInfo

Revision7326e034f7d125f80b1069ffb7201e3ba69aa231 (tree)
Time2022-01-03 08:25:26
AuthorFojtik
CommiterFojtik

Log Message

Improve installation process on 64bit Win type OS.

Change Summary

Incremental Difference

diff -r c42f9c59b908 -r 7326e034f7d1 trunk/instaler/WP2LaTeX.iss
--- a/trunk/instaler/WP2LaTeX.iss Sun Jan 02 04:33:09 2022 +0100
+++ b/trunk/instaler/WP2LaTeX.iss Mon Jan 03 00:25:26 2022 +0100
@@ -104,6 +104,69 @@
104104
105105 [Code]
106106
107+
108+function SearchForMikTex: string;
109+var
110+ str: String;
111+ NameFound: String;
112+ FindRec: TFindRec;
113+begin
114+ NameFound := '';
115+ Result := '';
116+
117+ // Try to find the highest version of MikTeX.
118+
119+ if IsWin64() then begin
120+ str := ExpandConstant('{pf32}') + '\';
121+ //MsgBox(str, mbInformation, MB_OK);
122+ if FindFirst(ExpandConstant(str+'MiKTeX*'), FindRec) then begin
123+ repeat
124+ // Look only for directories
125+ if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY = FILE_ATTRIBUTE_DIRECTORY then
126+ begin
127+ if FindRec.Name > NameFound then
128+ NameFound := FindRec.Name;
129+ Result := str + NameFound;
130+ end
131+ until not FindNext(FindRec);
132+ end
133+ FindClose(FindRec);
134+
135+ str := ExpandConstant('{pf64}') + '\';
136+ //MsgBox(str, mbInformation, MB_OK);
137+ if FindFirst(ExpandConstant(str+'MiKTeX*'), FindRec) then begin
138+ repeat
139+ // Look only for directories
140+ if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY = FILE_ATTRIBUTE_DIRECTORY then
141+ begin
142+ if FindRec.Name > NameFound then
143+ NameFound := FindRec.Name;
144+ Result := str + NameFound;
145+ end
146+ until not FindNext(FindRec);
147+ end
148+ FindClose(FindRec);
149+ end
150+ else begin
151+ str := ExpandConstant('{pf}') + '\';
152+ //MsgBox(str, mbInformation, MB_OK);
153+ if FindFirst(ExpandConstant(str+'MiKTeX*'), FindRec) then begin
154+ repeat
155+ // Look only for directories
156+ if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY = FILE_ATTRIBUTE_DIRECTORY then
157+ begin
158+ if FindRec.Name > NameFound then
159+ NameFound := FindRec.Name;
160+ Result := str + NameFound;
161+ end
162+ until not FindNext(FindRec);
163+ end
164+ FindClose(FindRec);
165+ end
166+
167+end;
168+
169+
107170 var
108171 MikTeX_Label1: TLabel;
109172 MikTeX_Label2: TLabel;
@@ -137,9 +200,7 @@
137200
138201 function MikTeX_form_CreatePage(PreviousPageId: Integer): Integer;
139202 var
140- Page: TWizardPage;
141- str: String;
142- FindRec: TFindRec;
203+ Page: TWizardPage;
143204 NameFound: String;
144205
145206 begin
@@ -207,40 +268,11 @@
207268 OnClick := @MikTeX_form_BrowseButtonClick;
208269 end;
209270
210- str := ExpandConstant('{pf}') + '\';
211- // Try to find highest version of MikTeX.
212- NameFound := '';
213- if FindFirst(ExpandConstant(str+'MiKTeX*'), FindRec) then begin
214- repeat
215- // Look only for directories
216- if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY = FILE_ATTRIBUTE_DIRECTORY then
217- begin
218- if FindRec.Name > NameFound then
219- NameFound := FindRec.Name;
220- end
221- until not FindNext(FindRec);
222- end
223- FindClose(FindRec);
271+ NameFound := SearchForMikTex;
224272
225- if IsWin64() then begin
226- str := ExpandConstant('{pf32}') + '\';
227- if FindFirst(ExpandConstant(str+'MiKTeX*'), FindRec) then begin
228- repeat
229- // Look only for directories
230- if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY = FILE_ATTRIBUTE_DIRECTORY then
231- begin
232- if FindRec.Name > NameFound then
233- NameFound := FindRec.Name;
234- end
235- until not FindNext(FindRec);
236- end
237- FindClose(FindRec);
238- end
239-
240- if NameFound<>'' then begin
241- str := str + NameFound + '\';
242- MikTeX_Editbox1.Text:=str;
243- MikTeX_Checkbox1.Checked:=true;
273+ if NameFound<>'' then begin
274+ MikTeX_Editbox1.Text := NameFound + '\';
275+ MikTeX_Checkbox1.Checked := true;
244276 end
245277
246278 with Page do
diff -r c42f9c59b908 -r 7326e034f7d1 trunk/sources.cc/images.cc
--- a/trunk/sources.cc/images.cc Sun Jan 02 04:33:09 2022 +0100
+++ b/trunk/sources.cc/images.cc Mon Jan 03 00:25:26 2022 +0100
@@ -1943,8 +1943,7 @@
19431943 float *Points = LoadPoints(cq, 2, bbx);
19441944 if(Points==NULL) break;
19451945 VectorLine *pVecLine = new VectorLine(Points, 2);
1946- pVecLine->AttribFromPSS(PSS);
1947- //pVecLine->Transform(vecResizeXY(WPGu2PSu(1)));
1946+ pVecLine->AttribFromPSS(PSS);
19481947 VectList.AddObject(pVecLine);
19491948 break;
19501949 }
@@ -1956,9 +1955,8 @@
19561955
19571956 VectorLine *pVecLine = new VectorLine(Points, WPG.Curve.Count);
19581957 Points = NULL;
1959- pVecLine->AttribFromPSS(PSS);
1960- pVecLine->Close = false;
1961- //pVecLine->Transform(vecResizeXY(WPGu2PSu(1)));
1958+ pVecLine->AttribFromPSS(PSS);
1959+ pVecLine->Close = false;
19621960 VectList.AddObject(pVecLine); pVecLine=NULL;
19631961 break;
19641962 }
@@ -1973,7 +1971,6 @@
19731971 WPG.Rectangle.Y, WPG.Rectangle.Y+WPG.Rectangle.Height,
19741972 WPG.Rectangle.X, WPG.Rectangle.X+WPG.Rectangle.Width);
19751973 pRect->AttribFromPSS(PSS);
1976- //pRect->Transform(vecResizeXY(WPGu2PSu(1))); // Transform WPu to PSu
19771974 VectList.AddObject(pRect);
19781975 }
19791976 break;
@@ -1987,7 +1984,6 @@
19871984 Points = NULL;
19881985 pVecPoly->AttribFromPSS(PSS);
19891986 pVecPoly->Close = true;
1990- //pVecPoly->Transform(vecResizeXY(WPGu2PSu(1)));
19911987 VectList.AddObject(pVecPoly); pVecPoly=NULL;
19921988 free(Points);
19931989 break;
@@ -2133,8 +2129,7 @@
21332129 else // Curve is deffective, plot at least polyline.
21342130 pVecLine = new VectorLine(Points, WPG.Curve.Count);
21352131
2136- pVecLine->AttribFromPSS(PSS);
2137- //pVecLine->Transform(vecResizeXY(WPGu2PSu(1)));
2132+ pVecLine->AttribFromPSS(PSS);
21382133 VectList.AddObject(pVecLine);
21392134 break;
21402135 }
diff -r c42f9c59b908 -r 7326e034f7d1 trunk/sources.cc/wp2latex.h
--- a/trunk/sources.cc/wp2latex.h Sun Jan 02 04:33:09 2022 +0100
+++ b/trunk/sources.cc/wp2latex.h Mon Jan 03 00:25:26 2022 +0100
@@ -17,8 +17,8 @@
1717
1818 #define LineLength 80 /* Split lines after more than LineLength charcters */
1919
20-#define VersionWP2L "3.103"
21-#define VersionDate "2 Jan 2022" /* day (space) month (space) full year */
20+#define VersionWP2L "3.pre104"
21+#define VersionDate "3 Jan 2022" /* day (space) month (space) full year */
2222
2323 #ifndef false
2424 #define false 0
Show on old repository browser