Add Windows portable ZIP packaging#31
Open
hmtdpetn wants to merge 1 commit into
Open
Conversation
8bf03d0 to
9acbbed
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
中文说明
为什么做这个改动
我注意到项目当前的 Windows 发布流程主要生成 NSIS 格式的
.exe安装程序。安装方式本身很好,不过在一些使用场景下,直接下载 ZIP、解压后运行可能会更加方便,例如免安装使用、放在移动硬盘中运行,或者保留多份彼此独立的程序目录。
目前官方发布流程中还没有直接生成完整便携 ZIP 的选项,所以我在现有 Windows 发布脚本的基础上补充了这一种输出方式。
如果作者觉得这个方案合适,后续发布时可以按实际需要选择生成安装程序、便携 ZIP,或者同时生成两种产物,或许能让后续发布和使用更加方便。
主要改动
本次修改扩展了现有的:
增加了三种 Windows 输出格式:
只生成原有的 NSIS 安装程序:
只生成便携 ZIP:
同时生成安装程序和便携 ZIP:
不填写
-WindowsFormat时,默认仍然是INSTALLER,不会改变原来的发布方式。便携包内容
生成的文件路径为:
压缩包中包含运行所需的主要文件:
便携 ZIP 直接复用原有的 Windows staging 流程,因此安装包和便携包使用相同的主程序、初始配置、Xray 和 sing-box 运行时,以及浏览器内核处理逻辑。
压缩包不会包含用户数据库、浏览器实例、代理订阅或其他个人数据。
PORTABLE模式不需要 NSIS;BOTH模式只构建一次程序并准备一次 staging。验证情况
已经完成以下验证:
ant-chrome.exe、xray.exe和sing-box.exe均正确包含;config.yaml与官方初始配置模板一致;ant-chrome.exe可以正常启动;English Description
Motivation
I noticed that the current Windows publishing flow mainly produces an NSIS
.exeinstaller.The installer itself works well, but in some situations a ZIP archive that can be extracted and run directly may be more convenient, for example for no-install usage, removable drives, or keeping multiple independent application directories.
The current upstream publishing flow does not provide an option to generate a complete portable ZIP directly, so this PR adds that output option to the existing Windows publishing script.
If the maintainer finds the approach useful, future releases can choose to generate the installer, the portable ZIP, or both, depending on the release needs.
Changes
This PR extends the existing:
script with three Windows output formats:
Generate only the existing NSIS installer:
Generate only the portable ZIP:
Generate both outputs:
When
-WindowsFormatis omitted, the default remainsINSTALLER, preserving the existing publishing behavior.Portable package contents
The archive is written to:
It contains the main runtime files:
The portable ZIP reuses the existing Windows staging flow, so the installer and portable package use the same application executable, initial configuration, Xray and sing-box runtimes, and browser runtime handling logic.
The archive does not include user databases, browser profiles, proxy subscriptions, or other personal data.
PORTABLEmode does not require NSIS.BOTHmode builds the application and prepares staging only once.Verification
The following checks were completed:
ant-chrome.exe,xray.exe, andsing-box.exewere included correctly;config.yamlmatched the official initial configuration template;ant-chrome.exelaunched successfully from the extracted directory;