news 2026/6/4 15:10:59

7-Zip SFX Packaging Standard Specification

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
7-Zip SFX Packaging Standard Specification

Subject: Windows Executable Packaging, 7-Zip SFX, Automation Deployment

1. Core Concept: SFX Module Types

There are two distinct types of 7-Zip SFX stubs. Mixing them causes failure.

Attribute

Standard SFX

Installer SFX (Correct)

File Name

7z.sfx

7zSD.sfx

Function

Decompress only

Decompress + Execute

RunProgram Support

No

Yes

Typical Failure

Pops up "Extract to" dialog

N/A

Rule: If the objective is to run a script after extraction,only use7zSD.sfx.

2. Configuration Syntax

The configuration file must be encoded inUTF-8 without BOM.

;!@Install@!UTF-8! Title="Application Name" InstallPath=".\\ " RunProgram="path\\to\\script.bat" ;!@InstallEnd@!

Key Parameters:

  • InstallPath=".\\ ": Extracts to the current directory of the EXE.

  • RunProgram: The command line executed after decompression.

3. Build Procedure (PowerShell)

Binary concatenation is the standard method.

# Create 7z archive & "7za.exe" a -t7z archive.7z @("content_folder") -mx=9 # Concatenate bytes: Stub + Config + Archive [byte[]]$binary = [System.IO.File]::ReadAllBytes("7zSD.sfx") + [System.IO.File]::ReadAllBytes("config.txt") + [System.IO.File]::ReadAllBytes("archive.7z") # Write final executable [System.IO.File]::WriteAllBytes("output.exe", $binary)

4. Troubleshooting Matrix

Symptom

Cause

Resolution

"Extract to" dialog appears

Using7z.sfx

Replace with7zSD.sfx

Script does not execute

RunProgramignored

Verify Stub is Installer type

Nothing happens on double click

Corrupted Stub

Use official LZMA SDK binary

5. Format Constraints

  • Archive Format: Must be7z.

  • ZIP Compatibility: Not supported. The7zSD.sfxdecoder does not recognize ZIP structures.

  • OS Native Extraction: Not supported. Windows Explorer cannot extract this EXE natively.

6. Verification Method

Use a minimal test config:

;!@Install@!UTF-8! RunProgram="cmd.exe" ;!@InstallEnd@!
  • Result: CMD window opens =Valid Stub.

  • Result: Extract dialog opens =Invalid Stub.

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/6/4 15:09:38

前端全套基础知识点整理(HTML+CSS+JS+正则)

一、JavaScript 核心进阶1.1 函数柯里化与反柯里化1.1.1 函数柯里化柯里化:把多参数函数,拆分为多个单参数嵌套函数,延迟执行、参数复用。// 原多参数函数 function ad(a,b,c){return abc; }// 柯里化封装函数 function ac(ad,a,b){return fu…

作者头像 李华
网站建设 2026/6/4 15:08:17

无人机固件降级神器:DankDroneDownloader帮你找回所有历史版本

无人机固件降级神器:DankDroneDownloader帮你找回所有历史版本 【免费下载链接】DankDroneDownloader A Custom Firmware Download Tool for DJI Drones Written in C# 项目地址: https://gitcode.com/gh_mirrors/da/DankDroneDownloader 你是否曾为大疆无人…

作者头像 李华
网站建设 2026/6/4 15:07:12

Qwen3.6-Plus实战指南:从零构建AI原生开发工作流

1. 这不是又一个“写代码的AI”,而是一个能替你开项目、做架构、扛压测的“数字同事”我用 Qwen3.6-Plus 写完一个带权限管理、文件上传、实时日志查看的内部运维看板,从需求描述到可部署的 Docker Compose 包,全程没碰过 Git commit 命令——…

作者头像 李华
网站建设 2026/6/4 15:07:06

英雄联盟工具箱完整指南:3大核心功能提升你的游戏体验

英雄联盟工具箱完整指南:3大核心功能提升你的游戏体验 【免费下载链接】League-Toolkit An all-in-one toolkit for LeagueClient. Gathering power 🚀. 项目地址: https://gitcode.com/gh_mirrors/le/League-Toolkit League-Toolkit是一款功能全…

作者头像 李华
网站建设 2026/6/4 15:04:01

BotW存档管理器:3分钟实现Switch与WiiU存档互转的完整指南

BotW存档管理器:3分钟实现Switch与WiiU存档互转的完整指南 【免费下载链接】BotW-Save-Manager BOTW Save Manager for Switch and Wii U 项目地址: https://gitcode.com/gh_mirrors/bo/BotW-Save-Manager BotW-Save-Manager是一款专为《塞尔达传说&#xff…

作者头像 李华
网站建设 2026/6/4 15:03:57

TSDZ2中置电机非标车架改装:扭矩传感器应用与工程实践详解

1. 项目概述:为特殊需求儿童打造一台“隐形”的助力伙伴几年前,我面临一个非常具体且充满温情的工程挑战:为我12岁的儿子改装一台躺式三轮车。他因脑瘫导致腿部力量和耐力严重受限,即便是最平缓的坡道,对他而言也如同高…

作者头像 李华