mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-11-26 23:29:38 -05:00
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.
65 lines
3.1 KiB
PHP
65 lines
3.1 KiB
PHP
# Included by CMakeLists, edited by the build script
|
|
# (the version numbers are generated by the build script from the git current label)
|
|
|
|
set(SLIC3R_APP_NAME "OrcaSlicer")
|
|
set(SLIC3R_APP_KEY "OrcaSlicer")
|
|
|
|
if(NOT DEFINED BBL_INTERNAL_TESTING)
|
|
set(BBL_INTERNAL_TESTING "0")
|
|
endif()
|
|
set(SoftFever_VERSION "2.6.0-dev")
|
|
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+)"
|
|
SoftFever_VERSION_MATCH ${SoftFever_VERSION})
|
|
set(ORCA_VERSION_MAJOR ${CMAKE_MATCH_1})
|
|
set(ORCA_VERSION_MINOR ${CMAKE_MATCH_2})
|
|
set(ORCA_VERSION_PATCH ${CMAKE_MATCH_3})
|
|
|
|
set(SLIC3R_VERSION "02.08.01.55")
|
|
|
|
# The updater's signing values. The helper refuses an artifact that is not signed by
|
|
# the publisher or team it was built with, and accepts any trusted signer when that
|
|
# value is empty with a warning in the log, which is what a local or unsigned artifact
|
|
# build wants.
|
|
#
|
|
# The environment always wins, empty included. The cache keeps a value between
|
|
# configures, so a tree that is rebuilt after a publisher, team id or timestamp was
|
|
# rotated or removed would otherwise bake in the old one and keep accepting it.
|
|
macro(orca_signing_pin var description)
|
|
set(${var} "${${var}}" CACHE STRING "${description}")
|
|
if (DEFINED ENV{${var}})
|
|
set(${var} "$ENV{${var}}" CACHE STRING "${description}" FORCE)
|
|
endif ()
|
|
endmacro()
|
|
|
|
orca_signing_pin(ORCA_UPDATER_SIG_KEY "Base64url encoded updater signature key")
|
|
orca_signing_pin(ORCA_BUILD_TIMESTAMP "Build timestamp (UTC ISO-8601) baked into the binary as a build id")
|
|
orca_signing_pin(ORCA_UPDATER_PUBLISHER "Expected Authenticode signer display name of update artifacts")
|
|
orca_signing_pin(ORCA_UPDATER_TEAM_ID "Expected Apple Developer Team ID of macOS update artifacts")
|
|
|
|
# A build that ships installers must carry the pins its platform needs: an empty pin
|
|
# makes the helper accept an update signed by anyone the OS trusts, and that cannot be
|
|
# detected after the fact, because the empty pin is what the binary carries. Release
|
|
# and nightly builds configure with this on; a local or PR build leaves it off.
|
|
option(ORCA_RELEASE_BUILD "Refuse to configure a release without the updater signature pins it needs" OFF)
|
|
if (ORCA_RELEASE_BUILD)
|
|
if (WIN32 AND NOT ORCA_UPDATER_PUBLISHER)
|
|
message(FATAL_ERROR "ORCA_RELEASE_BUILD needs ORCA_UPDATER_PUBLISHER on Windows. "
|
|
"Without it the updater helper accepts a download signed by any trusted signer.")
|
|
endif ()
|
|
if (APPLE AND NOT ORCA_UPDATER_TEAM_ID)
|
|
message(FATAL_ERROR "ORCA_RELEASE_BUILD needs ORCA_UPDATER_TEAM_ID on macOS. "
|
|
"Without it the updater helper accepts a download signed by any trusted signer.")
|
|
endif ()
|
|
endif ()
|
|
|
|
# What the updater helper in this tree was built to accept. build_release_macos.sh
|
|
# compares the file before it copies the helper into a bundle, so a tree configured
|
|
# with one set of pins never ships a bundle that was built for another.
|
|
if (WIN32 OR APPLE)
|
|
file(WRITE "${CMAKE_BINARY_DIR}/updater-signing.txt"
|
|
"publisher=${ORCA_UPDATER_PUBLISHER}\n"
|
|
"team_id=${ORCA_UPDATER_TEAM_ID}\n"
|
|
"sig_key=${ORCA_UPDATER_SIG_KEY}\n"
|
|
"timestamp=${ORCA_BUILD_TIMESTAMP}\n")
|
|
endif ()
|