-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open source mshta.exe #533
Comments
This repo is specifically about the WebView2 control. Did you have an ask about WebView2 related to HTA/mshta.exe? |
@champnic thanks Nic, yes I did ... somehow I led myself to believe "this" will replace "that" in a near future? |
Gotcha! WebView2 is certainly a migration path forwards, but isn't currently an entire framework in and of itself, like Electron. I actually think PWAs are probably the more obvious path forwards for HTAs. If you'd like I can add this as a feature request on our backlog, but my feeling is we probably wouldn't get to this for a while (if ever). |
@champnic, I might require too much of a cognitive effort to follow your good reply. mshta.exe was/is written by using IE related WebView2 control, still in existence on Win10,8,7. One has to see it and use it to fully appreciate it. Attached. Now, who do I ask to open source that mshta.exe ? |
HTA is just a webbrowser control in a window, I'd say you shouldn't need to move to PWA. It seems like it would be easier to use WebView2 on your own form, and use the HTML you already have, without the HTA tags. |
Wholeheartedly agree
Forgive me, I am not sure I follow. Where do I put that form? |
How do you code your HTAs as the moment and are they in JS or VBS? |
Please look into the zip attached above : powerof.zip JavaScript, CSS, BootStrap, jQuery, embedded images. All in one HTA. There are no includes. |
I would but it's expired ;-( |
|
Not if you have the source. |
I'm going to close this issue as it doesn't seem to be an ask on the WebView2 control, but rather a discussion of how to move forwards with HTA. Feel free to continue the discussion here though! |
Here it is: |
Can you please point is to some online resource talking about this? Unless you mean: rundll32.exe javascript:"\..\mshtml,RunHTMLApplication ";alert('foo'); I think mshta.exe is more than that. It is com client that also encapsulates that functionality, and it is also a normal app to which *.hta files are associated and also is a win32 app which receives the HTA file name that is executed. It also has important security-related programming inside that solves few important issues. Thus, if you do WIN+R and then paste e.g . |
No. I know it by disassemble |
Can't look at powerof.zip every AV I have, says it contains a trojan. |
(laugh) it does not , win 10 always says that about ht... I can send you the whole file as a txt attached to an email or even better I can make a Gist? |
That's OK you've answered the basic question, that it's not VBS. All you need to do is download the community edition of Visual Studio, then create a simple form with a basic WebView2. With very little tweaking you will be able package your HTA code in your own app. |
powerof.hta gist is here: https://gist.github.com/DBJDBJ/e459b21072948bcacbed5e966f4801bf Hopefully, it is obvious it is not a "virus" :) Please use it. Just save it to your desktop as hta file, double click and enjoy. I still do not follow this: "... create a simple form with a basic WebView2."? Are we talking C# here? |
Doesn't look like a virus to me 👍 You can use WebView2 with C#/.NET using WPF or Winforms, Win32/C++, or WinUI 3.0 (still in development). The "Getting Started" guides are a good place to start: |
It is a complete desktop app with a fully functional GUI. Minus any C#, C++, VB, WPF, Winforms, WinUI, no .NET whatsoever. And it is not a trick and it is not a hack. It is 21 years mature, and in every copy of WIN10, just like mshtml.dll on which it is based. And it can be used today. It just works™ |
@DBJDBJ Loaded that into WebView2 and it all works, so you can quite easily build your own app for it. As you're using JS, C# should be easy enough for you, but you can also use F# or VB. Only down side at the moment, is that you'll need to package it, but that will change. I'm sure once it's mature, Edge/WebView2 will be bundled with Windows, just as mshtml/IE is today. |
Fair enough, probably rejected it because it was an HTA/HTA.exe, I didn't argue, just removed it. |
The KEY POINT™ HTA does not need .NET. It has nothing to do with .NET anything. It goes around 20 years of .NET and delivers. And oh, it goes around UWP too. ps: @ukandrewc many thanks for your involvement, I am not arguing with you. |
Agreed, but it's old technology, and things have moved on. HTA has been superceded by cross platform PWA. I was just offering a solution to using your HTA in WebView2. |
@ukandrewc again: I am not arguing with you but :) Some "Things" have moved on but into the wrong direction, like UWP. And one does not need any of .NET to create full-blown non-trivial Windows desktop app. One does not need Edge related control curiously called "WebView2" to execute HTA. But. That certainly can be done. But the thing is not even released yet. PWA has absolutely nothing to do with HTA. HTA when executed is "just" a Windows desktop app. It is not OS-agnostic and it is not device agnostic too. Neither it wants to be. HTA is not a web page running locally. It is "old technology"?: There is also such a thing called "mature technology". Like for example Win32 C/C++ App. Windows is also "old technology" but also "mature technology". |
Oh well, I'll leave it there then ;-) |
Was @niutech politically incorrect ;) |
lol linking to leaked Windows source code on a Microsoft forum. More "businessally incorrect"? |
I am also interested in this issue. I have focused on using HTA like Electron in recent years. It received a greater response than expected. This is the result: https://github.com/gnh1201/welsonjs I think the improvement of JScript has already been made by Chakracore. However, Chakracore does not include HTML rendering, so it is currently not available like Electron. (e.g. chakra-core/ChakraCore#6622) I want to make an improved HTA based on MSHTML or EdgeHTML. The best way is for HTA to be released as an open-source. |
I will not be gloating :) https://www.thewindowsclub.com/msedgewebview2-exe-high-cpu-and-memory-usage mshta.exe is very different solution. it also does not require electron. mshta.exe is highly likely a really small code. why can't we just have it please as open source? |
I agree. I think we should talk seriously about making an open source version of MSHTA.exe and its implementation to run VBScript files. And further: implement the open source solution to Wine to execute hta files on Linux. Also: I don't know if this is the right place to ask that. Making desktop applications with HTA+VBScript is far better and less bloated than Electron for example. |
All of the alternatives presented are not suitable for accessing the COM interface with Javascript in Windows. Windows can perform a wide variety of native tasks through the COM interface. JScript (including Chakra) can finish this with at least three lines. MSHTML and EdgeHTML (e.g. MSHTA) have access to COM interface and HTML rendering, so I can create lightweight Windows applications. If I have to use a different base, I can't predict how much effort it will take and how big the program will be. |
As @ysc3839 said, all
|
Far different things from MSHTA. |
@terremoth Really? It's not VBScript, but Photino can invoke native .NET methods, see e.g. this sample. |
@niutech Photino uses |
We agree, but can you please stop mentioning VB Script? mshta.exe will work for you as it is. We just want it open sourced, that is all. Keep the message succint. |
too bureaucratic. |
Irony? If not, what's the problem with mentioning VBS? VBS with COM interfacing is literally the greatest feature that can be used in HTA. HTA without VBS is just a simple HTML with extras window features. Edit: I know all this thread/issue isn't about VBS itself, it is just the HTA greatest feature still working on Windows (and hope it continues), and I just mention there should be a place people could talk about this these days, and mainly: create an open source version of it. |
@terremoth not irony ... keep your message clean and with no drama and no tangential opinions... Open Source mshta.exeSimple |
looooooooooooool |
I found a repository that mentioned this issue. He seems to be using MSHTML and Chakracore to solve. |
I think @jscherer92's comment exactly explains this issue.
|
I'm totally with you DBJDBJ , would be very cool to have mshta render with WebView2 Actually neutralinojs is pretty cool and, thats the closest i've got to a replacement. But there's no new ActiveXObject() equivalent :/ - You could build your own API, and just execute scripts outside the app. Allthough.... it is definitely possible to implement the javascript (jscript) COM interface in a modern WebView.. just like in a HTA. And i did it with Edge WebView2 in a c# .net app .. in the end i didn't complete the project, because i didn't like the fact that it was dependent on .NET. There's some guys over at the autoit forums that got something going on.. could be promising. |
One thing, why would you need mshta open source? The huge advantage of mshta.exe is that it's installed, and ready to run on literally every windows machine. An "open source" mshta would just be some 3rd part unsigned software.. and i bet the sourcecode is not really worth much. imo.. Anyways, the main thing that makes HTA so powerfull, is the ActiveXObject() method. This can , as mentioned, be implemented relative easy in webview2!.. it's just one function. In a C# .NET app, it's litterally one line of code :
If anything... it would make sense to just build a new and better version of "mshta", and maybe add some functionality, along the lines of what NeutralinoJS did. |
Imagine: npm mshta Get it? 😀 Even if it is just for Win and just WebView2. If in npm as OSS, Microsoft or not , people can safely base projects on it. Same as then, people will have full support, advice, debugging etc. VSCode extension , the lot. |
@DBJDBJ Why would anybody use Node Package Manager to install a Windows runtime independent of Node? If anything, WinGet or Chocolatey is the way. But I think we have much more modern cross-platform open-source web engines to build new apps, which I mentioned earlier. MSHTA should be open sourced but rather for archival purposes and legacy apps. |
Nothing to do with node. Once upon a time, vbs and js interpreters have been outside of IE browser. Scripting on Win was wild. WSC , HTA components and the rest. That was all tightly coupled to COM . ProgID's, "new:" moniker and the rest. |
Take a look at the [issue I referenced](gnh1201/welsonjs#157). It contains all the known resources needed to create an open-source version of mshta. If someone truly needs it, they can use this as foundational material to build it. |
My interest back in the time was for a MSHTA implementation that could deal/read vbscript and activex objects in the page, interacting with COM, etc, so GUI apps could be made with html+css+js+vbs + a database. But I see Microsoft wants to bury definitely this kind of technology. Today I kind of agree with that, since you can do progressive web apps (PWA) (and even suggest browsers to install the PWA as an offline Windows app) and use in-browser databases such as Dexie.js, pouchdb, localforage, idb and many others, and use a more updated JavaScript ecosystem |
Scripting on Windows has remained largely consistent since the release of Windows Vista. Both JavaScript (JScript) and VBScript can still be used with the Windows Script Host (via wscript.exe or cscript.exe). ( Can be wrapped in WSF files, was it those you meant? ("WSC"?) ) Additionally, HTAs supports Javascript (JSCRIPT) and VB in IE Mode <9 (..i think..or it's <8) Internet Explorer (standalone installation) and the COM version (InternetExplorer.Application / IWebBrowser2) , are two different things. My guess is that mshta does not contain any "magical" functionality, It primarily serves as GUI interfacing with the Windows API and COM, which handle most of the underlying operations. |
That's what I said. I said it in less detail though 👌. WSC is/was Windows Scriping Component. These years I am far from coding. I just want quick js scripts with html gui. Built in Win. No PS and no .net. Just cmd.exe. No bat. If thats still inside, fine. I just don't want be thinking mshta.exe might dissapear one day. Because it stayed by accident. |
Why is nobody talking HTA here?
The text was updated successfully, but these errors were encountered: