Search code examples
windowswindows-installerexemsix

How can I get my MSIX installer to add my CLI application binary to the PATH?


Goal: convert the EXE installer for my CLI application to an MSIX installer.

Method: using the MSIX Packaging Tool to convert the EXE installer to MSIX

Expected: the MSIX Packaging Tool will detect updates to PATH so that the binary is available in CMD/PS

Actual: the PATH variable is not updated with the binary path, so the install "succeeds" but the binary isn't available in CMD/PS


I'm trying to use the MSIX Packaging Tool to package an installer for a CLI, but I can't get it to update the PATH variable upon install. I created an EXE installer last year with NSIS that does everything I need it to do, but I'm looking to update the installer to MSIX if possible since that seems to be the future. However, it seems like MSIX is completely focused on desktop-style applications, which don't need to make their application binaries available in PATH.

I'm using the MSIX Packaging Tool since it promises to convert EXE installers to MSIX. It seems to catch all the changes I'm making to the registry and add the files to the install directory properly, but it doesn't catch PATH updates apparently.

Does anyone have insight into MSIX and the possible issues I might run into for a CLI application?


Solution

  • As Peter mentioned, the correct way to do this from an MSIX package is with the use of an execution alias. The following article contains more details about how an execution alias works and how you can define it in your package, no matter the tool you use to build the MSIX package.

    - Execution Alias