twexe (the plugin) update

265 views
Skip to first unread message

James Anderson

unread,
May 4, 2021, 8:31:27 AM5/4/21
to TiddlyWiki
Incase any windows/hta users still use this:

I've updated this plugin. the source is here: https://github.com/welford/twexe and you can grab a copy of the updated plugin from http://welford.github.io/

The big change is that you can run the contents of a tiddler as a batch file, which should help keep things portable (between machines / environments, not cross platform). 

It will create a temporary twexe.bat file in %TEMP% fill it with the contents of the tiddler and then run it. You can change the default temporary location via  $:/plugins/welford/twexe/tmpdir

in the attached image i have two examples, one will run my local node.js tw, the other just an example batch file that prints hello and the first arg passed to it.

twexe.png

Mohammad Rahmani

unread,
May 4, 2021, 9:36:43 AM5/4/21
to tiddl...@googlegroups.com
James,
 This is one of great tools which will always be useful!
 
  Thank you very much for the update!

Best wishes
Mohammad


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/49e93d80-9a3e-449e-bbd4-9a007b0782dcn%40googlegroups.com.

Mark S.

unread,
May 4, 2021, 10:45:02 AM5/4/21
to TiddlyWiki
What is meant by a "hta" type file? Do all browsers support it? I had the notion that it was associated with Internet Explorer. Support for IE is supposed to end this summer.

I was confused by the name at first, because  there is an existing product called "twexe" which bundles up TW files into executables.

Thanks!

James Anderson

unread,
May 4, 2021, 10:55:29 AM5/4/21
to TiddlyWiki

It's asscoiated with Windows rather than IE (it probably uses some IE or edge stuff under the hood, but you don't need IE installed to use it iirc)

if you rename an html file to .hta on windows you get elevated permissions that a web page wouldn't normally have. This is powerful but potentially dangerous (i'd only ever use it for my own tiddlywikis) 

by default a tw running from hta can save to itself with no plugins required. With my plugin it can run other executables (my plugin is also safe for browser versions, it just won't attempt to do anything in that case)

Also I * think * my plugin predates twexe the app :D


James Anderson

unread,
Jun 13, 2021, 7:46:27 AM6/13/21
to TiddlyWiki
Make another small update so that twexe containing tiddlers can be exported to plain html (with the obvious limitation that the button is no longer functional)

available here http://welford.github.io/  also added a little gif showing it in action :)

twexe[1].gif

Si

unread,
Jun 13, 2021, 2:18:45 PM6/13/21
to TiddlyWiki
Thanks James I did not know this existed! I was looking for something similar a while ago.

Can you use it to run PowerShell scripts?

James Anderson

unread,
Jun 13, 2021, 3:09:25 PM6/13/21
to TiddlyWiki
Just tested and unfortunately not right now.

I have a few places where i call WshShell.Run( "cmd /c " + path + " " + args ); From a quick google making the "cmd /c" part call "powershell -File " maybe with some other settings like -executionpolicy unrestricted.

I know next to nothing about powershell though.

specifically 
TWExeWidget.prototype.runTiddler = function (event) {
TWExeWidget.prototype.openFile = function (event) {

and can give me a working string format for  powershell scripts i can update the plugin to provide the shell in which it will run via a field. e.g. twexe_shell: powershell, so that we can support both.



Si

unread,
Jun 14, 2021, 11:17:21 AM6/14/21
to TiddlyWiki
Hi James thanks for the reply. Just trying it I actually can't even get it to work with a batch file ("The filename, directory name, or volume label syntax is incorrect"). This doesn't matter however because I also now realize that .hta will use internet explorer to run the app, which means unfortunately I can't use this for my wiki anyway.

James Anderson

unread,
Jun 14, 2021, 12:40:08 PM6/14/21
to TiddlyWiki
Hey Si, I don't think it's true that you need Internet Explorer for any of this, it's runs under the  mshta.exe which should ship with windows. I certainly don't have IE installed on my system - but you will need windows.

I don't knoe if this is still needed but i have another plugin  $:/plugins/welford/htalink/link.js which makes the wiki open links in the default browser.

if you are still interested i can maybe help look at any issues you are hitting: Excuse the crude picture but setting up a twexe should be pretty simple. this one opens calc and then is linked to twice in another doc, first as it is and then a second time with overridden params.

asdf.png

James Anderson

unread,
Jun 14, 2021, 12:49:04 PM6/14/21
to TiddlyWiki
looks like we do still use htalink, i probably should just fold it into twexe

Si

unread,
Jun 14, 2021, 2:04:51 PM6/14/21
to TiddlyWiki
Hi James,

>>> I don't think it's true that you need Internet Explorer for any of this, it's runs under the  mshta.exe which should ship with windows.

It seems that mshta.exe relies on the Internet Explorer engine (not that I know what that means...): https://en.wikipedia.org/wiki/HTML_Application#Execution

Anyway a wiki running as an hta app looks just like it does when running in IE, and more recent web stuff doesn't work (e.g. the details tag). My main wiki won't even open in IE (or as an hta) due to some of the plugins I have installed.

>>> if you are still interested i can maybe help look at any issues you are hitting

Thank you! Though I've now figured out my mistake: I was using a folder for twexe_cmd that didn't exist! Works as expected now.

>>> I don't knoe if this is still needed but i have another plugin  $:/plugins/welford/htalink/link.js which makes the wiki open links in the default browser.

I didn't install that plugin and it still works, but I only did a simple test.

James Anderson

unread,
Jun 14, 2021, 2:31:48 PM6/14/21
to TiddlyWiki
what's the details tag?

Si

unread,
Jun 14, 2021, 3:33:45 PM6/14/21
to TiddlyWiki
>>> what's the details tag?

It's an HTML element that you can click on to hide/reveal a block of text: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details


It was added recently enough that it is not supported by Internet Explorer. It's just one example, I'm sure there are all sorts of things that have been added to new browsers which won't work in older ones.

James Anderson

unread,
Jun 14, 2021, 4:11:01 PM6/14/21
to TiddlyWiki
Ah yeah, some of the newer features are not there yet.

TW Tones

unread,
Jun 14, 2021, 6:47:31 PM6/14/21
to TiddlyWiki
Folks,

I have read that the hta format may not be supported in the future, for tiddlywiki users however we still have tiddly desktop which has local computer rights, I have not tested the twexe in this thread on TiddlyDesktop but I expect it would work.

Using Internet Explorer is a liability given its end of life status, it has and possibly always was a target of hacks and Malware. Using the mshta.exe or an alternative can continue but only if supported.

Regards
Tones
Reply all
Reply to author
Forward
0 new messages