Skip to content

Commit 60416aa

Browse files
authored
fix: appimage download issues (#271)
Fixes issue where new appimage would be downloaded with the wrong name and moves the recommended appimage to the top of the list Reproduction: - install when there is an older recommended appimage - delete LogosBible10 folder - attempt install again Expected behavior: new appimage downloads with correct name Actual behavior: appimage downloads with the old name
1 parent a3df844 commit 60416aa

File tree

3 files changed

+26
-16
lines changed

3 files changed

+26
-16
lines changed

CHANGELOG.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
# Changelog
22

33
- 4.0.0-beta.6
4-
- Fix #234 [N. Shaaban]
5-
- Fix #187 [N. Shaaban]
6-
- Fix #168 [N. Shaaban]
7-
- Fix #155 [N. Shaaban]
8-
- Fix #147 [N. Shaaban]
9-
- Fix #253 [N. Marti]
10-
- Fix #252 [N. Marti]
4+
- Fix #256 [J. Goodman]
5+
- Fix #269 [T. H. Wright]
6+
- Fix #234 [N. Shaaban]
7+
- Fix #187 [N. Shaaban]
8+
- Fix #168 [N. Shaaban]
9+
- Fix #155 [N. Shaaban]
10+
- Fix #147 [N. Shaaban]
11+
- Fix #253 [N. Marti]
12+
- Fix #252 [N. Marti]
1113
- Implemented network cache [N. Shaaban]
1214
- Refactored configuration handling (no user action required) [N. Shaaban]
13-
- Fix #235 [T. H. Wright]
15+
- Fix #235 [T. H. Wright]
1416
- 4.0.0-beta.5
1517
- Filter out broken Logos v39 release [N. Shaaban]
1618
- Fix #17 [T. H. Wright]

ou_dedetai/installer.py

+11-5
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def ensure_appimage_download(app: App):
8686
app.status("Ensuring wine AppImage is downloaded…")
8787

8888
downloaded_file = None
89-
appimage_path = app.conf.wine_appimage_path or app.conf.wine_appimage_recommended_file_name #noqa: E501
89+
appimage_path = app.conf.wine_appimage_recommended_file_name #noqa: E501
9090
filename = Path(appimage_path).name
9191
downloaded_file = utils.get_downloaded_file_path(app.conf.download_dir, filename)
9292
if not downloaded_file:
@@ -293,7 +293,7 @@ def ensure_product_installed(app: App):
293293
app.conf._installed_faithlife_product_release = None
294294

295295
# Clean up temp files, etc.
296-
mst_destination = Path(app.conf.install_dir) / "data/wine64_bottle/drive_c/LogosStubFailOK.mst"
296+
mst_destination = Path(app.conf.install_dir) / "data/wine64_bottle/drive_c/LogosStubFailOK.mst" #noqa E501
297297
if mst_destination and mst_destination.is_file():
298298
try:
299299
mst_destination.unlink()
@@ -374,9 +374,15 @@ def create_wine_appimage_symlinks(app: App):
374374
if app.conf.wine_binary_code not in ['AppImage', 'Recommended'] or app.conf.wine_appimage_path is None: #noqa: E501
375375
logging.debug("No need to symlink non-appimages")
376376
return
377-
378-
appimage_file = appdir_bindir / app.conf.wine_appimage_path.name
379-
appimage_filename = Path(app.conf.wine_appimage_path).name
377+
378+
# Only use the appimage_path if it exists
379+
# It may not exist if it was an old install's .appimage
380+
# where the install dir has been cleared.
381+
if app.conf.wine_appimage_path.exists():
382+
appimage_filename = app.conf.wine_appimage_path.name
383+
else:
384+
appimage_filename = app.conf.wine_appimage_recommended_file_name
385+
appimage_file = appdir_bindir / appimage_filename
380386
# Ensure appimage is copied to appdir_bindir.
381387
downloaded_file = utils.get_downloaded_file_path(app.conf.download_dir, appimage_filename) #noqa: E501
382388
if downloaded_file is None:

ou_dedetai/utils.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,14 @@ def get_wine_options(app: App) -> List[str]: # noqa: E501
223223
logging.debug(f"{binaries=}")
224224
wine_binary_options = []
225225

226-
reccomended_appimage = f"{app.conf.installer_binary_dir}/{app.conf.wine_appimage_recommended_file_name}" # noqa: E501
226+
recomended_appimage = f"{app.conf.installer_binary_dir}/{app.conf.wine_appimage_recommended_file_name}" # noqa: E501
227+
228+
if recomended_appimage in appimages:
229+
appimages.remove(recomended_appimage)
227230

228231
# Add AppImages to list
232+
wine_binary_options.append(recomended_appimage)
229233
wine_binary_options.extend(appimages)
230-
if reccomended_appimage not in wine_binary_options:
231-
wine_binary_options.append(reccomended_appimage)
232234

233235
sorted_binaries = sorted(list(set(binaries)))
234236
logging.debug(f"{sorted_binaries=}")

0 commit comments

Comments
 (0)