{"id":546,"date":"2018-03-13T13:22:17","date_gmt":"2018-03-13T05:22:17","guid":{"rendered":"https:\/\/blog.freesilo.com\/?p=546"},"modified":"2018-03-13T13:22:17","modified_gmt":"2018-03-13T05:22:17","slug":"nsis%e5%ae%89%e8%a3%85%e7%a8%8b%e5%ba%8f%e5%88%b6%e4%bd%9c%e5%b7%a5%e5%85%b7%e5%88%a4%e6%96%ad%e7%b3%bb%e7%bb%9f%e6%98%af%e5%90%a6%e5%ae%89%e8%a3%85-net","status":"publish","type":"post","link":"https:\/\/freesilo.com\/?p=546","title":{"rendered":"NSIS\u5b89\u88c5\u7a0b\u5e8f\u5236\u4f5c\u5de5\u5177\u5224\u65ad\u7cfb\u7edf\u662f\u5426\u5b89\u88c5.NET"},"content":{"rendered":"<p>\u524d\u6bb5\u65f6\u95f4\u5fd9\u4e86\u5f88\u4e45\u7684\u7cfb\u7edf\u603b\u7b97\u4e0a\u7ebf\u4e86\uff0c\u7531\u4e8e\u662fWinForm\u7a0b\u5e8f\u4e0d\u80fd\u6574\u4e2a\u6587\u4ef6\u5939\u7684\u53d1\u7ed9\u5ba2\u6237\u4f7f\u7528\u3002\u6240\u4ee5\u5fc5\u987b\u8981\u6253\u5305\uff0c\u8bb0\u5f97\u4ee5\u524d\u5728VS2005\u4e2d\u662f\u81ea\u5e26\u90e8\u7f72\u529f\u80fd\u7684\u3002\u73b0\u5728\u6362\u4e86VS2013\u90a3\u4e2a\u90e8\u7f72\u529f\u80fd\u5b8c\u5168\u5f04\u4e0d\u6e05\u65b9\u5411\u3002\u6700\u540e\u5728\u7f51\u4e0a\u627e\u4e86NSIS\u8fd9\u4e2a\u5f00\u6e90\u7684\u5b89\u88c5\u7a0b\u5e8f\u5236\u4f5c\u5de5\u5177\u3002\u7ffb\u770b\u4e86\u4e00\u4e0b\u5b83\u7684\u8bf4\u660e\uff0c\u548c\u7f51\u4e0a\u7684\u4e00\u4e9b\u6559\u7a0b\u3002\u6700\u540e\u6253\u5305\u51fa\u4e86\u4e00\u4e2a\u4e2a\u4eba\u8ba4\u4e3a\u8fd8\u6bd4\u8f83\u53ef\u4ee5\u7684\u5b89\u88c5\u7a0b\u5e8f\u3002\u5176\u4e2d\u4e3b\u8981\u9047\u5230\u7684\u4e24\u4e2a\u95ee\u9898\uff1a<\/p>\n<ol>\n<li>\u5224\u65ad\u64cd\u4f5c\u7cfb\u7edf\u662f\u5426\u5b89\u88c5.NET<\/li>\n<li>\u7ed9\u5b89\u88c5\u754c\u9762\u914d\u4e0a\u53cb\u597d\u7684\u76ae\u80a4<\/li>\n<\/ol>\n<p>\u7531\u4e8e\u6211\u7684\u7a0b\u5e8f\u662f\u7528C#\u5199\u7684\uff0c\u6240\u4ee5\u5fc5\u9700\u8981\u5224\u65ad\u5ba2\u6237\u673a\u5668\u4e0a\u9762\u662f\u5426\u5b89\u88c5\u4e86.NET\u6846\u67b6\u3002\u4f7f\u7528NSIS\u89e3\u51b3\u5982\u4e0b\uff1a<br \/>\n\u5728\u4ee3\u7801\u4e2d\u52a0\u4e0a\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n#-- \u5224\u65ad.NET4.0\u662f\u5426\u5b89\u88c5 --#\r\nFunction CheckFramework4\r\n ;Clinet \u548c Full\u5b58\u5728\u4e00\u4e2a\u90fd\u8bf4\u660e\u5b89\u88c5\u4e86Framework\r\n ClearErrors\r\n ReadRegDWORD $0 HKLM &quot;SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\Client&quot; &quot;Install2&quot;\r\n\r\n\r\n IfErrors 0 ExitCheckFramework4\r\n  ClearErrors\r\n  ReadRegDWORD $0 HKLM &quot;SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full&quot; &quot;Install&quot;\r\n IfErrors 0 ExitCheckFramework4\r\n    ;\u6ca1\u6709\u5b89\u88c5Framework\r\n    MessageBox MB_OK &quot;\u88c5\u7a0b\u5e8f\u65e0\u6cd5\u68c0\u6d4b\u5230.NET Framework V4.0 $\\n&quot;\r\n    Abort\r\n\r\n\r\n ExitCheckFramework4:\r\nFunctionEnd\r\n<\/pre>\n<p>\u518d\u5728.onInit\u51fd\u6570\u7b2c\u4e00\u53e5\u91cc\u9762\u52a0\u4e0a\uff1a<strong>\u201cCall CheckFramework4\u201d<\/strong><br \/>\nOK\uff0c\u5f53\u4f60\u53d1\u7ed9\u5ba2\u6237\u5b89\u88c5\u65f6\u5982\u679c\u5ba2\u6237\u6ca1\u6709\u5b89\u88c5.net4.0\u90a3\u4e48\u5c31\u4f1a\u63d0\u793a\u51fa\u8be5\u6d88\u606f\u6846\u3002\u5176\u5b9e\u8fd9\u91cc\u8fd8\u53ef\u4ee5\u628a.net\u4e5f\u6253\u5305\u8fdb\u53bb\uff0c\u4f46\u662f\u90a3\u6837\u4e5f\u6bd4\u8f83\u9ebb\u70e6\u3002\u4f1a\u5bfc\u81f4\u5b89\u88c5\u5305\u6bd4\u8f83\u5927\u3002\u6240\u4ee5\u6211\u91c7\u53d6\u7684\u662f\u8054\u7cfb\u6211\u4eec\u4eba\u5de5\u5b89\u88c5\u3002<\/p>\n<p>\u539f\u6587\uff1ahttp:\/\/www.fangsi.net\/809.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u6bb5\u65f6\u95f4\u5fd9\u4e86\u5f88\u4e45\u7684\u7cfb\u7edf\u603b\u7b97\u4e0a\u7ebf\u4e86\uff0c\u7531\u4e8e\u662fWinForm\u7a0b\u5e8f\u4e0d\u80fd\u6574\u4e2a\u6587\u4ef6\u5939\u7684\u53d1\u7ed9\u5ba2&#8230;<br \/><a class=\"read-more-button\" href=\"https:\/\/freesilo.com\/?p=546\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-546","post","type-post","status-publish","format-standard","hentry","category-dotnet"],"_links":{"self":[{"href":"https:\/\/freesilo.com\/index.php?rest_route=\/wp\/v2\/posts\/546","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/freesilo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/freesilo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/freesilo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/freesilo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=546"}],"version-history":[{"count":3,"href":"https:\/\/freesilo.com\/index.php?rest_route=\/wp\/v2\/posts\/546\/revisions"}],"predecessor-version":[{"id":595,"href":"https:\/\/freesilo.com\/index.php?rest_route=\/wp\/v2\/posts\/546\/revisions\/595"}],"wp:attachment":[{"href":"https:\/\/freesilo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/freesilo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/freesilo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}