Bug 1490264 Part 2 - Document our SFX stub version resource edits. r=agashlin a=NPOTB
authorMatt Howell <mhowell@mozilla.com>
Tue, 11 Sep 2018 11:17:30 -0700
changeset 492624 2ebd5b9976ddca10fd121e97cccd3b3fc09769d1
parent 492623 655bb2a8e2b5a3b187ba4982bc7ebdaa96389aa2
child 492625 9bad6b73be9d38192d0ac295518db33efae24e54
push id1815
push userffxbld-merge
push dateMon, 15 Oct 2018 10:40:45 +0000
treeherdermozilla-release@18d4c09e9378 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersagashlin, NPOTB
bugs1490264
milestone63.0
Bug 1490264 Part 2 - Document our SFX stub version resource edits. r=agashlin a=NPOTB Also take the opportunity to add specific instructions about how to rebuild 7zSD.sfx.
other-licenses/7zstub/README.mozilla
--- a/other-licenses/7zstub/README.mozilla
+++ b/other-licenses/7zstub/README.mozilla
@@ -14,17 +14,49 @@ from the Visual C++ 6 project found in t
 directory. The "ReleaseD" configuration was used. Including a compiled binary
 in the source tree is certainly not preferred, but is necessary in this case
 because the code does not build cleanly under more recent compilers. Using an
 older toolchain also allows us to keep this executable running on older Windows
 versions which are no longer supported by the build system used for the main
 application; that means we can show an error message specifically informing
 users that their OS is too old, instead of the generic "not a valid Win32
 application" error that Windows would generate if we used the newer toolchain
-and that isn't very helpful to most users.
+and that isn't very helpful to most users. Using a precompiled binary also
+allows the installer build procedure to work without a compiler toolchain
+being configured (e.g., for artifact builds).
 
 The firefox/ directory also contains an icon and a manifest which were edited
 into 7zSD.sfx's resources after build time. The icon had to be added this way
 as opposed to just replacing the included 7-zip icon because the resource
 compiler included with VC6 does not support the 128x128 PNG image included in
 our icon file. Similarly, the manifest had to be edited in because the older
 resource compiler does not support manifests (and the 7-zip build files do not
 try to use any).
+
+The version info in the compiled binary was also edited after build time. There
+isn't a technical reason why the version info changes couldn't be included at
+build time, but since the goal is just to avoid confusing users about the origin
+of the Firefox installer, not to appear to be making the claim that we wrote the
+LZMA SDK, a more targeted change is appropriate.
+
+Step-by-step instructions for generating 7zSD.sfx:
+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.