nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1diff --git a/.env.production b/.env.production
2index cc5e2b9..29140f8 100644
3--- a/.env.production
4+++ b/.env.production
5@@ -4,7 +4,7 @@ VITE_DEFAULT_ENGINE_INFOS=`[
6 "uuid": "074fc39e-678b-4c13-8916-ffca8d505d1d",
7 "name": "VOICEVOX Engine",
8 "executionEnabled": true,
9- "executionFilePath": "vv-engine/run.exe",
10+ "executionFilePath": "@voicevox_engine_path@",
11 "executionArgs": [],
12 "host": "http://127.0.0.1:50021"
13 }
14diff --git a/build/electronBuilderConfig.ts b/build/electronBuilderConfig.ts
15index 83dcc10..114fb9d 100644
16--- a/build/electronBuilderConfig.ts
17+++ b/build/electronBuilderConfig.ts
18@@ -45,17 +45,6 @@ const isArm64 = process.arch === "arm64";
19 // cf: https://k-hyoda.hatenablog.com/entry/2021/10/23/000349#%E8%BF%BD%E5%8A%A0%E5%B1%95%E9%96%8B%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E5%85%88%E3%81%AE%E8%A8%AD%E5%AE%9A
20 const extraFilePrefix = isMac ? "MacOS/" : "";
21
22-const sevenZipFile = readdirSync(path.join(rootDir, "vendored", "7z")).find(
23- // Windows: 7za.exe, Linux: 7zzs, macOS: 7zz
24- (fileName) => ["7za.exe", "7zzs", "7zz"].includes(fileName),
25-);
26-
27-if (!sevenZipFile) {
28- throw new Error(
29- "7z binary file not found. Run `node ./tools/download7z.ts` first.",
30- );
31-}
32-
33 const builderOptions: ElectronBuilderConfiguration = {
34 beforeBuild: async () => {
35 if (existsSync(path.join(rootDir, "dist_electron"))) {
36@@ -97,14 +86,6 @@ const builderOptions: ElectronBuilderConfiguration = {
37 from: "build/README.txt",
38 to: extraFilePrefix + "README.txt",
39 },
40- {
41- from: VOICEVOX_ENGINE_DIR,
42- to: path.join(extraFilePrefix, "vv-engine"),
43- },
44- {
45- from: path.join(rootDir, "vendored", "7z", sevenZipFile),
46- to: extraFilePrefix + sevenZipFile,
47- },
48 ],
49 // electron-builder installer
50 productName: "VOICEVOX",
51diff --git a/src/backend/electron/vvppFile.ts b/src/backend/electron/vvppFile.ts
52index f649bf8..de2f3fa 100644
53--- a/src/backend/electron/vvppFile.ts
54+++ b/src/backend/electron/vvppFile.ts
55@@ -224,6 +224,7 @@ export class VvppFileExtractor {
56 }
57
58 private getSevenZipPath(): string {
59+ return "@sevenzip_path@";
60 let sevenZipPath = import.meta.env.VITE_7Z_BIN_NAME;
61 if (!sevenZipPath) {
62 throw new Error("7z path is not defined");
63diff --git a/vite.config.ts b/vite.config.ts
64index 3c9e029..c253a6a 100644
65--- a/vite.config.ts
66+++ b/vite.config.ts
67@@ -5,7 +5,6 @@ import { rm } from "node:fs/promises";
68 import electronPlugin from "vite-plugin-electron/simple";
69 import tsconfigPaths from "vite-tsconfig-paths";
70 import vue from "@vitejs/plugin-vue";
71-import electronDefaultImport from "electron";
72 import checker from "vite-plugin-checker";
73 import { BuildOptions, defineConfig, loadEnv, Plugin } from "vite";
74 import { quasar } from "@quasar/vite-plugin";
75@@ -17,9 +16,7 @@ import {
76 SourceFile,
77 } from "./tools/checkSuspiciousImports.js";
78
79-// @ts-expect-error electronをelectron環境外からimportするとelectronのファイルパスが得られる。
80-// https://github.com/electron/electron/blob/a95180e0806f4adba8009f46124b6bb4853ac0a6/npm/index.js
81-const electronPath = electronDefaultImport as string;
82+const electronPath = "@electron_path@";
83
84 const nodeTestPaths = ["../tests/unit/**/*.node.{test,spec}.ts"];
85 const browserTestPaths = ["../tests/unit/**/*.browser.{test,spec}.ts"];