<p>When I build my Golang app using <a href="https://github.com/karalabe/xgo">xgo</a> on a Ubuntu host I can get a Windows binary. When I run this binary in Windows, though, Windows <a href="https://imgur.com/78RdsoV">shows a blue window</a> saying it has "prevented an unrecognized app from starting." <strong>Is there a way to sign a Golang-built Windows app so that Windows will recognize the publisher and<br/>
suppress <a href="https://imgur.com/78RdsoV">this warning</a>?</strong></p>
<p>I realize that you can just click "Run Anyway" to run the app, but I'm sure the occurrence of this message is enough to influence people to not use the program. If suppressing this ad requires signing up for Windows Store or something, I'm happy to do it - I just don't know where to begin. </p>
<hr/>**评论:**<br/><br/>1lann: <pre><p>I haven't done it myself, but this is the first result on Google: <a href="https://stackoverflow.com/questions/252226/signing-a-windows-exe-file">https://stackoverflow.com/questions/252226/signing-a-windows-exe-file</a></p></pre>qrv3w: <pre><p>Thanks, I had trouble finding this with Google :) </p>
<p>I will give the Windows SignTool a try.</p></pre>JHunz: <pre><p>You will need an actual Authenticode code-signing certificate to suppress the warning for end users, by the way. Test signing and self signing can be set up to bypass smartscreen on your local machine but you will need an actual cert for end users</p></pre>Creshal: <pre><p>Signtool works, I'm using it with our go programs. </p>
<p>Still need a code-signing cert, though.</p></pre>nathanpaulyoung: <pre><p>Are there free cert providers, or is it just Verisign basically?</p></pre>PaluMacil: <pre><p>I have been frustrated before at the expense of it, but after thinking about how they really are verifying that you are a company you say you are, it probably can't be cheap or free. In the case of letsencrypt, the main objective is encryption / proving that you're talking to the same server you asked to talk to. Software is a bit different, more comparable to extended validation.</p></pre>mkishere: <pre><p>Just a little bit offtopic, what is the advantage of using xgo instead of the official way of cross compiling? i.e. GOOS=windows go build ?</p></pre>qrv3w: <pre><p>In my case I'm using it to cross-compile something that uses a lot of CGO libraries (e.g. <a href="https://github.com/mattn/go-sqlite3" rel="nofollow">go-sqlite3</a>). Since I'm using linux as a host, building a OS X app that uses <code>go-sqlite3</code> requires me to get an Apple Developer account, get the right version of Xtools, and then build the OS X SDK to build the sqlite3-compatible o64-clang compiler with <code>osxcross</code>. Windows is a similar headache.</p>
<p><code>xgo</code> is really cool in this respect because it leverages a docker container which already has all these compilers bulit-in and uses them automatically.</p></pre>JackOhBlades: <pre><p>It builds for all platforms and architectures in parallel. </p></pre>akerro: <pre><p>I didn't see this warning in Syncthing last time I used it on Windows7</p></pre>jammerlt: <pre><p>Because syncthing bought the certificate and signs the binary.</p></pre>: <pre><p>[removed]</p></pre>garlicbot: <pre><p><a href="https://i.imgur.com/dYGNvmR.jpg" title="Reddit Garlic" rel="nofollow"><strong>Here's your Reddit Garlic, qrv3w!</strong></a> </p>
<p><a href="/u/qrv3w" rel="nofollow">/u/qrv3w</a> has received garlic 1 time. (given by <a href="/u/pythonETH" rel="nofollow">/u/pythonETH</a>) </p>
<p><sup>I'm</sup> <sup><sup>a</sup></sup> <sup><sup><sup>bot</sup></sup></sup> <sup><sup><sup><sup>for</sup></sup></sup></sup> <sup><sup><sup><sup>questions</sup></sup></sup></sup> <sup><sup><sup><sup><sup>contact</sup></sup></sup></sup></sup> <sup><sup><sup><sup><sup><a href="/u/flying_wotsit" rel="nofollow">/u/flying_wotsit</a></sup></sup></sup></sup></sup></p></pre>
Is there a way to build a Golang Windows program that allows it to be recognized from a known publisher?
xuanbao · · 535 次点击这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传