# Keep the Windows updater inside its folders and its listed sizes · dara/icarus

[View on GitCafe](https://git.cafe/dara/icarus/commit/6d53fdbf2200039154005b2d8146305611e334b6)

Repository: [dara/icarus](https://git.cafe/dara/icarus)

Visibility: public

Requested revision: 6d53fdbf2200039154005b2d8146305611e334b6

Requested commit: 6d53fdbf2200039154005b2d8146305611e334b6

Commit: 6d53fdbf2200039154005b2d8146305611e334b6

Tree: ac7f5ccadf98bf0f68f907000042732d0b38f473

Author: Dara Adedeji

Committer: Dara Adedeji

## Message

```
Keep the Windows updater inside its folders and its listed sizes

The direct-install updater trusted every path in hashes.json, so a path
like ..\..\x was downloaded to a file outside the install folder. It
also read each download to the end before checking its length, and the
restart script's log helper could throw before anything was copied,
leaving the user with an app that closed and never came back.

- Refuse any listed path with .., a drive, a rooted or network prefix,
  an empty name, or a name Windows would trim (trailing dot or space).
  The controller and the restart service now share one splitRelativePath.
- Stop reading a download as soon as it passes its listed length and
  fail it like a length mismatch.
- Write-Log swallows its own errors, so an unwritable log no longer
  stops the copy and relaunch. Real failures still end the script.

```

## Parents

- [c2ddf79d7f5d83519e098e151021acdf34a9c04b](https://git.cafe/dara/icarus/commit/c2ddf79d7f5d83519e098e151021acdf34a9c04b?format=markdown)

[Source at this commit](https://git.cafe/dara/icarus/tree/6d53fdbf2200039154005b2d8146305611e334b6?format=markdown)
