Skip to content

Commit dc4cf3d

Browse files
committed
Fix AppImage validation with custom update information
1 parent 0af5a59 commit dc4cf3d

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/updater.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,20 @@ namespace appimage::update {
7171
}
7272

7373
void validateAppImage() {
74-
const auto rawUpdateInformationFromAppImage = appImage.readRawUpdateInformation();
75-
7674
// first check whether there's update information at all
77-
if (rawUpdateInformationFromAppImage.empty()) {
78-
std::ostringstream oss;
79-
oss << "Could not find update information in the AppImage. "
75+
// note that we skip this check when custom update information is set intentionally
76+
if (this->rawUpdateInformation.empty()) {
77+
const auto rawUpdateInformationFromAppImage = appImage.readRawUpdateInformation();
78+
79+
if (rawUpdateInformationFromAppImage.empty()) {
80+
std::ostringstream oss;
81+
oss << "Could not find update information in the AppImage. "
8082
<< "Please contact the author of the AppImage and ask them to embed update information.";
81-
throw AppImageError(oss.str());
83+
throw AppImageError(oss.str());
84+
}
8285
}
8386

84-
const auto updateInformationPtr = makeUpdateInformation(rawUpdateInformationFromAppImage);
87+
const auto updateInformationPtr = makeUpdateInformation(rawUpdateInformation);
8588
const auto zsyncUrl = updateInformationPtr->buildUrl(makeIssueStatusMessageCallback());
8689

8790
// now check whether a ZSync URL could be composed by readAppImage

0 commit comments

Comments
 (0)