You are browsing as a guest. Sign up (or log in) to start making projects!

3h 24m 25s logged

Shims are simple in concept, complicated in reality. So essentially a shim in mocha is just an executable which calls another executable. It’s similar to a shortcut in that sense, except it shows up in $PATH

Thankfully the scoop project already has a repository with 4 different implementations for the shim binary, so I can just have mocha shim download one of those binaries.

The complicated part was the PE Subsystem. The PE subsystem is basically a bit of info in each binary which tells Windows whether it’s a console application, or a GUI application.

We need to set the PE subsystem of the shim exe to the PE subsystem of the binary we are calling for Windows to execute the binary properly. Hence I need to read and write raw binary data.

All of this is just the implementation for exe shims. Scoop itself contains implementations for .bat/.cmd, .ps1, .jar, .py and linux binaries, all of which have wildly different implementations compared to .exe shims.

The video below shows the working set of mocha shim commands (those being add, remove and list).

0
2

Comments 0

No comments yet. Be the first!