Skip to content

Commit

Permalink
exclude files
Browse files Browse the repository at this point in the history
  • Loading branch information
murkl committed Apr 7, 2024
1 parent eaaf3a6 commit b77090f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
19 changes: 14 additions & 5 deletions d2launcher
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ mxl_update_check="true"
mxl_update_channel="public" # or beta
d2_stats_tray="true"

# Patch
mxl_update_exclude=()

# Gui
gui_width="450"
gui_height="380"
Expand Down Expand Up @@ -513,16 +516,22 @@ show_gui_mxl_patches() {
return 1
fi

# Remove patched files from d2 dir
mapfile -t patched_files < <(zipinfo -1 "${MXL_PATCHES_DIR}/$(<"$d2_dir/$MXL_PATCH_VERSION").zip")
for item in "${patched_files[@]}"; do rm -f "${d2_dir}/${item}"; done

(
# Remove patched files from d2 dir
if [ -f "${MXL_PATCHES_DIR}/$(<"${d2_dir}/${MXL_PATCH_VERSION}").zip" ]; then
mapfile -t patched_files < <(zipinfo -1 "${MXL_PATCHES_DIR}/$(<"${d2_dir}/${MXL_PATCH_VERSION}").zip")
for item in "${patched_files[@]}"; do rm -f "${d2_dir}/${item}"; done
fi

# Patching Diablo II core data
unzip -o "$D2_CORE_PATCH_FILE" -d "$d2_dir"

# Patching content of patch file to Diablo II dir
unzip -o "$MXL_PATCHES_DIR/$patch_filename.zip" -d "$d2_dir"
if [ -z "${mxl_update_exclude[*]}" ]; then
unzip -o "$MXL_PATCHES_DIR/$patch_filename.zip" -d "$d2_dir"
else
unzip -o "$MXL_PATCHES_DIR/$patch_filename.zip" -d "$d2_dir" -x "${mxl_update_exclude[@]}"
fi
echo "$patch_filename" >"$d2_dir/$MXL_PATCH_VERSION"

) &
Expand Down
6 changes: 6 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ All files are located here: `~/.d2launcher`. Simply copy & paste to another syst

The logging file is `~/.d2launcher/d2launcher.log` and is **not** rotated. This contains only logs from execution of Diablo II.

## Exclude files from update patch

Add this array property to exclude files from update
`mxl_update_exclude=("file1" "file2")`

## Example `d2launcher.conf`

```
Expand All @@ -75,6 +80,7 @@ mxl_update_check="true"
mxl_update_channel="public"
gui_width="420"
gui_height="320"
mxl_update_exclude=("cnc-ddraw config.exe" "ddraw.dll")
```

## Median XL Beta
Expand Down

0 comments on commit b77090f

Please sign in to comment.