• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..01-Sep-2019-

firefox/H03-May-2022-3029

src/H01-Sep-2019-129,37498,651

README.mozillaH A D01-Sep-20194 KiB6357

mozilla_customizations.diffH A D01-Sep-201918.2 KiB460436

README.mozilla

1This directory contains the LZMA SDK code used in building the self-extracting
2Windows installer.
3
4The src/ directory contains an almost-unmodified copy of the 7-zip source code
5version 18.05, as downloaded from https://www.7-zip.org/a/lzma1805.7z (linked
6from https://www.7-zip.org/sdk.html) on August 30, 2018. As stated in
7DOC/lzma-sdk.txt and on the web page, this code is in the public domain. A few
8modifications have been made to this copy of the source code. Those
9modifications are contained in mozilla_customizations.diff, which should be
10found in the same directory as this file.
11
12The firefox/ directory contains 7zSD.sfx, a 32-bit Windows executable built
13from the Visual C++ 6 project found in the src/CPP/7zip/Bundles/SFXSetup/
14directory. The "ReleaseD" configuration was used. Including a compiled binary
15in the source tree is certainly not preferred, but is necessary in this case
16because the code does not build cleanly under more recent compilers. Using an
17older toolchain also allows us to keep this executable running on older Windows
18versions which are no longer supported by the build system used for the main
19application; that means we can show an error message specifically informing
20users that their OS is too old, instead of the generic "not a valid Win32
21application" error that Windows would generate if we used the newer toolchain
22and that isn't very helpful to most users. Using a precompiled binary also
23allows the installer build procedure to work without a compiler toolchain
24being configured (e.g., for artifact builds).
25
26The firefox/ directory also contains an icon and a manifest which were edited
27into 7zSD.sfx's resources after build time. The icon had to be added this way
28as opposed to just replacing the included 7-zip icon because the resource
29compiler included with VC6 does not support the 128x128 PNG image included in
30our icon file. Similarly, the manifest had to be edited in because the older
31resource compiler does not support manifests (and the 7-zip build files do not
32try to use any).
33
34The version info in the compiled binary was also edited after build time. There
35isn't a technical reason why the version info changes couldn't be included at
36build time, but since the goal is just to avoid confusing users about the origin
37of the Firefox installer, not to appear to be making the claim that we wrote the
38LZMA SDK, a more targeted change is appropriate.
39
40Step-by-step instructions for generating 7zSD.sfx:
411) Install Microsoft Visual C++ 6 Professional or Enterprise edition (the
42   Standard edition does not include the optimizing compiler, so it should
43   not be used). You'll likely want a virtual machine running Windows XP,
44   because running VC6 under more modern Windows versions is tricky.
452) Install an appropriate Windows SDK version. The Windows XP Service Pack 2 SDK
46   is known to work well, but that particular version appears to only be
47   available from archive.org:
48https://web.archive.org/web/20080209175723/http://www.microsoft.com:80/msdownload/platformsdk/sdkupdate/XPSP2FULLInstall.htm
493) Run the tool included with the SDK that configures Visual C++ to use it.
504) If using a fresh copy of the LZMA SDK sources, apply the patch in
51   mozilla_customizations.diff. The copy in the Firefox source tree already
52   has these changes applied.
535) Open the workspace file at src\CPP\7zip\Bundles\SFXSetup\SFXSetup.dsw and
54   build it using the "SFXSetup - Win32 ReleaseD" configuration. The output
55   executable should be at the path ReleaseD\7zSD.sfx relative to SFXSetup.dsw.
566) Use Resource Hacker (available from http://angusj.com/resourcehacker/) to
57   replace the existing icon on 7zSD.sfx and to add the manifest as a new
58   resource. Also edit the version info resource to replace CompanyName and
59   LegalCopyright with "Mozilla" (or appropriate vendor name) and
60   FileDescription and ProductName with "Firefox" (or appropriate product name).
61   Be sure to recompile the resources using the green "play" button in the
62   toolbar (or by pressing F5) before saving the file.
63