runbay 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/out/main/index.js +20 -7
  2. package/package.json +1 -1
package/out/main/index.js CHANGED
@@ -609,7 +609,8 @@ function applyIgnored(apps2) {
609
609
  }
610
610
  async function listProvider(provider, onBatch) {
611
611
  const outdatedPromise = provider.checkOutdated ? provider.checkOutdated().catch(() => ({})) : Promise.resolve({});
612
- const apps2 = await provider.list();
612
+ const self = electron.app.getAppPath().toLowerCase();
613
+ const apps2 = (await provider.list()).filter((a) => a.path?.toLowerCase() !== self);
613
614
  applyIgnored(apps2);
614
615
  onBatch?.(apps2);
615
616
  const outdated = await outdatedPromise;
@@ -720,7 +721,11 @@ async function applySelfUpdate() {
720
721
  const root = await globalRoot();
721
722
  const shim = node_path.join(node_path.dirname(root), `${PKG}.cmd`);
722
723
  const script = node_path.join(electron.app.getPath("userData"), "update.cmd");
724
+ const vbs = node_path.join(electron.app.getPath("userData"), "update-hidden.vbs");
723
725
  const log = node_path.join(electron.app.getPath("userData"), "update.log");
726
+ const appDir = electron.app.getAppPath();
727
+ const electronExe = node_path.join(appDir, "node_modules", "electron", "dist", "electron.exe");
728
+ const relaunch = node_fs.existsSync(electronExe) ? `start "" "${electronExe}" "${appDir}"` : `start "" "${shim}"`;
724
729
  const install = `call npm install -g ${PKG}@${target}${registryFlag}`;
725
730
  const body = [
726
731
  "@echo off",
@@ -732,13 +737,16 @@ async function applySelfUpdate() {
732
737
  // le registre met parfois une minute à propager une publication prouvée
733
738
  `${install} --prefer-online >> "${log}" 2>&1`,
734
739
  ")",
735
- `start "" "${shim}"`,
740
+ relaunch,
741
+ `del "${vbs}"`,
736
742
  'del "%~f0"',
737
743
  ""
738
744
  ].join("\r\n");
739
745
  try {
746
+ node_fs.writeFileSync(vbs, `CreateObject("WScript.Shell").Run """${script}""", 0, False\r
747
+ `);
740
748
  node_fs.writeFileSync(script, body);
741
- node_child_process.spawn(`"${script}"`, { detached: true, stdio: "ignore", windowsHide: true, shell: true }).unref();
749
+ node_child_process.spawn("wscript.exe", [vbs], { stdio: "ignore" }).unref();
742
750
  } catch (err) {
743
751
  return { state: "error", message: err instanceof Error ? err.message : String(err) };
744
752
  }
@@ -937,9 +945,11 @@ function createWindow() {
937
945
  // Fond peint dans la couleur du thème : pas de flash clair/sombre avant le 1er rendu.
938
946
  backgroundColor: settings.theme === "light" ? "#f5f6f7" : "#111214",
939
947
  title: "RunBay",
940
- // En dev, l'exe est Electron : on force l'icône du projet (barre de titre + taskbar).
941
- // En paqué, l'icône est embarquée dans l'exe par electron-builder.
942
- ...utils.is.dev && { icon: node_path.join(__dirname, "../../build/icon.ico") },
948
+ // Fichier d'icône embarqué dans le paquet (barre de titre + barre des tâches).
949
+ // L'app est lancée depuis npm comme un simple dossier : l'exe est Electron,
950
+ // qui n'a pas de visage à lui — on lui donne le nôtre. Windows préfère le
951
+ // .ico (plusieurs tailles), les autres plateformes le .png du tray.
952
+ icon: appIconPath(process.platform === "win32" ? "icon.ico" : "icon.png"),
943
953
  webPreferences: {
944
954
  preload: node_path.join(__dirname, "../preload/index.js"),
945
955
  sandbox: false
@@ -995,8 +1005,11 @@ function createWindow() {
995
1005
  mainWindow.loadFile(node_path.join(__dirname, "../renderer/index.html"));
996
1006
  }
997
1007
  }
1008
+ function appIconPath(fileName) {
1009
+ return electron.app.isPackaged ? node_path.join(process.resourcesPath, fileName) : node_path.join(__dirname, "../../build", fileName);
1010
+ }
998
1011
  function createTray() {
999
- const iconPath = electron.app.isPackaged ? node_path.join(process.resourcesPath, "icon.png") : node_path.join(__dirname, "../../build/icon.png");
1012
+ const iconPath = appIconPath("icon.png");
1000
1013
  tray = new electron.Tray(electron.nativeImage.createFromPath(iconPath));
1001
1014
  refreshTrayTip();
1002
1015
  tray.setContextMenu(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runbay",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Not an installer. A launcher. Detect, launch, update and uninstall apps installed from the command line (npm, pnpm, yarn, bun, scoop) — in one modern window.",
5
5
  "main": "./out/main/index.js",
6
6
  "bin": {