Skip to content

Conversation

@coolreader18
Copy link
Collaborator

Description of Changes

Windows doesn't let you overwrite an exe file that's currently running. Thankfully, the self-update crate has an implementation for this.

Expected complexity level and risk

1: can't get more broken that it already is! and we're just using someone else's code :)

Testing

  • Need to test on windows.

@jdetter jdetter self-requested a review February 21, 2025 21:22
Copy link
Collaborator

@jdetter jdetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe this worked when I tried it, I got the following error:

PS C:\Users\Boppy> spacetime version upgrade
  Installing v1.0.0: done!
Error: Cannot create a file when that file already exists. (os error 183)

Also there's another error here. If I run the install script twice I get the following error:

PS C:\Users\Boppy> iwr http://spacetimedb-test/spacetime-install.ps1 -useb | iex
Downloading installer...
Our EULA for spacetimedb-cli can be found here: <https://spacetimedb.com/eula>
Agree to the EULA? yes
The SpacetimeDB command line tool will now be installed into C:\Users\Boppy\AppData\Local\SpacetimeDB
Would you like to continue? yes
Downloading latest version...
  Installing v1.0.0: done!
Error: failed to download and install latest SpacetimeDB version: Cannot create a file when that file already exists. (os error 183)

The `spacetime` command has been installed as C:\Users\Boppy\AppData\Local\SpacetimeDB\spacetime.exe
Note: we recommend making sure that this executable is in your PATH variable.

The install process is complete; check out our quickstart guide to get started!
        <https://spacetimedb.com/docs/quick-start>
We have added spacetimedb to your Path. You may have to logout and log back in to reload your environment.

Copy link
Collaborator

@jdetter jdetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this with windows against a local server (not against the Github releases). I'll test this again when we go live with the release so we can make sure the update flow is working correctly against Github.

@coolreader18 coolreader18 added this pull request to the merge queue Feb 26, 2025
Merged via the queue into master with commit b8ebe42 Feb 26, 2025
13 of 14 checks passed
@coolreader18 coolreader18 deleted the windows-self-replace branch February 26, 2025 18:07
@jdetter jdetter restored the windows-self-replace branch February 28, 2025 02:44
@jdetter jdetter deleted the windows-self-replace branch February 28, 2025 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants