Files
OrcaSlicer/version.inc
Lam Wei Lun 6a451abaf1 Install policy: one Windows scope, Sparkle on macOS
Windows: the installer keeps a single scope and swaps the tree in place.
Children move into <tree>\.old and the staged ones move up, so the old
version stays runnable until a complete new one exists and nothing outside
the tree is written. An install now needs the administrator token only when
the tree is not writable; the ACE granted on the tree is what makes later
updates prompt-free. The grant goes through icacls from System32 against a
SID an unelevated process passes in, so no binary read from the tree is ever
executed elevated.

The installer marks the tree it was handed with --tree-named, because NSIS
strips /D= from its own command line and a named default and a double-click
otherwise look alike. A named tree that disagrees with the machine record is
refused instead of replaced. Exit code 5 now separates "swap finished, the
old files could not be deleted" from 3, so a finished install is recorded and
started rather than reported as a failure.

macOS: Sparkle 2 owns the check, the signature check, the install and the
relaunch. MacUpdater.mm only selects the feed, the stable one or a nightly
one, and the bundle carries the feed URL and the EdDSA key. The DMG-swap
helper is gone. CI generates the signed appcast from the release's DMG and
publishes it to gh-pages; the existing feed is downloaded to the output path
the generator merges from, and a feed that loses entries fails the job.

The team-id pin becomes the Sparkle public key, and the helper's signing
stamp goes with it: what a macOS build accepts is now in the bundle the
release ships.
2026-12-01 15:41:39 +08:00

64 lines
3.2 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_SPARKLE_PUBLIC_KEY "EdDSA public key the macOS update feed is signed with")
# The feed the macOS bundle advertises. MacUpdater.mm derives the nightly feed from
# this one, so the release repository is named in a single place.
set(ORCA_SPARKLE_FEED_URL "https://orcaslicer.github.io/OrcaSlicer/appcast.xml"
CACHE STRING "Sparkle feed URL")
# A build that ships installers must carry the pins its platform needs: an empty pin
# leaves the macOS feed unverifiable, or makes the helper accept an update signed by
# anyone the OS trusts, and neither can 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_SPARKLE_PUBLIC_KEY)
message(FATAL_ERROR "ORCA_RELEASE_BUILD needs ORCA_SPARKLE_PUBLIC_KEY on macOS. "
"Without it the update feed cannot be verified.")
endif ()
if ((WIN32 OR APPLE) AND NOT ORCA_BUILD_TIMESTAMP)
message(FATAL_ERROR "ORCA_RELEASE_BUILD needs ORCA_BUILD_TIMESTAMP on Windows and macOS. "
"Without it the build has no id, so a nightly cannot be told from an older one.")
endif ()
endif ()