Skip to content

Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.

Updater: the download keeps the asset's extension last (.download-<version>-<asset>): Windows starts the installer by its extension and Expand-Archive takes only .zip

islandmedd7a69bf7c673
diff --git a/docs/design/one-click-update.md b/docs/design/one-click-update.md
index ff49ea9a..858e0463 100644
--- a/docs/design/one-click-update.md
+++ b/docs/design/one-click-update.md
@@ -25,7 +25,7 @@ Fail at any step: the temporary file is deleted, nothing in place changes, nothi
## Installing
-- **Linux AppImage**: download to `.<asset>.download-<version>` next to the AppImage (same filesystem), `chmod 755`,
+- **Linux AppImage**: download to `.download-<version>-<asset>` next to the AppImage (same filesystem), `chmod 755`,
hard-link the current file to `<name>.old`, write `update_pending.json` in the preferences folder, then one
`rename()` over the AppImage. The running app keeps its open file.
- **Windows**: a PowerShell helper (written to %TEMP%, deletes itself) waits for the app to exit, re-checks the hash,
diff --git a/src/core/SelfUpdate.cpp b/src/core/SelfUpdate.cpp
index f703eb10..e61a4b64 100644
--- a/src/core/SelfUpdate.cpp
+++ b/src/core/SelfUpdate.cpp
@@ -264,7 +264,9 @@ Install detectInstall(const InstallProbe& probe) {
// --- The download ---
std::string stagingPath(const Install& install, const std::string& version) {
- const std::string name = "." + install.asset + ".download-" + version;
+ // The asset's own extension stays last: Windows opens the installer by it (Start-Process), and Windows
+ // PowerShell's Expand-Archive takes only names ending in .zip.
+ const std::string name = ".download-" + version + "-" + install.asset;
if (!install.stagingDir.empty()) return pathString(fsPath(install.stagingDir) / name);
if (install.kind == InstallKind::WindowsPortable) return pathString(fsPath(install.target) / name);
return pathString(fsPath(install.target).parent_path() / name); // next to the AppImage: one rename away
diff --git a/src/core/SelfUpdate.h b/src/core/SelfUpdate.h
index b0d3ce6d..61f12851 100644
--- a/src/core/SelfUpdate.h
+++ b/src/core/SelfUpdate.h
@@ -122,7 +122,8 @@ struct Download {
void downloadUpdate(const std::string& version, const Install& install, const uint8_t key[32], const Fetch& fetch,
Download& out, const std::map<std::string, std::string>& memberFiles = {});
-// The temporary file a package is downloaded to (dot-file next to the target, or inside the target folder).
+// The temporary file a package is downloaded to: ".download-<version>-<asset>" (the asset's extension last) next to
+// the target, inside the portable folder, or in the installer's staging folder.
std::string stagingPath(const Install& install, const std::string& version);
// --- Installing, the first start, rolling back ---
diff --git a/tests/test_self_update.cpp b/tests/test_self_update.cpp
index c101517e..28e96009 100644
--- a/tests/test_self_update.cpp
+++ b/tests/test_self_update.cpp
@@ -343,6 +343,7 @@ TEST(self_update_downloads_and_installs) {
CHECK(d.ok && d.error.empty() && d.sha256 == kPackageSha && d.received == package().size());
CHECK(f.asked.size() == 3 && f.asked[2] == releaseFileUrl("99.0.0", "SculptForge-99.0.0-x86_64.AppImage"));
CHECK(fs::path(d.staged).parent_path() == fs::path(s.install.target).parent_path()); // next to it: one rename
+ CHECK(fs::path(d.staged).filename() == ".download-99.0.0-SculptForge-linux-x86_64.AppImage"); // (extension last)
CHECK(readAll(s.install.target) == "old version"); // nothing in place yet
std::string error;
CHECK(installAppImage(s.install, d, "99.0.0", "1.0.0", s.note, error));