From e5280834ac29d0b19ca21377181793e7ab7d054c Mon Sep 17 00:00:00 2001 From: kichik Date: Tue, 3 Feb 2004 13:44:03 +0000 Subject: [PATCH] Some system I tested on didn't quite get the END part and seeked beyond the end of the file which caused the CRC checksum to be written in a place where the exehead didn't expect it. Because of this, all solid installers compiled on that system failed CRC. git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3456 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/build.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/build.cpp b/Source/build.cpp index 8e7b3587..217b10d8 100644 --- a/Source/build.cpp +++ b/Source/build.cpp @@ -2605,6 +2605,8 @@ int CEXEBuild::write_output(void) } compressor->End(); + unsigned fend = ftell(fp); + fh.length_of_all_following_data=ftell(fp)-fd_start+(build_crcchk?sizeof(int):0); INFO_MSG( "%10d / %d bytes\n", @@ -2629,7 +2631,7 @@ int CEXEBuild::write_output(void) } } #endif - fseek(fp,0,SEEK_END); // reset eof flag + fseek(fp,fend,SEEK_SET); // reset eof flag } #endif