rejetto forum

Software => HFS ~ HTTP File Server => Programmers corner => Topic started by: NaitLee on October 06, 2020, 04:54:04 AM

Title: The way to run GNU/Linux pkgs with HFS (Wine) with {.exec.}
Post by: NaitLee on October 06, 2020, 04:54:04 AM
I think there will always be someone interested in this, so I post this here. :D

I've found the answer here (https://stackoverflow.com/questions/6004070/execute-shell-commands-from-program-running-in-wine).
When HFS is running with Wine for Linux, it's exactly someway to execute outside GNU/Linux packages:
Code: [Select]
{.exec|cmd /c start /unix /usr/bin/gedit|out=x.}
{.^x.}
This will run gedit.

More usefully:
Code: [Select]
{.exec|cmd /c start /unix /usr/bin/libreoffice --convert-to html --outdir "/home/user/converted_document" "/home/user/document/file.docx"|out=x.}
{.^x.}
This will convert "file.docx" to "file.html" with LibreOffice, so the file can be previewed within a browser.

But seems in this way we cannot execute bash based things (like /bin/sh), with a debug message:
Code: [Select]
0045:fixme:exec:SHELL_execute flags ignored: 0x00000100We may report this to Wine developers? :)
Title: Re: The way to run GNU/Linux pkgs with HFS (Wine) with {.exec.}
Post by: LeoNeeson on October 08, 2020, 08:04:04 PM
When HFS is running with Wine for Linux, it's exactly someway to execute outside GNU/Linux packages:
:) That's very nice, if only we could have a way to 'detect' if HFS is running over Wine/Linux or in pure Windows. Does someone knows if some macro could detect this?...

But seems in this way we cannot execute bash based things (like /bin/sh), with a debug message:
Code: [Select]
0045:fixme:exec:SHELL_execute flags ignored: 0x00000100We may report this to Wine developers? :)
I'm not a Linux expert, but feel free to report it (if you can give them enough details, and only if you are sure that's a Wine issue).

Cheers,
Leo.-
Title: Re: The way to run GNU/Linux pkgs with HFS (Wine) with {.exec.}
Post by: NaitLee on October 09, 2020, 04:18:39 AM
:) That's very nice, if only we could have a way to 'detect' if HFS is running over Wine/Linux or in pure Windows. Does someone knows if some macro could detect this?...

Detecting Wine itself by exe is not suggested by Wine developers: "That's a bad idea (https://wiki.winehq.org/Developer_FAQ#How_can_I_detect_Wine.3F)". So we need to define such a environment for HFS (and other exe) manually, like by giving user a adjustable option.