@@ -99,83 +99,33 @@ FunctionEnd
9999
100100Var HspFinishLogEdit
101101
102- ; Load %TEMP%\HyperlinksSpaceUpdater.log into $R8. Show the *tail* (last HSP_LOG_TAIL_LINES lines) if the file is long;
103- ; cap total size near NSIS string limits (~8k TCHAR) for SetWindowText on the finish page.
104- !define HSP_LOG_TAIL_LINES 1200
105- !define HSP_LOG_MAX_CHARS 7800
106-
107- Function HspFinishPageReadLog
108- Call HspEnsureUpdaterLogPath
109- IfFileExists " $HspLogFile" hspFinishLogExists hspFinishLogMissing
110- hspFinishLogMissing:
111- StrCpy $R8 " No installation log file was found.$\r$\n "
112- Return
113- hspFinishLogExists:
114- ; Pass 1: count lines (for tail selection).
115- StrCpy $R3 0
116- FileOpen $R0 " $HspLogFile" r
117- hspFinishCountLoop:
118- FileRead $R0 $1
119- IfErrors hspFinishCountDone
120- IntOp $R3 $R3 + 1
121- Goto hspFinishCountLoop
122- hspFinishCountDone:
123- FileClose $R0
124-
125- ; If line count > HSP_LOG_TAIL_LINES, skip leading lines so the finish page shows the *latest* entries.
126- IntCmp $R3 ${HSP_LOG_TAIL_LINES} hspFinishEq hspFinishLt hspFinishGt
127- hspFinishLt:
128- StrCpy $R2 0
129- StrCpy $R5 0
130- Goto hspFinishBuild
131- hspFinishEq:
132- StrCpy $R2 0
133- StrCpy $R5 0
134- Goto hspFinishBuild
135- hspFinishGt:
136- IntOp $R2 $R3 - ${HSP_LOG_TAIL_LINES}
137- StrCpy $R5 $R2
138-
139- hspFinishBuild:
140- StrCpy $R8 " "
141- IntCmp $R5 0 hspFinishSkipPrefix
142- StrCpy $R8 " ... ($R5 earlier lines not shown)$\r$\n "
143- hspFinishSkipPrefix:
144- FileOpen $R0 " $HspLogFile" r
145- hspFinishLineLoop:
146- FileRead $R0 $1
147- IfErrors hspFinishReadDone
148- IntCmp $R2 0 hspFinishAppendLine
149- IntOp $R2 $R2 - 1
150- Goto hspFinishLineLoop
151- hspFinishAppendLine:
152- StrLen $4 $R8
153- StrLen $6 $1
154- IntOp $7 $4 + $6
155- IntOp $7 $7 + 2
156- IntCmp $7 ${HSP_LOG_MAX_CHARS} hspFinishDoAppend hspFinishDoAppend hspFinishCharCap
157- hspFinishDoAppend:
158- StrCpy $R8 " $R8$1$\r$\n "
159- Goto hspFinishLineLoop
160- hspFinishCharCap:
161- StrCpy $R8 " $R8$\r$\n ... (truncated to ${HSP_LOG_MAX_CHARS} chars for display)"
162- hspFinishReadDone:
163- FileClose $R0
164- Return
165- FunctionEnd
166-
167- ; Child EDIT on the MUI finish page so the user can read the same log we mirror to %TEMP%.
102+ ; Child EDIT on the MUI finish page: stream the log file in with EM_REPLACESEL so the full file is shown (not limited by NSIS StrCpy size).
168103Function HspFinishPageShow
169104 StrCpy $HspFinishLogEdit " "
170- Call HspFinishPageReadLog
105+ Call HspEnsureUpdaterLogPath
171106 ; WS_CHILD|WS_VISIBLE|WS_VSCROLL|WS_BORDER|ES_MULTILINE|ES_AUTOVSCROLL|ES_READONLY|ES_WANTRETURN
172- System::Call " user32::CreateWindowExW(i 0, w \" Edit\" , w \" \" , i 0x50201844, i 128, i 128, i 360, i 172 , i $HWNDPARENT, i 0, i 0, i 0) i.r0"
107+ System::Call " user32::CreateWindowExW(i 0, w \" Edit\" , w \" \" , i 0x50201844, i 128, i 128, i 360, i 220 , i $HWNDPARENT, i 0, i 0, i 0) i.r0"
173108 IntCmp $0 0 hspFinishShowDone
174109 StrCpy $HspFinishLogEdit $0
175110 StrCpy $9 $0
176- StrCpy $1 $R8
177- System::Call " user32::SetWindowTextW(i r9, t r1)"
178- hspFinishShowDone:
111+ ; EM_SETLIMITTEXT: raise default cap so large logs fit (WCHAR count).
112+ System::Call " user32::SendMessageW(i r9, i 0xC5, i 16777216, i 0)"
113+ IfFileExists " $HspLogFile" hspFinishFillFile
114+ System::Call " user32::SetWindowTextW(i r9, w \" No installation log file was found.\" )"
115+ Goto hspFinishShowDone
116+ hspFinishFillFile:
117+ FileOpen $R0 " $HspLogFile" r
118+ hspFinishReadLoop:
119+ FileRead $R0 $1
120+ IfErrors hspFinishFileDone
121+ System::Call " user32::SendMessageW(i r9, i 0x000E, i 0, i 0) i.r4"
122+ System::Call " user32::SendMessageW(i r9, i 0xB1, i r4, i r4)"
123+ StrCpy $2 " $1$\r$\n "
124+ System::Call " user32::SendMessageW(i r9, i 0xC2, i 1, t r2)"
125+ Goto hspFinishReadLoop
126+ hspFinishFileDone:
127+ FileClose $R0
128+ hspFinishShowDone:
179129FunctionEnd
180130
181131Function HspFinishPageLeave
0 commit comments