BetterDiscord / BetterDiscord/Installer

Find a method to atomically rename/overwrite files on Windows

Open
#430 2 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
1.8k
Forks
201
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
Relevant to #426

Currently due to what I believe to be nuances in the way Windows handles renames, Golang's `os.Rename` causes the install action to fail if BetterDiscord is already installed and Discord is running.

**Describe the solution you'd like**
Above may pay grade to make a suggestion, just thinking about it is confusing.

**Describe alternatives you've considered**
I've verified that using `os.WriteFile` doesn't encounter the same issues. I believe that's why it wasn't a problem with the Electron version of the installer, but I'm not sure that's an ideal solution. Zere has an idea of what he'd prefer to do.

**Additional context**
[This is the closest I got to finding an explanation of why this issue is specific to Windows](https://stackoverflow.com/a/2368286)

Contributor guide

Open the contributing guide

Research direction

Start by tracing the Go install action that calls os.Rename and reproduce the failure on Windows while Discord is running. Compare the behavior with os.WriteFile and the linked Windows rename explanation; done means an already-installed BetterDiscord can be overwritten successfully in that situation.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.