{"id":2720,"date":"2023-08-11T15:47:31","date_gmt":"2023-08-11T07:47:31","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=2720"},"modified":"2023-08-11T15:47:31","modified_gmt":"2023-08-11T07:47:31","slug":"html%e5%a6%82%e4%bd%95%e6%89%93%e5%8c%85exe","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/2720\/","title":{"rendered":"html\u5982\u4f55\u6253\u5305exe?"},"content":{"rendered":"

HTML\u662f\u4e00\u79cd\u7528\u4e8e\u521b\u5efa\u7f51\u9875\u7684\u6807\u8bb0\u8bed\u8a00\uff0c\u800cEXE\u662f\u4e00\u79cd\u53ef\u6267\u884c\u6587\u4ef6\u683c\u5f0f\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u5c06HTML\u6253\u5305\u6210EXE\u7684\u9700\u6c42\u4e3b\u8981\u662f\u4e3a\u4e86\u65b9\u4fbf\u7528\u6237\u8bbf\u95ee\u548c\u4f7f\u7528\uff0c\u540c\u65f6\u4e5f\u53ef\u4ee5\u4fdd\u62a4HTML\u4ee3\u7801\u4e0d\u88ab\u6076\u610f\u4fee\u6539\u548c\u76d7\u7528\u3002<\/p>\n

\u90a3\u4e48\uff0c\u5982\u4f55\u5c06HTML\u6253\u5305\u6210EXE\u5462\uff1f\u4e0b\u9762\u662f\u4e00\u4e9b\u53ef\u4f9b\u53c2\u8003\u7684\u65b9\u6cd5\u548c\u539f\u7406\u4ecb\u7ecd\u3002<\/p>\n

\u4e00\u3001\u4f7f\u7528\u4e13\u4e1a\u6253\u5305\u8f6f\u4ef6<\/p>\n

\u76ee\u524d\u5e02\u9762\u4e0a\u6709\u8bb8\u591a\u4e13\u4e1a\u7684HTML\u6253\u5305\u8f6f\u4ef6\uff0c\u4f8b\u5982ExeOutput for PHP\u3001HTML Compiler\u7b49\u7b49\u3002\u8fd9\u4e9b\u8f6f\u4ef6\u53ef\u4ee5\u5c06HTML\u3001CSS\u3001JavaScript\u7b49\u6587\u4ef6\u6253\u5305\u6210\u5355\u72ec\u7684EXE\u6587\u4ef6\uff0c\u540c\u65f6\u8fd8\u53ef\u4ee5\u81ea\u5b9a\u4e49\u542f\u52a8\u754c\u9762\u3001\u6dfb\u52a0<\/p>\n

<\/figure>\n<\/p>\n

\u56fe\u6807\u3001\u8bbe\u7f6e\u6587\u4ef6\u6743\u9650\u7b49\u7b49\u3002\u4f7f\u7528\u8fd9\u4e9b\u8f6f\u4ef6\u6253\u5305HTML\u7684\u597d\u5904\u662f\u64cd\u4f5c\u7b80\u5355\u3001\u6548\u679c\u597d\u3001\u529f\u80fd\u5f3a\u5927\uff0c\u4f46\u9700\u8981\u4ed8\u8d39\u8d2d\u4e70\u3002<\/p>\n

\u4e8c\u3001\u4f7f\u7528BAT\u811a\u672c<\/p>\n

BAT\u811a\u672c\u662f\u4e00\u79cd\u7b80\u5355\u6613\u7528\u7684\u6279\u5904\u7406\u811a\u672c\u8bed\u8a00\uff0c\u53ef\u4ee5\u901a\u8fc7\u7f16\u5199\u811a\u672c\u5c06\u591a\u4e2a\u6587\u4ef6\u6253\u5305\u6210\u4e00\u4e2aEXE\u6587\u4ef6\u3002\u5177\u4f53\u5b9e\u73b0\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n

1. \u65b0\u5efa\u4e00\u4e2a\u6587\u672c\u6587\u4ef6\uff0c\u5c06\u4ee5\u4e0b\u4ee3\u7801\u590d\u5236\u5230\u6587\u4ef6\u4e2d\uff1a<\/p>\n

“`<\/p>\n

@echo off<\/p>\n

copy \/b your_html_file.html+your_css_file.css+your_js_file.js your_exe_file.exe<\/p>\n

“`<\/p>\n

2. \u5c06\u4e0a\u8ff0\u4ee3\u7801\u4e2d\u7684your_html_file.html\u3001your_css_file.css\u548cyour_js_file.js\u66ff\u6362\u4e3a\u4f60\u8981\u6253\u5305\u7684HTML\u3001CSS\u548cJavaScript\u6587\u4ef6\u540d\uff0c\u5c06your_exe_file.exe\u66ff\u6362\u4e3a\u4f60\u60f3\u8981\u751f\u6210\u7684EXE\u6587\u4ef6\u540d\u3002<\/p>\n

3. \u5c06\u4fdd\u5b58\u597d\u7684\u6587\u672c\u6587\u4ef6\u4fee\u6539\u540e\u7f00\u540d\u4e3a.bat\uff0c\u53cc\u51fb\u8fd0\u884c\uff0c\u5373\u53ef\u751f\u6210EXE\u6587\u4ef6\u3002<\/p>\n

\u4f7f\u7528BAT\u811a\u672c\u6253\u5305HTML\u7684\u597d\u5904\u662f\u7b80\u5355\u6613\u7528\uff0c\u65e0\u9700\u5b89\u88c5\u5176\u4ed6\u8f6f\u4ef6\uff0c\u4f46\u6253\u5305\u540e\u7684EXE\u6587\u4ef6\u53ef\u80fd\u5b58\u5728\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u4e14\u65e0\u6cd5\u6dfb\u52a0\u542f\u52a8\u754c\u9762\u548c\u56fe\u6807\u7b49\u529f\u80fd\u3002<\/p>\n

\u4e09\u3001\u4f7f\u7528NSIS\u811a\u672c<\/p>\n

NSIS\uff08Nullsoft Scriptable Install System\uff09\u662f\u4e00\u6b3e\u514d\u8d39\u7684\u5b89\u88c5\u7a0b\u5e8f\u751f\u6210\u5de5\u5177\uff0c\u53ef\u4ee5\u7528\u6765\u6253\u5305\u591a\u4e2a\u6587\u4ef6\u6210\u4e3a\u4e00\u4e2a\u5b89\u88c5\u7a0b\u5e8f\u3002\u867d\u7136NSIS\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u5b89\u88c5\u7a0b\u5e8f\uff0c\u4f46\u4e5f\u53ef\u4ee5\u7528\u6765\u5c06HTML\u6253\u5305\u6210EXE\u3002<\/p>\n

\u5177\u4f53\u5b9e\u73b0\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n

1. \u4e0b\u8f7d\u5e76\u5b89\u88c5NSIS\u8f6f\u4ef6\u3002<\/p>\n

2. \u65b0\u5efa\u4e00\u4e2a\u6587\u672c\u6587\u4ef6\uff0c\u5c06\u4ee5\u4e0b\u4ee3\u7801\u590d\u5236\u5230\u6587\u4ef6\u4e2d\uff1a<\/p>\n

“`<\/p>\n

OutFile “your_exe_file.exe”<\/p>\n

RequestExecutionLevel user<\/p>\n

Section “Main”<\/p>\n

Se\u5c01\u88c5\u7cfb\u7edf\u9884\u88c5\u8f6f\u4ef6<\/a>tOutPath $TEMP<\/p>\n

File “your_html_file.html”<\/p>\n

File “your_css_file.css”<\/p>\n

File “your_js_file.js”<\/p>\n

ExecShell “” “$TEMP\\your_html_file.html”<\/p>\n

SectionEnd<\/p>\n

“`<\/p>\n

3. \u5c06\u4e0a\u8ff0\u4ee3\u7801\u4e2d\u7684your_html_exe\u8f6f\u4ef6\u5236\u9020\u5668<\/a>file.html\u3001your_css_file.css\u548cyour_js_file.js\u66ff\u6362\u4e3a\u4f60\u8981\u6253\u5305\u7684HTML\u3001CSS\u548cJavaScript\u6587\u4ef6\u540d\uff0c\u5c06your_exe_file.exe\u66ff\u6362\u4e3a\u4f60\u60f3\u8981\u751f\u6210\u7684EXE\u6587\u4ef6\u540d\u3002<\/p>\n

4. \u5c06\u4fdd\u5b58\u597d\u7684\u6587\u672c\u6587\u4ef6\u4fee\u6539\u540e\u7f00\u540d\u4e3a.nsi\uff0c\u53cc\u51fb\u8fd0\u884c\uff0c\u5373\u53ef\u751f\u6210EXE\u6587\u4ef6\u3002<\/p>\n

\u4f7f\u7528NSIS\u811a\u672c\u6253\u5305HTML\u7684\u597d\u5904\u662f\u529f\u80fd\u5f3a\u5927\uff0c\u53ef\u4ee5\u81ea\u5b9a\u4e49\u5b89\u88c5\u754c\u9762\u3001\u6dfb\u52a0\u542f\u52a8\u56fe\u6807\u7b49\u529f\u80fd\uff0c\u4f46\u9700\u8981\u5b66\u4e60NSIS\u811a\u672c\u8bed\u8a00\uff0c\u5e76\u4e14\u751f\u6210\u7684EXE\u6587\u4ef6\u53ef\u80fd\u5b58\u5728\u517c\u5bb9\u6027\u95ee\u9898\u3002<\/p>\n

\u603b\u7ed3<\/p>\n

\u4ee5\u4e0a\u662f\u5c06HTML\u6253\u5305\u6210EXE\u7684\u4e09\u79cd\u5e38\u89c1\u65b9\u6cd5\uff0c\u6bcf\u79cd\u65b9\u6cd5\u90fd\u6709\u5176\u4f18\u7f3a\u70b9\uff0c\u9700\u8981\u6839\u636e\u5b9e\u9645\u9700\u6c42\u9009\u62e9\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5c06HTML\u6253\u5305\u6210EXE\u540e\uff0c\u53ef\u80fd\u4f1a\u589e\u52a0\u6587\u4ef6\u5927\u5c0f\u3001\u964d\u4f4e\u8fd0\u884c\u901f\u5ea6\uff0c\u540c\u65f6\u4e5f\u9700\u8981\u8003\u8651\u7248\u6743\u548c\u5b89\u5168\u7b49\u95ee\u9898\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

HTML\u662f\u4e00\u79cd\u7528\u4e8e\u521b\u5efa\u7f51\u9875\u7684\u6807\u8bb0\u8bed\u8a00\uff0c\u800cEXE\u662f\u4e00\u79cd\u53ef\u6267\u884c\u6587\u4ef6\u683c\u5f0f\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u5c06HTML\u6253\u5305\u6210EXE\u7684\u9700\u6c42\u4e3b\u8981\u662f\u4e3a\u4e86\u65b9\u4fbf\u7528\u6237\u8bbf\u95ee\u548c\u4f7f\u7528\uff0c\u540c\u65f6\u4e5f\u53ef\u4ee5\u4fdd\u62a4HTML\u4ee3\u7801\u4e0d\u88ab\u6076\u610f\u4fee\u6539\u548c\u76d7\u7528\u3002\u90a3\u4e48\uff0c\u5982\u4f55\u5c06H<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[3537,16,291,5608,408],"topic":[],"class_list":["post-2720","post","type-post","status-publish","format-standard","hentry","category-exekf","tag-pc","tag-16","tag-291","tag-exe","tag-408"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/2720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=2720"}],"version-history":[{"count":0,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/2720\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=2720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=2720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=2720"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=2720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}