Skip to content

Commit

Permalink
Merge branch 'rustdesk:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangbo8418 authored Mar 5, 2024
2 parents 46bf2bd + fc14966 commit 9ef4ca5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
11 changes: 6 additions & 5 deletions libs/portable/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
from hashlib import md5
import brotli

# file compress level(0-11)
compress_level = 11
# 4GB maximum
length_count = 4
# encoding
Expand All @@ -15,7 +13,7 @@
# output: {path: (compressed_data, file_md5)}


def generate_md5_table(folder: str) -> dict:
def generate_md5_table(folder: str, level) -> dict:
res: dict = dict()
curdir = os.curdir
os.chdir(folder)
Expand All @@ -28,7 +26,7 @@ def generate_md5_table(folder: str) -> dict:
f = open(full_path, "rb")
content = f.read()
content_compressed = brotli.compress(
content, quality=compress_level)
content, quality=level)
md5_generator.update(content)
md5_code = md5_generator.hexdigest().encode(encoding=encoding)
res[full_path] = (content_compressed, md5_code)
Expand Down Expand Up @@ -81,6 +79,8 @@ def build_portable(output_folder: str, target: str):
help="specify startup file in --folder, default is rustdesk.exe")
parser.add_option("-t", "--target", dest="target",
help="the target used by cargo")
parser.add_option("-l", "--level", dest="level", type="int",
help="compression level, default is 11, highest", default=11)
(options, args) = parser.parse_args()
folder = options.folder or './rustdesk'
output_folder = os.path.abspath(options.output_folder or './')
Expand All @@ -95,6 +95,7 @@ def build_portable(output_folder: str, target: str):
exit(-1)
exe = '.' + exe[len(os.path.abspath(folder)):]
print("executable path: " + exe)
md5_table = generate_md5_table(folder)
print("compression level: " + str(options.level))
md5_table = generate_md5_table(folder, options.level)
write_metadata(md5_table, output_folder, exe)
build_portable(output_folder, options.target)
1 change: 0 additions & 1 deletion libs/portable/icon.rc

This file was deleted.

0 comments on commit 9ef4ca5

Please sign in to comment.