This is honestly quite hacky, but with the lack of proper version information in the file header it will always be, unfortunately.
I'm sorry for the code quality, but it's C++...
Keep in mind this doesn't support the external data file mode of NSISBI at all, but Unity never used it so I'm not interested in that.
The same goes for item.Pos
technically being 64-bit instead of 32-bit like it is in NSIS, but my test files never exceeded the limit. I've tried changing that but it quickly cascaded into other places and I wasn't able to get it to work.
I've tested this patch on the following files:
* https://download.unity3d.com/download_unity/7defd84cdab8/Windows64EditorInstaller/UnitySetup64-6000.0.12f1.exe (NSISBI)
* https://download.unity3d.com/download_unity/660cd1701bd5/Windows64EditorInstaller/UnitySetup64-2020.3.45f1.exe (NSISBI)
* https://download.unity3d.com/download_unity/6e14067f8a9a/Windows64EditorInstaller/UnitySetup64-2017.4.40f1.exe (NSIS)
And they all work like they should, although with how complicated the NSIS format is I won't guarantee there are no regressions.
Related: https://sourceforge.net/p/sevenzip/discussion/45797/thread/df87e22faf
P.S. I hate sourceforge, why