12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta name="description" content="">
- <title>modernizer | Casey DeLorme's Portfolio / caseydelorme.com</title>
- <link rel="icon" type="image/x-icon" href="https://d2xxklvztqk0jd.cloudfront.net/favicon.ico" />
- <link rel="stylesheet" type="text/css" href="/css/main.css#c5e63ca">
- </head>
- <body>
- <header class="group">
- <h1><a href='/'>Casey DeLorme</a></h1>
- <nav>
- <ul>
- <li><a href="/projects">Projects</a></li>
- <li><a href="/resume.html">Resume</a></li>
- </ul>
- </nav>
- </header>
- <div class="content group">
- <h3><a href="https://github.com/cdelorme/modernizer">modernizer</a></h3>
- <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>
- <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>
- <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>
- <p>While it isn’t a perfect solution for all use-cases, it works great and is damn small (less than 200 lines of code).</p>
- <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>
- <p><strong><em>written on 2017-04-13</em></strong></p>
- </div>
- <footer class="group">
- <a href='https://www.facebook.com/CaseyRDeLorme' class='link facebook'></a>
- <a href='https://www.linkedin.com/in/cdelorme' class='link linkedin'></a>
- <a href='https://www.youtube.com/user/LordOfElm' class='link youtube'></a>
- <a href='https://github.com/cdelorme' class='link github'></a>
- <a href='skype:casey.delorme?chat' class='link skype'></a>
- <div class="scripts">
- <script type="text/javascript" src="/js/main.js#c5e63ca" async></script>
- </div>
- </footer>
- </body>
- </html>
|