podman-desktop icon indicating copy to clipboard operation
podman-desktop copied to clipboard

On windows allow .bat in addition to .exe

Open arixmkii opened this issue 3 years ago • 3 comments

Is your enhancement related to a problem? Please describe

Right now podman-desktop is looking for podman on non Windows and podman.exe on Windows. For unix likes it is ok, because one can create podman (w/o .sh extension) shell script, which will prepare the environment and then chainload the actual podman binary. On windows this doesn't work, because both bat file and exe have extensions. And it is impossible to create bat file with .exe ending keeping the functionality.

Describe the solution you'd like

On windows use podman as binary name and then use either some npm package to lookup binary in path or use expansion of PATHEXT env variable to look for alternatives, like it is done in Go lang standard library https://github.com/golang/go/blob/027855e8d86f461b50946b006ea032d4b4a7d817/src/os/exec/lp_windows.go#L68

Describe alternatives you've considered

Use dedicated env variable to override binary name. So, one would be able to provide "podman.bat" value and call into bat script, which will then invoke podman.

Additional context

Need to verify that the current implementation of calling external process support scripts in addition to binaries (assumption is that it supports).

Shell/Bat scripts are useful to setup correct environment before launching binary, w/o need to have global env polluted.

arixmkii avatar Aug 31 '22 08:08 arixmkii

@arixmkii looking at the description, are you interested in customizing the binary to call or you want to customize some environment variables used by podman process ?

Like having a way to provide additional environment variables that Podman Desktop would provide every time it's calling podman binary ?

benoitf avatar Aug 31 '22 09:08 benoitf

I'm experimenting with QEMU podman machine on Windows. For now I needed to launch podman binary from a different location and providing some additional env variables to the started process. I have workarounds for my requirements in place. I tried to make this issue a more generic feature/enhancement.

arixmkii avatar Aug 31 '22 09:08 arixmkii

I may take this myself and create a PR for more detailed discussion later, when I have some free time slots.

arixmkii avatar Aug 31 '22 09:08 arixmkii

you can provide a custom binary path for podman

benoitf avatar Sep 05 '23 07:09 benoitf