aloneguid/win-shim

Create shim using relative paths

Closed this issue · 2 comments

mnivet commented

To distribute a suite of tools we wanted to use your work so we can create shims in a root folder that target various executables stored in sub-folders.

Something similar to this :

  • /suite/
    • tool1.exe
    • tool2.exe
    • tools1/
      • tool1.exe
      • tool1.pdb
      • and a bunch of dependencies…
    • tools2/
      • tool1.exe
      • tool2.pdb
      • and a bunch of dependencies…

Creating the shim executable on a dev computer works perfectly.
However if we move the whole "suite" folder somewhere else it do not works anymore. Like if the shim executable was using a full path to launch the real executable.

For more information we currently create the shim executable by placing us inside the /suite/ folder as the working directory and executing shmake.exe as follow :

path/to/shmake.exe -i tools1/tools1.exe
path/to/shmake.exe -i tools2/tools2.exe

And we expected the shim executables to use relative paths since we gave relative paths to shmake.exe, but it do not seems to be the case.

So, is there a way to create shim executables that use a relative path reference to the real executable ?

Yeah, it's open-source with permissive license, feel free to do whatever you want :)

thank you so much! i never thought anyone will be interested in this simple tool ;)