Is it possible to offer a ClickOnce installer on Github?

你。 提交于 2019-11-29 22:38:33

Yes you can.

And actually I think it's a more convenient way comparing to FTP.

  1. Make sure your Git is set to "commit as-is", so that you can avoid some signature issues.
  2. Publish your ClickOnce application to a directory in your git repository (you may want another branch for that) with the url of raw on Github as the download/update url. E.g. for repository "xxx", branch "master", directory "clickonce" of user "vilic", the url should be "https://raw.github.com/vilic/xxx/master/clickonce/"
  3. Commit and push your application.

BTW, you will be able to download exe file and the application is able to check and download update as you are directly using raw.github.com. However, you may not open the xml file from your browser because the MIME type of xml file would be "text/plain". But I think you can try to use Github Pages to build this server, which should response with the right MIME type.

When I set out trying to do this, this question with @VILIC's answer was one of the things that helped. Here is my blog post detailing how ClickOnce to GitHub pages has been automated -

http://flickrdownloadr.com/blogs/blog/2013/01/15/single-click-deployment-of-wpf-application-to-github-pages/

All of these didn't work for me: rawgithub.com, raw.github.com, raw.githubusercontent.com.

RawGit did work, because it serves the proper application/x-ms-application Content-Type header.

Example:

https://cdn.rawgit.com/Microsoft/RESX-Unused-Finder/master/publish/ResxUnusedFinder.application

Also followed this guide and added a .gitattributes file:

*.manifest binary
*.application binary
*.deploy binary

Most things served from raw.github.com have a text/plain content type and are served with an X-Content-Type-Options: nosniff header.

You can change your url to rawgithub.com from raw.github.com, which solves the problem in VILIC VANE's answer.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!