README.mcp 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. This directory contains the LZMA SDK code used in building the self-extracting
  2. Windows installer.
  3. The src/ directory contains an almost-unmodified copy of the 7-zip source code
  4. version 18.05, as downloaded from https://www.7-zip.org/a/lzma1805.7z (linked
  5. from https://www.7-zip.org/sdk.html). As stated in DOC/lzma-sdk.txt and on the
  6. web page, this code is in the public domain. A few modifications have been
  7. made to this copy of the source code. Those modifications are contained in
  8. customizations.diff, which should be found in the same directory as this file.
  9. The uxp/ directory contains 7zSD.sfx, a 32-bit Windows executable built from
  10. the Visual C++ 6 project found in the src/CPP/7zip/Bundles/SFXSetup/
  11. directory with customizations. The "ReleaseD" configuration was used.
  12. The uxp/ version contains generic vendor information and can be used for any
  13. UXP application's installer with minimal confusion for the user.
  14. The ReleaseD/ directory contains 7zSD.sfx.exe, which is an unmodified binary
  15. from that build process, ready to be customized for any target application
  16. with a resource hacker (ResHacker, PE explorer, etc.).
  17. Including a compiled binary in the source tree is certainly not preferred, but
  18. is necessary in this case because the code does not build cleanly under more
  19. recent compilers. Using an older toolchain also allows us to keep this
  20. executable running on older Windows versions which are no longer supported by
  21. the build system used for the main application; that means we can show an error
  22. message specifically informing users that their OS is too old, instead of the
  23. generic "not a valid Win32 application" error that Windows would generate if we
  24. used the newer toolchain and that isn't very helpful to most users.
  25. Using a precompiled binary also allows the installer build procedure to work
  26. without a compiler toolchain being configured.
  27. The uxp/ directory also contains a manifest which was edited into 7zSD.sfx's
  28. resources after build time. The manifest had to be added this way because the
  29. older resource compiler does not support manifests (and the 7-zip build files
  30. do not try to use any).
  31. The version info in the compiled binary was also edited after build time. There
  32. isn't a technical reason why the version info changes couldn't be included at
  33. build time, but since the goal is just to avoid confusing users about the origin
  34. of the installer, not to appear to be making the claim that we wrote the
  35. LZMA SDK, a more targeted change is appropriate.
  36. ** BUILDING 7zSD.sfx yourself **
  37. Step-by-step instructions for generating 7zSD.sfx:
  38. 1) Install Microsoft Visual C++ 6 Professional or Enterprise edition (the
  39. Standard edition does not include the optimizing compiler, so it should
  40. not be used). You'll likely want a virtual machine running Windows XP SP3,
  41. because running VC6 under more modern Windows versions is tricky, to say
  42. the least. Some people have reported success running it on Vista or Win 7,
  43. but please just save yourself the headache!
  44. Once installed, make sure to launch the Visual C++ 6.0 IDE at least once.
  45. 2) 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:
  48. https://web.archive.org/web/20080209175723/http://www.microsoft.com:80/msdownload/platformsdk/sdkupdate/XPSP2FULLInstall.htm
  49. Follow the instructions on that archived page to install the SDK.
  50. 3) Run the tool included with the SDK that configures Visual C++ to use it.
  51. Start > All Programs > Microsoft Platform SDK for Windows XP SP2 >
  52. Visual Studio Registration > Register PSDK Directories with Visual Studio
  53. 4) If using a fresh copy of the LZMA SDK sources, apply the patch in
  54. customizations.diff. The copy in the UXP source tree already has these
  55. changes applied.
  56. 5) Open the workspace file at src\CPP\7zip\Bundles\SFXSetup\SFXSetup.dsw and
  57. build it using the "SFXSetup - Win32 ReleaseD" configuration. The output
  58. executable should be at the path ReleaseD\7zSD.sfx relative to SFXSetup.dsw.
  59. 6) Use Resource Hacker (available from http://angusj.com/resourcehacker/) to
  60. (if desired) replace the existing icon on 7zSD.sfx and to add the manifest
  61. as a new resource. Also edit the version info resource to replace CompanyName
  62. and LegalCopyright with an appropriate vendor name and FileDescription and
  63. ProductName with an appropriate product name.
  64. Be sure to recompile the resources using the green "play" button in the
  65. toolbar (or by pressing F5) before saving the edited binary file.