Skip to content

Add WSL detection to install script#895

Open
cturner8 wants to merge 5 commits into
dmno-dev:mainfrom
cturner8:fix/wsl-install-script
Open

Add WSL detection to install script#895
cturner8 wants to merge 5 commits into
dmno-dev:mainfrom
cturner8:fix/wsl-install-script

Conversation

@cturner8

@cturner8 cturner8 commented Jul 18, 2026

Copy link
Copy Markdown

When running the install script on WSL, the varlock-local-encrypt.exe binary was ignored meaning anything checking isWSL won't find the expected exe

The linux block to install the local encrypt binary now also copies the exe, unless overriden with new --skip-win-exe flag

Installation folder now contains the linux native binary and windows exe:

image

varlock encrypt now correctly resolves the Windows TPM backend:

image

@philmillman

Copy link
Copy Markdown
Member

Thank you @cturner8, will take a look soon!

@philmillman philmillman self-assigned this Jul 18, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-bin flag to allow opting into the Linux helper binary on WSL.
  • Updated the Linux install path to install varlock-local-encrypt.exe on WSL by default (when present).
  • Added an is_wsl helper 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 .exe branch but then silently does nothing if ${_temp_dir}/varlock-local-encrypt is 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

Comment thread packages/varlock/install.sh
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • --help prints usage but the script continues into installation because parse_args returns 0 and main does not check it. This makes install.sh --help potentially perform side effects (downloads/installs) instead of exiting after showing help.
    ;;
    help | --help)
      usage
      return 0
    ;;

Comment thread packages/varlock/install.sh Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread packages/varlock/install.sh Outdated
WalksWithASwagger

This comment was marked as resolved.

@philmillman
philmillman dismissed WalksWithASwagger’s stale review July 18, 2026 17:39

no drive-by reviews please

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread packages/varlock/install.sh
@WalksWithASwagger

Copy link
Copy Markdown

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 varlock-local-encrypt.exe unless --skip-win-exe.

See: https://github.com/dmno-dev/varlock/pulls?q=is%3Apr+head%3Afix-install-wsl-encrypt-exe

@WalksWithASwagger

Copy link
Copy Markdown

Update: the corrected PR is #896 (same goal; Linux helper always installs, WSL additionally gets the Windows .exe unless --skip-win-exe).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants