Commit Graph
3 Commits
Author SHA1 Message Date
Lam Wei Lun e6035ca8ed Fix the updater's update flows and the records they exchange
A failed check wiped a candidate whose artifact was already verified, a
prefetch that could not start left the user with no way to skip, and
refusing an install closed the notification and the poll, so the update
disappeared until the next start. Keep the candidate on a failed check,
offer the dialog for a flavour that installs from the browser, and let a
refused install leave the notification and the poll in place.

The prefetch and the install helper shared one handoff file, so either
could consume or delete the other's job; the pending record was shared
between installs. Key both per install and per job, and leave the log to
accumulate across runs instead of truncating it at every start.

The helper held the install lock while it started the new build, whose
own startup could not then settle the records. Release it before the
launch. A launch that failed after a good install no longer rolls the
install back or deletes its record, a cancel before the swap reports a
cancel rather than a failure, and closing the completed helper window no
longer frees the widgets under the queued completion.

Cap the download at the size the release announces, so a redirected body
cannot fill the disk before the digest check.

A stale digest from a downgraded build hid every newer release; trust it
only while the release is not newer, except on Nightly, whose version is
its release timestamp. A JSON integer above INT64_MAX no longer throws.

Check the fresh-install rename instead of the resulting folder, which an
existing executable satisfies; pass the signing shell and script as
separate defines so a path with spaces survives; fall back to the
CMakeCache pin when the signing stamp is compared without the ORCA_
variables set.
2026-11-22 15:07:39 +08:00
Lam Wei Lun 8e08654505 Fix the updater review findings
Installing an update while the automatic prefetch was still writing the same
.part resumed it in a second process, so the digest failed, and Windows could
not even extract the helper. The manual path now waits for a download this run
started, a complete .part is taken as done, and a helper folder that is busy is
reused instead of deleted.

A release build could ship without the publisher or team id it pins, and the
helper would then accept anything the OS trusts. Configure fails for a release
build without the pin its platform needs, and the macOS package compares what
the helper was built with against the pins it ships under.

The Windows installer deleted the old tree before it wrote the new one, so a
failure left no application and no way to report it. It stages the whole tree
beside the target, verifies it, and swaps it in, reporting 1 for a missing
token, 2 for nothing written and 3 for a tree removed but not replaced. Before
handing a tree to an elevated installer the helper requires that it resolve to
the recorded path, carry no reparse point, and hold an uninstaller signed by the
pinned publisher.

The installed channel is keyed by install root like the digest, and a build
installed by hand infers its channel from its version, so a channel switch no
longer needs a previous in-app install. An inferred switch never takes a
candidate that sorts lower: a hand-installed 2.6.0-rc1 is no longer replaced by
an older stable at quit with nothing shown.

Downloads, the extracted helper and the handoff are per install, so two copies
sharing one cache stop deleting each other's artifact and overwriting each
other's job. A download whose bytes are wrong is dropped; one that cannot be read
is set aside rather than failing every start.

A declined dialog disarms the quit-time install, a check that finds nothing
clears the candidate, and flavours that cannot install in place are told about a
release instead of being ignored. A macOS swap exchanges the bundle in one step
where the filesystem allows it, and a cleanup this user cannot perform is logged
instead of retried forever.
2026-11-15 01:21:30 +08:00
Lam Wei Lun d9692bcf30 Install updates without a dialog, from a per-user installer
The background check no longer opens the update dialog. What to do with a
candidate is a pure decision now (update_action), so it can be tested: an
automatic check prefetches, a check the user started keeps its dialog and
installs at once, and a skipped version stays quiet unless the user asked.

The helper downloads while the application runs and exits; a second run at
quit installs from the verified file. Prefetch therefore takes no lock and
installs nothing, so it cannot race the run that follows it, and the install
that runs after a quit does not start the application again. A failure leaves
update_failed.txt, which the next start shows as a notification: an update
that asks nothing has no other way to report itself. The artifact a prefetch
left behind is now kept by prepare_download_dir instead of being swept and
downloaded again.

The Windows installer is no longer CPack's. CPack hardcodes
RequestExecutionLevel admin and installs to Program Files, so every update
needed a UAC prompt. packaging/windows/orca-slicer.nsi requests the user's
own level and picks the scope at start: a machine-wide install recorded in
the HKLM uninstall key is replaced under Program Files by the elevated helper
it already runs as, and a fresh install goes to LOCALAPPDATA, where an update
needs no elevation at all. The helper now decides that elevation by probing
the install root, and only asks for it when the tree is not writable. Both
registry views are checked, because installers built before this were 32-bit.

A failed install now sets an error level: a silent update reads the exit code,
and an Abort without one looked like success.
2026-11-13 17:15:38 +08:00