Desktop: Remove unnecessarily generic OS-specific code and fix file editing on Windows.