Add WSL detection to install script#895
Conversation
|
Thank you @cturner8, will take a look soon! |
There was a problem hiding this comment.
Pull request overview
This PR updates packages/varlock/install.sh to correctly install the native encryption helper binary when running the Linux installer under WSL, aligning the installed helper with the runtime expectation that WSL uses the Windows .exe helper.
Changes:
- Added a new
--force-linux-enc-binflag to allow opting into the Linux helper binary on WSL. - Updated the Linux install path to install
varlock-local-encrypt.exeon WSL by default (when present). - Added an
is_wslhelper used by the Linux installation branch.
Comments suppressed due to low confidence (1)
packages/varlock/install.sh:197
- With
--force-linux-enc-bin, the script disables the WSL.exebranch but then silently does nothing if${_temp_dir}/varlock-local-encryptis missing. That can leave WSL installs without any helper binary and no error, making failures harder to diagnose. Consider handling the forced-flag branch explicitly and erroring when the requested Linux helper is not present.
linux)
if is_wsl && [ "$FORCE_LINUX_ENC_BIN" = "false" ] && [ -f "${_temp_dir}/varlock-local-encrypt.exe" ]; then
install "${_temp_dir}/varlock-local-encrypt.exe" "${INSTALL_DIR}/"
echo " Installed native encryption binary (varlock-local-encrypt.exe)"
elif [ -f "${_temp_dir}/varlock-local-encrypt" ]; then
install "${_temp_dir}/varlock-local-encrypt" "${INSTALL_DIR}/"
chmod u+x "${INSTALL_DIR}/varlock-local-encrypt"
echo " Installed native encryption binary (varlock-local-encrypt)"
fi
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
packages/varlock/install.sh:68
--helpprints usage but the script continues into installation becauseparse_argsreturns 0 andmaindoes not check it. This makesinstall.sh --helppotentially perform side effects (downloads/installs) instead of exiting after showing help.
;;
help | --help)
usage
return 0
;;
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
no drive-by reviews please
…n to native linux bin, can be skipped"
|
Opened an alternate PR with the same goal but without regressing non-WSL Linux installs: the Linux helper always installs when present; WSL additionally gets See: https://github.com/dmno-dev/varlock/pulls?q=is%3Apr+head%3Afix-install-wsl-encrypt-exe |
|
Update: the corrected PR is #896 (same goal; Linux helper always installs, WSL additionally gets the Windows |
When running the install script on WSL, the
varlock-local-encrypt.exebinary was ignored meaning anything checkingisWSLwon't find the expected exeThe linux block to install the local encrypt binary now also copies the
exe, unless overriden with new--skip-win-exeflagInstallation folder now contains the linux native binary and windows exe:
varlock encryptnow correctly resolves the Windows TPM backend: