Ask HN: 反重力 2.0 安装程序破坏了现有的反重力 IDE

2作者: jdw64大约 2 个月前
如果您在昨天 2.0 版本发布之前安装了 Antigravity IDE,那么现在这两个产品都位于同一个目录中,并且只有一个可以运行。双击 Antigravity IDE.exe 会启动 2.0 版本。 Electron 可执行文件首先加载 resources/app.asar,然后加载 resources/app/,它们都位于与可执行文件相同的文件夹中。可执行文件的名称对此查找没有影响。2.0 安装程序将 app.asar(2.0 代码)放在 IDE 的 app/ 文件夹旁边,而 asar 文件会胜出——因此 Antigravity IDE.exe 和 Antigravity.exe 最终都会加载 2.0 版本。 如果出现窗口,请打开 PowerShell。 解决方法: ```powershell cd "$env:LOCALAPPDATA\Programs\Antigravity\resources" Rename-Item app.asar app.asar.bak ``` 然后,Antigravity IDE.exe 会回退到 IDE 的 app/ 文件夹并启动真正的 IDE 1.107.0 版本。重命名回 app.asar 可以恢复 2.0 版本。 注意事项:一次只能使用一个版本。将 app.asar 重命名后,Antigravity.exe 也会回退到 IDE 文件夹。永久修复方法是卸载这两个版本,然后重新安装到不同的目录中——安装程序是 Inno Setup (unins000.exe),因此 /DIR="..." 应该有效。 这不是 Electron 的错误。基于位置的加载是已记录的行为。这是 Google 的 2.0 安装程序中的一个打包错误,它假设两个独立的 Electron 产品可以共享一个安装目录。
查看原文
If you had Antigravity IDE installed before yesterday&#x27;s 2.0 release, both products now live in the same directory and only one of them actually runs. Double-clicking Antigravity IDE.exe launches 2.0.<p>Electron exes load resources&#x2F;app.asar first, then resources&#x2F;app&#x2F;, from the same folder as the exe. The exe name has no effect on this lookup. The 2.0 installer dropped app.asar (2.0 code) next to the IDE&#x27;s app&#x2F; folder, and the asar wins — so both Antigravity IDE.exe and Antigravity.exe end up loading 2.0. if you window, Turn on the powershell<p>Workaround: cd &quot;$env:LOCALAPPDATA\Programs\Antigravity\resources&quot; Rename-Item app.asar app.asar.bak<p>Antigravity IDE.exe then falls back to the IDE&#x27;s app&#x2F; folder and launches the real IDE 1.107.0. Rename back to restore 2.0.<p>Caveat: only one at a time. With app.asar renamed aside, Antigravity.exe also falls back to the IDE folder. Permanent fix is to uninstall both and reinstall to separate directories — the installer is Inno Setup (unins000.exe), so &#x2F;DIR=&quot;...&quot; should work. Not an Electron bug. Location-based loading is documented behavior. This is a packaging mistake in Google&#x27;s 2.0 installer assuming two separate Electron products can share an install directory.