Exe программирование на html

Software to convert HTML, CSS and JavaScript into an exe?

Do you want something that translates Javascript to native x86 code? That seems like a pretty tall order.

4 Answers 4

While the (previously) accepted answer was correct, in the intervening years the industry has gone ahead by leaps and bounds. Two very good open-source and extremely actively developed options are

  • Electron, by GitHub. Lets you build cross-platform Windows, MacOS, and Ubuntu applications from HTML/JavaScript/CSS. It works by embedding them into a Chromium build alongside with Node.js. Many applications such as Slack and Visual Studio code are built with Electron.
  • Cordova, by the Apache Foundation. Targets Android, iOS, and Windows from HTML/JavaScript/CSS. It works by embedding them into a WebView (or whatever is the equivalent on the target platform).
  • Proton Native. Works with React Native components and does not use Electron (see above), which makes generated apps therefore more «lightweight» than the ones generated by Electron. Uses libui under the hood.

I’m assuming you mean «such» and not «suck». Tried to add an edit but the edit requires at least 6 characters changed.

@GuidoDomenici Please check out Scriptonit (scriptonit.deneskellner.com) and add to your answer if you find it useful. I just finished it recently as a free product but I’ve been using it for years while it was half-baked. And I think it’s easy to like.

Yes there is a program HTML Compiler that allows you to convert an entire HTML application (using CSS, JavaScript, Images and more) into an standalone Windows application.

There is also ExeOutput for PHP that lets you create applications in native format for Windows with PHP, JavaScript and HTML. Convert PHP scripts, websites, JavaScript, HTML, databases into stand-alone apps for Windows (single EXE files) that do not require a Web server nor PHP distribution.

There is nothing wrong with self-answered questions, however, one should disclose one’s affiliation — especially with commercial products. Are you in any way affiliated with HTML Compiler?

I am not taking exe literaly, but you can setup a desktop application with node-webkit which will basicaly run your webapp localy in a webkit browser. see http://strongloop.com/strongblog/creating-desktop-applications-with-node-webkit/

For window apps

UPDATE — I just finished a freeware solution for this; check out Scriptonit, I think it’s closest to what you need. But I’m surely biased so let’s see all the others.

If you need something to present you a window environment and a webserver emulation, choose ZZEE or ExeOutput, these are decent tools, maybe ZZEE is a bit outdated regarding the PHP version. So for «HTML, CSS and Javascript», the answer is clearly something like this.

Читайте также:  Есть ли в строке буквы python

A real compiler: JSC

If you want (something-like-)javascript to be compiled to a standalone EXE, give a chance to JSC, it’s there in your Windows, you just probably never met before. JSC gives you extremely small executables (because of the .NET already built into Windows itself) and they have full power of .NET so you can do pretty much anything you want. Flipside: apart from the syntax being familiar, not a lot will remind you of Javascript, you have to learn a lot of new practices to get along.

A bonus track: «chrome —app» and RAR

If you can live with a dependency such as Chrome, you can do a nasty but working solution: RAR can create a self-extracting EXE for you and run a command after extraction (!!), so you can pack up a little micro-universe of HTML/CSS/JS files; then you can call Chrome with «—app=something.html» that will give you a plain window with a browser environment and your HTML file in it. I know this is not a compiler; however, it’s a way to create an EXE that is self-contained and gives the user a web-liek experience in an application-like window. Sure, Javascript will be a bit limited because you’re running in a local file, not a proper website, but it’s not that painful. One lovely thing about this technique is that Chrome will remember the position and size of your window so it will pretty much feel like an application.

Источник

Сайт внутри EXE файла

В этой статье мы рассмотрим как хранить HTML страницы и входящие в него картинки в вашем проекте. В конечном итоге мы получим один исполнимый файл содержащий HTML страницу.

Шаг первый — создание HTML страницы.

Для начала мы создадим две простеньких HTML страницы. Для их создания вы можете воспользоваться вашим любимым HTML редактором. Создайте одну страницу с одним рисунком и ссылкой на другую страницу. Я назову свои delphiandprogramming.html и page2.html. Когда вы добавите картинку в страницу, то редактор напишет что-то вроде:

Но нам нужно поменять в коде HTML значение параметра SRC так чтобы он был равен имени ресурса:

Вот код моей странички delphiandprogramming.html:

Delhi And Programming Test Resources 3</HTML></head> Look at second page 
Welcome to !
Delhi And Programming Test Resources Page2</HTML></head> AND HERE WE GOES THRU EXE!  

Создание файла ресурсов

Напомню, что для создания файла скрипта вам необходимо:

  1. Создать пустой текстовый файл в директории с проектом
  2. Переименовать его в TestRes3.rc
  3. Написать в нем следующий код:
dpg HTML "delphiandprogramming.html" page2 HTML "page2.html" dpgjpeg JPEG "delphiandprogramming.jpg"

Тип ресурса — RT_HTML определенный как ресурс под номером «23», это ресурсный тип по умолчанию для HTML страниц.

Итак, мы создали файл скрипта ресурсов, страницу и связанную с ней картинку. Следующий шаг — откомпилировать скрипт. Для его компиляции, как это было описано во второй части этой серии мы выполним в командной строке следующую команду:

Теперь подключим полученный файл ресурсов в наш проект следующей строчкой:

Показ страницы в браузере

Когда мы откомпилировали наше приложение, (я его назвал testres3.exe) мы можем просмотреть нашу страничку в браузере, для этого в адресной строке браузера наберите следующий адрес:

res://C:\Delphi5\Projects\TestRes3\testres3.exe/HTML/dpg

Конечно путь » C:\Delphi5\Projects\TestRes3\testres3.exe» у вас может отличаться.

Показ страницы в своем приложении

А теперь мы покажем страницу в самом приложении! Разместите на форме компонент TWebBrowser (находится в Delphi 5 на закладке «Internet»). И на создание формы напишите следующий код:

Self.WebBrowser1.Navigate('res://C:\Delphi5\Projects\TestRes3\testres3.exe/HTML/dpg');

И все! Теперь вы можете отправлять свой сайт не заботясь о том что пользователь не сможет набрать эту хитрую строчку: ‘res://C:\Delphi5\Projects\TestRes3\testres3.exe/HTML/dpg’.

Источник

Exe программирование на html

Tagged as

Stats

Comments and Discussions

That is the best thing since snuff. I been looking for something like this for weeks and i needed to click a batch file and worse yet with a python script inside and do you know what happened.. Worked perfect like a big dog using Firefox. Thanks soooooo much.
title>Application Executer/title> HTA:APPLICATION/> html> head> script type code-keyword">text/JavaScript" language code-keyword">JavaScript"> function RunFile() < WshShell = new ActiveXObject("WScript.Shell"); // below both work! // WshShell.Run("c:/windows/system32/notepad.exe", 1, false); WshShell.Run("notepad.exe", 1, false); // optional script window.close(); > /script> /head> body> center> br/> input type code-keyword">button" onclick code-keyword">RunFile();" value code-keyword">Click to Run Notepad and Close Window"/> /center> /body> /html>
HTA:APPLICATION/> title>Application Executer/title>  in "HTA APPLICATION" can't use "", otherwise this is "HTML Document". Note: yet for execute/view document with "Microsoft (R) HTML Application host" can use ".hta" file extension or "Open with" / "Send to" "C:\Windows\System32\mshta.exe" "C:\Windows\SysWOW64\mshta.exe", or within "HTML Document" ; these ways can solve available "" for ".hta", ".htm", ".html" files extensions. --> html> head>  content="ie=edge" "edge" is "Internet Explorer" version and can change/replaced from "1 to 11" --> meta http-equiv code-keyword">x-ua-compatible" content code-keyword">ie=edge"> meta http-equiv code-keyword">content-type" content code-keyword">text/html; charset=UTF-8"> script type code-keyword">text/JavaScript" language code-keyword">JavaScript"> function RunFile() < WshShell = new ActiveXObject("WScript.Shell"); // below both work! // WshShell.Run("c:/windows/system32/notepad.exe", 1, false); WshShell.Run("notepad.exe", 1, false); // optional script window.close(); > // optional scripts function winsize() < window.moveTo(16,16); window.resizeTo(327, 140); > /script> /head> body onload code-keyword">winsize()"> center> br/> input type code-keyword">button" onclick code-keyword">RunFile();" value code-keyword">Click to Run Notepad and Close Window"/> /center> /body> /html>

HTML Applications do not run in the browser. They run as Windows applications (e.g. by double-clicking their name in Windows Explorer). Note also that even Windows 10 uses the IE7 engine for them; so CSS3, ES5 etc are not supported.

The code which you supplied works perfectly fine in IE.
But I beg to differ it doesn’t work in Chrome and/or Firefox. The reason being, this code is written using ActiveXobject which is totally a Microsoft proprietary. No doubt, we can have ActiveX plugins in both the latter browsers as well.

But, is there any solution which will allow me to do the same in any of the browsers without using any particular plugin?

html> head> title>Application Executer/title> HTA:APPLICATION ID code-keyword">oMyApp" APPLICATIONNAME code-keyword">Application Executer" BORDER code-keyword">no" CAPTION code-keyword">no" SHOWINTASKBAR code-keyword">yes" SINGLEINSTANCE code-keyword">yes" SYSMENU code-keyword">yes" SCROLL code-keyword">no" WINDOWSTATE code-keyword">normal"> script type code-keyword">text/javascript" language code-keyword">javascript"> function RunFile() < WshShell = new ActiveXObject("WScript.Shell"); WshShell.Run("C:\Windows\System32", 1,false); > /script> /head> body> input type code-keyword">button" value code-keyword">Run Notepad" onclick code-keyword">RunFile();"/> /body> /html>

But Notepad.exe is not launching. Please help. Thanks.

It appears that your path to the Notepad.exe was left out of the code . . .

I have tried this in a test html file, where my html file and .swf file both are in same system. It worked fine. But when i host my web application and try to launch the same file, it doesn’t work. It doesn’t give any error either.

Am i missing anything here?

In your page http://www.codeproject.com/Articles/113678/How-to-execute-a-Local-File-using-HTML-Application, what do «1» and «false» stand for in the following call to function?

WshShell.Run(«c:/windows/system32/notepad.exe», 1, false);

Also, are there more arguments that can be passed to this function?

If i try to run the next code throw an exception «The system cannot find the file specified»

shell.run(«C:/program files/Microsoft Silverlight/sllauncher.exe»);
or
shell.run(«C:\\program\ files\\Microsoft\ Silverlight\\sllauncher.exe»); // i add a «\» cause blank space

If you are using absolute path for the file, you must have to use the «file» protocol. In that case, your code will look like this:

shell.run("file://C:/program files/Microsoft Silverlight/sllauncher.exe");

Please Vote for the Articles and/or Posts that you like. Kunal Chowdhury (Microsoft MVP [Silverlight] | Follow My Blog | Follow Me @ Twitter)

Can you help me sir, with ur code i able to open all applications in c:/windows/ sucessfully but unable to open some application in c:/program files/.. even the firefox.exe or ieplorer.exe. i dunno why.. dis is my code:

WshShell = new ActiveXObject(«WScript.Shell»);

WshShell.Run(«c:/windows/system32/notepad.exe», 1, false);

Have a look into my article posted in my blog: http://www.kunal-chowdhury.com/2010/10/how-to-distribute-silverlight-oob.html[^]. I think you wanted to try the same thing here too.

Please Vote for the Articles and/or Posts that you like. Kunal Chowdhury (Microsoft MVP [Silverlight] | Follow My Blog | Follow Me @ Twitter)

This is not related to any browser. If you have .hta file registered with any browser (default is IE) will work fine.

Please Vote for the Articles and/or Posts that you like. Kunal Chowdhury (Microsoft MVP [Silverlight] | Follow My Blog | Follow Me @ Twitter)

Please Vote for the Articles and/or Posts that you like. Kunal Chowdhury (Microsoft MVP [Silverlight] | Follow My Blog | Follow Me @ Twitter)

Any specific reason? Because, for my case, I found it useful.

General News Suggestion Question Bug Answer Joke Praise Rant Admin

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Источник

Оцените статью