fix: setup.exe.zip is unexpectedly unavailable

This commit is contained in:
anatawa12 2026-05-14 14:47:04 +09:00
commit 8c8315f57d
No known key found for this signature in database
GPG key ID: BD2F16922830A7DC
8 changed files with 79 additions and 16 deletions

View file

@ -26,7 +26,7 @@ jobs:
- triple: x86_64-pc-windows-msvc
on: windows-latest
bundles: setup-exe,exe-updater
bundles: setup-exe,setup-exe-zip,exe-updater
- triple: universal-apple-darwin
on: macos-14

View file

@ -170,11 +170,12 @@ jobs:
- name: x86_64-windows-all
triple: x86_64-pc-windows-msvc
on: windows-2022
last-bundles: exe-updater
last-bundles: setup-exe-zip,exe-updater
updater-bundle: bundle/setup/alcom-updater.exe
dist-path: |
ALCOM.exe:ALCOM-${GUI_VERSION}-x86_64.exe
bundle/setup/alcom-setup.exe:ALCOM-${GUI_VERSION}-x86_64-setup.exe
bundle/setup/alcom-setup.exe.zip:ALCOM-${GUI_VERSION}-x86_64-setup.exe.zip
bundle/setup/alcom-updater.exe:ALCOM-${GUI_VERSION}-x86_64-updater.exe
bundle/setup/alcom-updater.exe.sig:ALCOM-${GUI_VERSION}-x86_64-updater.exe.sig
@ -273,11 +274,6 @@ jobs:
- name: Bundle ALCOM (${{ matrix.last-bundles }})
run: cargo xtask bundle-alcom --target ${{ matrix.triple }} --release --bundles ${{ matrix.last-bundles }}
- name: Bundle ALCOM Updater (Windows)
if: ${{ contains(matrix.name, 'windows') }}
shell: bash
run: cargo xtask bundle-alcom --target ${{ matrix.triple }} --release --bundles exe-updater
- name: Sign updater artifacts (All Platforms)
shell: bash
if: ${{ matrix.updater-bundle }}

20
Cargo.lock generated
View file

@ -6027,6 +6027,12 @@ version = "2.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a"
[[package]]
name = "typed-path"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e28f89b80c87b8fb0cf04ab448d5dd0dd0ade2f8891bae878de66a75a28600e"
[[package]]
name = "typeid"
version = "1.0.3"
@ -7558,6 +7564,7 @@ dependencies = [
"serde_json",
"tar",
"ureq",
"zip",
]
[[package]]
@ -7724,6 +7731,19 @@ dependencies = [
"syn 2.0.117",
]
[[package]]
name = "zip"
version = "8.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d04a6b5381502aa6087c94c669499eb1602eb9c5e8198e534de571f7154809b"
dependencies = [
"crc32fast",
"flate2",
"indexmap 2.14.0",
"memchr",
"typed-path",
]
[[package]]
name = "zlib-rs"
version = "0.6.3"

View file

@ -55,6 +55,9 @@ export default defineConfig({
"@/build": path.join(__dirname, "./build"),
},
},
oxc: {
target: "es2025",
},
build: {
outDir: "out",
chunkSizeWarningLimit: Number.POSITIVE_INFINITY,

View file

@ -27,3 +27,4 @@ ar = "0.9.0"
fs_extra = "1.3.0"
base64 = "0.22.1"
minisign = "0.9.1"
zip = { version = "8.6.0", default-features = false, features = ["deflate-flate2"] }

View file

@ -17,15 +17,21 @@ mod setup_exe;
/// If `--bundles` is not specified, all artifacts for the target platform are produced.
///
/// **macOS** artifacts:
/// - `app` `ALCOM.app` application bundle
/// - `dmg` `ALCOM_<version>_<arch>.dmg` disk image
/// - `app-updater` `ALCOM.app.tar.gz` updater payload
/// - `app` - `ALCOM.app` application bundle
/// - `dmg` - `ALCOM_<version>_<arch>.dmg` disk image
/// - `app-updater` - `ALCOM.app.tar.gz` updater payload
///
/// **Linux** artifacts:
/// - `app-image` — `ALCOM_<version>_<arch>.AppImage`
/// - `app-image-updater` — `ALCOM_<version>_<arch>.AppImage.tar.gz` updater payload
/// - `deb` — `ALCOM_<version>_<arch>.deb` Debian package
/// - `rpm` — `ALCOM-<version>-1.<arch>.rpm` RPM package
/// - `app-image` - `ALCOM_<version>_<arch>.AppImage`
/// - `app-image-updater` - `ALCOM_<version>_<arch>.AppImage.tar.gz` updater payload
/// - `deb` - `ALCOM_<version>_<arch>.deb` Debian package
/// - `rpm` - `ALCOM-<version>-1.<arch>.rpm` RPM package
/// - `buildroot` - The package manager independent buildroot for external package managers.
///
/// **Windows** artifacts:
/// - `setup-exe` - `-setup.exe` for first-time installation
/// - `setup-exe-zip` - `-setup.exe.zip` to workaround warning from browsers
/// - `exe-updater` - `-updater.exe` for the updater. This includes
#[derive(clap::ValueEnum, Clone, Copy, PartialEq, Eq, Debug)]
pub(crate) enum BundleKind {
// --- macOS ---
@ -52,6 +58,8 @@ pub(crate) enum BundleKind {
Rpm,
/// Windows setup.exe
SetupExe,
/// Windows setup.exe in zip (requires setup.exe to already exist in bundle dir)
SetupExeZip,
/// Windows setup.exe for updater
ExeUpdater,
}
@ -87,7 +95,7 @@ pub(super) struct Command {
/// Specific bundle artifacts to produce (comma-separated or repeated).
///
/// When not specified, all artifacts for the target platform are produced.
/// Use this to split the bundling process e.g. produce only `app` first,
/// Use this to split the bundling process - e.g. produce only `app` first,
/// then sign it, then produce `dmg` and `app-updater`.
#[arg(long, value_delimiter = ',')]
bundles: Vec<BundleKind>,
@ -145,6 +153,10 @@ impl crate::Command for Command {
setup_exe::create_setup_exe(&ctx)?;
}
if bundles.contains(&BundleKind::SetupExeZip) {
setup_exe::create_setup_exe_zip(&ctx)?;
}
if bundles.contains(&BundleKind::ExeUpdater) {
setup_exe::create_updater_exe(&ctx)?;
}

View file

@ -1,10 +1,11 @@
use crate::bundle_alcom::BundleContext;
use crate::utils::command::{CommandExt, WineRunner};
use crate::utils::{download_file_cached, target_abi};
use crate::utils::{cargo, download_file_cached, target_abi};
use anyhow::{Context, Result, bail};
use std::fs;
use std::path::{Path, PathBuf};
use std::process::Command as ProcessCommand;
use zip::write::FileOptions;
const WEBVIEW2_URL: &str = "https://go.microsoft.com/fwlink/?linkid=2124703";
const INNO_SETUP_VERSION: &str = "6.7.1";
@ -28,6 +29,26 @@ pub fn create_setup_exe(ctx: &BundleContext<'_>) -> Result<()> {
Ok(())
}
pub fn create_setup_exe_zip(ctx: &BundleContext<'_>) -> Result<()> {
let wrapper_in_bundle = ctx.bundle_dir.join("setup/alcom-setup.exe");
let zip = ctx.bundle_dir.join("setup/alcom-setup.exe.zip");
let mut zip = zip::write::ZipWriter::new(fs::File::create(&zip).context("creating zip file")?);
zip.start_file(
format!("ALCOM-{}-x86_64-setup.exe", cargo::gui_version()),
FileOptions::DEFAULT,
)
.context("adding file to zip")?;
std::io::copy(
&mut std::io::BufReader::new(
fs::File::open(&wrapper_in_bundle).context("opening alcom-setup.exe")?,
),
&mut zip,
)
.context("copying file to zip")?;
Ok(())
}
pub fn create_updater_exe(ctx: &BundleContext<'_>) -> Result<()> {
let iss_setup = ctx.bundle_dir.join("setup/alcom-setup.exe");

View file

@ -1,4 +1,5 @@
use cargo_metadata::Metadata;
use cargo_metadata::semver::Version;
use std::sync::OnceLock;
#[allow(dead_code)]
@ -10,3 +11,12 @@ pub fn cargo_metadata() -> &'static Metadata {
.expect("cargo metadata failed")
})
}
pub fn gui_version() -> &'static Version {
cargo_metadata()
.packages
.iter()
.find(|p| p.name == "vrc-get-gui")
.map(|p| &p.version)
.expect("vrc-get-gui metadata not found")
}