* fix(nsis): auto-elevate silent updates for per-machine installations
When users chose "Install for all users", subsequent auto-updates would
fail with "cannot close app" because the silent installer ran without
admin privileges. Detect per-machine installations via HKLM registry
and re-launch with elevation (runas) during silent updates.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(nsis): elevate for per-machine installs in all modes, not just silent
The previous fix only handled silent updates. Manual reinstalls where
the user switches from "Install for all users" to "Install for me only"
also fail with "cannot close app" because the non-elevated installer
cannot manage the per-machine installation. Remove the silent-only
guard so elevation is requested whenever a per-machine install exists.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(nsis): exit with error when user cancels UAC elevation
ExecShell sets the NSIS error flag when the user cancels the UAC
dialog. Check this flag and exit with error code 1 on failure instead
of unconditionally reporting success.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Payne Fu <payne@Paynes-MacBook-Pro.local>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* refactor: replace afterPack script with beforePack and remove after-pack.js file
- Updated electron-builder configuration to use beforePack instead of afterPack.
- Removed the after-pack.js script as its functionality is no longer needed.
* refactor: streamline filter logic for architecture-specific packages in before-pack script
- Consolidated platform-specific filter conditions for arm64 and x64 architectures.
- Improved readability and maintainability by using arrays to manage filters for different architectures.
- Ensured that the correct filters are applied based on the architecture during the packaging process.
* chore: remove npm build commands from CI workflows
- Eliminated unnecessary `yarn build:npm` commands from the nightly build and release workflows for Linux, macOS, and Windows.
- Streamlined the build process by focusing on platform-specific build commands.
* delete build npm
* refactor: enhance architecture-specific package management in before-pack script
- Updated the before-pack script to include additional architecture-specific packages for arm64 and x64.
- Improved the organization of package filters and streamlined the logic for handling different architectures during the packaging process.
- Ensured that the correct filters are applied based on the architecture, enhancing the build process for various platforms.
* docs: clarify comment on prebuild binaries in before-pack script
* format code
* chore: add afterPack script to electron-builder configuration
- Included afterPack script in electron-builder.yml to enhance the packaging process.
- This addition allows for post-packaging tasks to be executed, improving build automation.
* chore: update macOS entitlements to disable library validation
- Added the key `com.apple.security.cs.disable-library-validation` to the entitlements file to enhance security settings for macOS builds.
* chore: remove unused package for win32 arm64 architecture
- Deleted the `@strongtz/win32-arm64-msvc` package from `package.json` and `yarn.lock` as it is no longer needed.
- Updated the `before-pack.js` script to improve architecture-specific package management by refining filter logic and ensuring correct package downloads based on architecture.
- Enhanced the `downloadNpmPackage` function to use Node.js streams for downloading and extracting packages, improving efficiency and error handling.
- Implemented a function to check system and application architecture compatibility.
- Added error handling to notify users of architecture mismatches during installation.
- Enhanced the custom initialization macro to include architecture checks before proceeding with installation.