Error Creating a 7-zip installer package

六眼飞鱼酱① 提交于 2019-11-26 23:20:16

I think the problem is in different versions of 7zip and 7zip.sfx used. Unfortunately SFX file is absent in most recent 7zip packages. Here is link to 7zip_extra from some old version that has both SFX file and .bat file to create the installer. Works fine for me.

Setup Tools: Why 7-Zip? There is a plethora of alternatives for creating (real) setups - and several are free: How to create windows installer (several links to tools for creating all kinds of setups). Brief descriptions below as well - under "Alternatives" (free tools, or tools with free features). These tools have been tested extensively to ensure running with minimal dependencies. Just something to keep in mind and evaluate I guess.

7-Zip

Guess: first install the C/ C++ runtimes and see if the problem goes away. Next check the compression - and then the LZMA SDK as described below?

Unsupported Compression?: 7-Zip: Unsupported method - use LZMA? I suppose this problem could still occur though that answer is a couple of years old.

Missing Runtime?: You might also want to do a dependency walker check on that setup.exe to see if it depends on something that is missing on the box (for example MSVCRT.dll - or another runtime library). Just download the tool. Easy to use. Or maybe first try to install commonly used C/C++ runtimes. Also, Dependency Walker is aging and shows garbage at times. There is the newer Dependencies - but it is not quite prime-time yet, but try it (click Releases tab). It has been updated to handle Windows API-sets and WinSxS (side-by-side assemblies). Note: several security software on virustotal.com detect Dependencies as a "risk tool, not a virus" (it is open source).

LZMA SDK: The 7zSD.sfx file would likely be from the LZMA SDK. And the command line you describe can be found in the main 7-Zip help file (not the SDK, but the one coming with the regular 7-zip installation). Section "-sfx (Create SFX archive) switch" : Command Line Version => Switches => -sfc (Create SFX Archive.


Alternatives

Visual Studio 2017: The newest, free version of Visual Studio: Visual Studio Community 2017 can create setup.exe files via its Microsoft Visual Studio 2017 Installer Projects (this extension must be installed after installing Visual Studio 2017).

WiX: The Open Source WiX toolkit can create setup.exe files with its Burn component. A WiX Burn ad-hoc sample- just to get the general idea - it has a learning curve. No GUI to help you, it is all XML-based. Use with or without Visual Studio.

Advanced Installer: I believe Advanced Installer can compile a setup.exe even in their free version. Despite a somewhat large download, I think this would work for you and be quick.

UPDATE on Advanced Installer: The free edition can only build MSI files, EXE bootstrappers can be built with the paid editions (any of them).

dotNetInstaller: There is also the dotNetInstaller Setup Bootstrapper - which I have never used. Here it is on github.com (source).

Inno or NSIS: These free non-MSI installers can easily create a setup.exe for you that has been optimized for minimal dependencies. I haven't used them much, but they are well-known. NSIS seems to create archive files compatible with Zip tools.

IExpress et al: There are security vulnerabilities that affect these self-extracting packages. Another reason I recommend a "real" deployment tool with dedicated resources to fix such things quickly, despite the niceness of having a setup.exe that can be opened directly in 7-zip.


File Extraction

On the topic of extracting files from setup.exe files of various types:

  • MSI: Extract MSI from EXE - all MSI files can be extracted, and setup.exe files created with WiX can also be extracted
  • NSIS & Inno: It looks like NSIS creates files compatible with 7-Zip (comprehensible compression), not so with Inno by the looks of it.

Some Links:

  • https://en.wikipedia.org/wiki/Self-extracting_archive#Overview : "For a decompression utility to correctly expand an archive of either the self-extracting or standard variety, it must be able to operate on both the file format and algorithm used. The exact executable code placed at the beginning of a self-extracting archive may therefore need to be varied depending on what options were used to create the archive. The decompression routines will be different for a LZMA 7z archive when compared with a LZMA2 7z archive, for example."
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!