modernizer.html 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <meta name="description" content="">
  8. <title>modernizer | Casey DeLorme's Portfolio / caseydelorme.com</title>
  9. <link rel="icon" type="image/x-icon" href="https://d2xxklvztqk0jd.cloudfront.net/favicon.ico" />
  10. <link rel="stylesheet" type="text/css" href="/css/main.css#c5e63ca">
  11. </head>
  12. <body>
  13. <header class="group">
  14. <h1><a href='/'>Casey DeLorme</a></h1>
  15. <nav>
  16. <ul>
  17. <li><a href="/projects">Projects</a></li>
  18. <li><a href="/resume.html">Resume</a></li>
  19. </ul>
  20. </nav>
  21. </header>
  22. <div class="content group">
  23. <h3><a href="https://github.com/cdelorme/modernizer">modernizer</a></h3>
  24. <p>I only found one alternative, and they put a ton of effort into supporting binary delta updates, which I think are a waste of time and code.</p>
  25. <p>As usual, I decided to write my own. In roughly a weekend I was able to create a tool that downloads a version file, compares versions, downloads and replaces the binary in a cross-platform compatible way, and launches the new executable while retaining the default file descriptors.</p>
  26. <p>Windows has two minor glitches that required a bit of extra cleanup work. First it does not offer <code>Exec</code>, so the process id changes, but it somehow inherits the same streams (stdin/stdout/stderr all continue to work correctly). Second in order to eliminate the previous binary a rename and cleanup process is required since windows locks the binary file during execution (<em>I assume due to mmap calls?</em>).</p>
  27. <p>While it isn&rsquo;t a perfect solution for all use-cases, it works great and is damn small (less than 200 lines of code).</p>
  28. <p>For complex situations where you need to cleanup the existing runtime, or want to carry over an open network connection (eg. keep a service active) then you probably want something more complex and tailor-made.</p>
  29. <p><strong><em>written on 2017-04-13</em></strong></p>
  30. </div>
  31. <footer class="group">
  32. <a href='https://www.facebook.com/CaseyRDeLorme' class='link facebook'></a>
  33. <a href='https://www.linkedin.com/in/cdelorme' class='link linkedin'></a>
  34. <a href='https://www.youtube.com/user/LordOfElm' class='link youtube'></a>
  35. <a href='https://github.com/cdelorme' class='link github'></a>
  36. <a href='skype:casey.delorme?chat' class='link skype'></a>
  37. <div class="scripts">
  38. <script type="text/javascript" src="/js/main.js#c5e63ca" async></script>
  39. </div>
  40. </footer>
  41. </body>
  42. </html>