Menu

#1131 Modified NSIS cause the generated installer corrupted

2.0 Series
open
nobody
None
9
2015-12-31
2015-12-31
Xenix
No

I made a modified NSIS version. I remove the SubCaption instruction and all its relative functions.

  • Removed the SubCaption & UninstallSubCaption instruction and all relative code.
  • Removed Caption between PageEx & PageExEnd, only global "Caption" left.
  • Removed "caption" member from the C "page" structure.
  • Removed the [caption] option from Page & UninstPage.
  • Removed relative code from NSIS header files, NSIS languange files.
    Build a simple installer by this version, the application show this on Windows XP:

    Example.exe is not a valid Win32 application.
    And show this on Windows 10:
    This app can't run on your PC
    To find a version for your PC, check with the software publisher.
    Open it by PE Explorer, there is a warning:
    Warning! Size of Raw Data (39936) > Size of File Image (39358).
    Update internal value of "SizeOfRawData" for Section <.reloc> (5)?
    I use the Microsoft C++ 2010 to build NSIS 2.49 & 2.50, this problem appears. But a simple installer with blank section could not run anymore. If I add more code to NSIS script, the "Size of File Image" will grow, so the installer would be correct until the "Size of File Image" is greater than "Size of Raw Data". I don't whether it's a problem from the new source code or the C++ compiler. But I used to build NSIS 2.46 with Microsoft C++ 2008, It works perfect for years. The attachments are the modified source code files, you may search "jacky" to find them. I would be glad if you can view them. Thank you.

1 Attachments

Discussion

  • Xenix

    Xenix - 2015-12-31

    I made a modified NSIS version. I remove the SubCaption instruction and all its relative functions.

    • Removed the SubCaption & UninstallSubCaption instruction and all relative code.
    • Removed Caption between PageEx & PageExEnd, only global "Caption" left.
    • Removed "caption" member from the C "page" structure.
    • Removed the [caption] option from Page & UninstPage.
    • Removed relative code from NSIS header files, NSIS languange files.

    Build a simple installer by this version, the application show this on Windows XP:

    Example.exe is not a valid Win32 application.

    And show this on Windows 10:

    This app can't run on your PC
    To find a version for your PC, check with the software publisher.

    Open it by PE Explorer, there is a warning:

    Warning! Size of Raw Data (39936) > Size of File Image (39358).
    Update internal value of "SizeOfRawData" for Section <.reloc> (5)?

    I use the Microsoft C++ 2010 to build NSIS 2.49 & 2.50, this problem appears. A simple installer with blank section could not run anymore. If I add more code to NSIS script, the "Size of File Image" will grow, so the installer would be correct until the "Size of File Image" is greater than "Size of Raw Data". I don't whether it's a problem from the new source code or the C++ compiler. But I used to build NSIS 2.46 with Microsoft C++ 2008, It works perfect for years. The attachments are the modified source code files, you may search "jacky" to find them. I would be glad if you can view them. Thank you.

     

    Last edit: Xenix 2015-12-31
  • Amir Szekely

    Amir Szekely - 2015-12-31

    Looks like the problem is the very existance of the .reloc section. It's not supposed to be there, and makensis doesn't handle it. Since there were no differences in the build system between 2.46 and 2.50, I'd bet the change of compilers did it. Try building 2.46 with VC2010 and you'll probably see the same. Also try toying with msvs_version compares at the top of SCons/Config/ms. One of the numbers might be off and a setting that should isn't applied or one that shouldn't is.

     
  • Xenix

    Xenix - 2015-12-31

    I found it, it's bug of Microsoft C++ 2010, I compile 2.50 with Microsoft C++ 2008 and it works.

     

Log in to post a comment.

MongoDB Logo MongoDB