winsparkle
winsparkle copied to clipboard
Use without installer?
Is there a way to use this to simply replace a portable exe without an installer?
Not currently. PRs welcome.
[Deleted a series of factually wrong and increasingly off-topic comments.]
I am interested in this feature. Any pointers how to implement this feature? I can see if I can help (not a Windows developer though).
It would be relatively straightforward to do this on Windows. The key is that, while you cannot delete a running executable, you can easily rename it.
So, once an update is initiated, the workflow would be:
- Have WinSparkle rename the currently-running EXE by appending ".bak" to its name (or whatever).
- Have WinSparkle download the new (updated) EXE, storing it in the same folder as the currently-running EXE with the original name of the currently-running EXE (i.e., without the ".bak" suffix).
The currently-running application won't be updated live---the user will need to close the application and re-open it. (WinSparkle could theoretically force the application to close after it completed downloading the new EXE, but this seems needlessly invasive.) But when the user does go to re-open the application, because the updated EXE has been put in the place of the original EXE, the process will be seamless to them.
For completeness, code should be added to WinSparkle that checks for any ".bak" files in the application folder and removes them. These are vestiges of the previous update process, and should no longer be required. (Bonus: A copy of the old application binary is kept until the updated application binary successfully starts up.)
cc @bvgastel , in case you're still interested in implementing this feature. Armed with this information, you should not need any particular Windows-programming expertise. All you need to know how to do is how to rename and delete files.
The key is that, while you cannot delete a running executable, you can easily rename it.
Yep, that's crucial. Assuming the same applies to DLLs and WinSparkle.dll
can be renamed while loaded, then in-place patching is relatively straightforward too.