decker-edu / decker

A markdown based tool for slide deck creation.
GNU General Public License v3.0
50 stars 11 forks source link

plantuml needs special treatment on Windows #45

Open salbeira opened 1 year ago

salbeira commented 1 year ago

Let us document this quest for finding out why plantuml currently can not be called on Windows:

plantuml is a Java application and thus is distributed as a .jar . If you install plantuml under Linux (and probably MacOS) the .jar archive is put in a known location and on the PATH is put a bash script that forwards its arguments to a java -jar [...]/plantuml.jar call.

Windows does not get this treatment and instead only gets the .jar file. You can run the program with java -jar from the PowerShell but we are lacking a script to be called by the name "plantuml".

So what about writing your own quick .bat or .ps1 script that forwards its arguments to the java -jar plantuml.jar call and put that on the PATH?

@echo off
call java -jar C:\Applications\plantuml.jar %*

Looks promising. In the PowerShell you can manually call plantuml -version and everything seems to work yet now Haskell is playing tricks with us.

The availability of programs gets checked by us with a call with readProcessWithExitCode which passes on creating the process to CreateProcess. This function assumes that if you are on a Windows machine and want to spawn a new process without a file extension that the file referenced MUST be a .exe which ignores the fact there is a callable script by that name available.

I see the following solution to this:

Either we recommend a user on Windows who wants to use plantuml to write their own script and explicitly call plantuml.bat if decker runs on Windows or we use a meta-variable to let the user define the location of their plantuml.jar file and explicitly call java -jar $plantumlPath.

monofon commented 3 months ago

Closed in favour of #72.