Skip to content

Commit 4f8085d

Browse files
committed
Update For Checking From Latest To Oldest AppImage Version
1 parent ab0cf82 commit 4f8085d

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/helpers/utils/libappimage.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,18 @@ type LibAppImage interface {
2626

2727
// Function which loads up libappimage from the system, libappimage comes packed with the imageHub AppImage.
2828
func loadLibAppImage() (*dl.DL, error) {
29-
lib, err := dl.Open("libappimage.so.1.0", 0)
30-
if err == nil {
31-
return lib, nil
29+
// libappimage versions from latest to oldest, so that we can load the latest version
30+
sharedLibList := [17]string{
31+
".1.0.4", ".1.0.3", ".1.0.1", ".1.0.2",
32+
".1.0", ".0.1.9", ".0.1.8", ".0.1.7", ".0.1.6", ".0.1.5",
33+
".0.1.4", ".0.1.3", ".0.1.2", ".0.1.1", ".0.1.0", ".0", "",
3234
}
3335

34-
lib, err = dl.Open("libappimage.so", 0)
35-
if err == nil {
36-
return lib, nil
36+
for index := range sharedLibList {
37+
lib, err := dl.Open("libappimage.so" + sharedLibList[index], 0)
38+
if err == nil {
39+
return lib, nil
40+
}
3741
}
3842

3943
return nil, fmt.Errorf("libappimage not found, desktop integration is disabled")

0 commit comments

Comments
 (0)