Skip to content

Commit

Permalink
installer: report post-install errors more verbosely
Browse files Browse the repository at this point in the history
There had been two or three reports of the post-install script failing,
but we did not have any better information because the output of the
script was suppressed.

Let's redirect the output to a file and include the contents in any error
report so that we have a chance to help users better in the future.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Nov 1, 2016
1 parent c43728d commit 8332900
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions installer/install.iss
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,16 @@ begin
Result:=GetPreviousData(Key,Default);
end;
function ReadFileAsString(Path:String):String;
var
Contents:AnsiString;
begin
if not LoadStringFromFile(Path,Contents) then
Result:='(no output)'
else
Result:=Contents;
end;
function DetectNetFxVersion:Cardinal;
begin
// We are only interested in version v4.5.1 or later, therefore it
Expand Down Expand Up @@ -1723,8 +1733,8 @@ begin
}
Cmd:=AppDir+'\post-install.bat';
if not Exec(Cmd, '', AppDir, SW_HIDE, ewWaitUntilTerminated, i) then
LogError('Line {#__LINE__}: Unable to run post-install scripts.');
if not Exec(Cmd,ExpandConstant('>"{tmp}\post-install.log"'),AppDir,SW_HIDE,ewWaitUntilTerminated,i) or (i<>0) then
LogError('Line {#__LINE__}: Unable to run post-install scripts:'+#13+ReadFileAsString(ExpandConstant('{tmp}\post-install.log')));
{
Restart any processes that were shut down via the Restart Manager
Expand Down

0 comments on commit 8332900

Please sign in to comment.