diff --git a/libs/portable/generate.py b/libs/portable/generate.py index c7f0259e5..a93de7536 100755 --- a/libs/portable/generate.py +++ b/libs/portable/generate.py @@ -25,6 +25,7 @@ def normalize(path: str) -> str: def generate_md5_table(folder: str, level, exclude: str = None) -> dict: res: dict = dict() skip = normalize(exclude) if exclude else None + excluded = False # os.curdir is the literal ".", so restoring it left us inside `folder`. curdir = os.getcwd() os.chdir(folder) @@ -35,6 +36,7 @@ def generate_md5_table(folder: str, level, exclude: str = None) -> dict: full_path = os.path.join(root, f) if skip and normalize(full_path) == skip: print(f"Excluding {full_path}...") + excluded = True continue print(f"Processing {full_path}...") f = open(full_path, "rb") @@ -45,6 +47,8 @@ def generate_md5_table(folder: str, level, exclude: str = None) -> dict: md5_code = md5_generator.hexdigest().encode(encoding=encoding) res[full_path] = (content_compressed, md5_code) os.chdir(curdir) + if skip and not excluded: + raise ValueError(f"excluded file was not found in {folder}: {exclude}") return res diff --git a/res/msi/CustomActions/CustomActions.cpp b/res/msi/CustomActions/CustomActions.cpp index ad54a60ba..a87743c7c 100644 --- a/res/msi/CustomActions/CustomActions.cpp +++ b/res/msi/CustomActions/CustomActions.cpp @@ -1077,7 +1077,9 @@ UINT __stdcall UninstallPrinter( // Must match the name install used, otherwise the printer is left behind. Absent // on packages built before this was passed in, where it was the stock name. - if (SUCCEEDED(WcaGetProperty(L"CustomActionData", &pwzData)) && pwzData) + hr = WcaGetProperty(L"CustomActionData", &pwzData); + ExitOnFailure(hr, "failed to get CustomActionData"); + if (pwzData) { appNameValue = pwzData; }