gecko-dev/other-licenses/7zstub
..
firefox
src
README.mozilla
mozilla_customizations.diff

README.mozilla

This directory contains the LZMA SDK code used in building the self-extracting
Windows installer.

The src/ directory contains an almost-unmodified copy of the 7-zip source code
version 18.05, as downloaded from https://www.7-zip.org/a/lzma1805.7z (linked
from https://www.7-zip.org/sdk.html) on August 30, 2018. As stated in
DOC/lzma-sdk.txt and on the web page, this code is in the public domain. A few
modifications have been made to this copy of the source code. Those
modifications are contained in mozilla_customizations.diff, which should be
found in the same directory as this file.

The firefox/ directory contains several things:
* SFXSetup.sln and SFXSetup.vcxproj
  These are Visual Studio 2017 conversions of the Visual C++ 6 workspace and
  project files from the src/CPP/7zip/Bundles/SFXSetup/ directory, with
  some changes and additions to support AArch64 and to include our resources.
* 7zSD.arm64.manifest and 7zSD.win32.manifest
  We need to add a manifest file to the binary for several reasons, and one
  isn't supplied with the source package (Visual C++ 6 doesn't support them),
  so we've written our own.
* setup.ico
  The icon group used for the installer package.
* resource.rc
  The resource script containing the above manifest and icon references, as
  well as other resources we need. This is derived from the supplied SFXSetup
  resource.rc, but heavily customized.
* 7zSD.ARM64.sfx
  AArch64 binary built using all the above files. Checking this into the tree in
  compiled binary form means that packaging the installer does not require
  having a compiler toolchain configured (which is the case for artifact
  builds). To compile your own version of this file, open SFXSetup.sln and build
  the ReleaseD configuration.
* 7zSD.Win32.sfx
  32-bit x86 binary built using some of the above files, but through a different
  build procedure that uses Visual C++ 6 in order to maintain compatibility with
  legacy Windows platforms (Firefox doesn't run on these platforms, but at least
  we can display a helpful error message). The exact procedure that generated
  this file was:
  1) Install Microsoft Visual C++ 6 Professional or Enterprise edition (the
     Standard edition does not include the optimizing compiler, so it should
     not be used). You'll likely want a virtual machine running Windows XP,
     because running VC6 under more modern Windows versions is tricky.
  2) Install an appropriate Windows SDK version. The Windows XP Service Pack 2
     SDK is known to work well, but that particular version appears to only be
     available from archive.org:
     https://web.archive.org/web/20080209175723/http://www.microsoft.com:80/msdownload/platformsdk/sdkupdate/XPSP2FULLInstall.htm
  3) Run the tool included with the SDK that configures Visual C++ to use it.
  4) If using a fresh copy of the LZMA SDK sources, apply the patch in
     mozilla_customizations.diff. The copy in the Firefox source tree already
     has these changes applied.
  5) Open the workspace file at src\CPP\7zip\Bundles\SFXSetup\SFXSetup.dsw and
     build it using the "SFXSetup - Win32 ReleaseD" configuration. The output
     executable should be at the path ReleaseD\7zSD.sfx relative to SFXSetup.dsw.
  6) Use Resource Hacker (available from http://angusj.com/resourcehacker/) to
     replace the existing icon on 7zSD.sfx and to add the manifest as a new
     resource. Also edit the version info resource to replace CompanyName and
     LegalCopyright with "Mozilla" (or appropriate vendor name) and
     FileDescription and ProductName with "Firefox" (or appropriate product name).
     Be sure to recompile the resources using the green "play" button in the
     toolbar (or by pressing F5) before saving the file.
  In the future this file may be replaced with one built in the same manner as
  the AArch64 version using a modern toolchain, if the loss of platform support
  is deemed acceptable.