UncleGoogle / galaxy-integration-humblebundle

Humble Bundle integration for GOG Galaxy 2.0
GNU General Public License v3.0
186 stars 19 forks source link

OSError: [WinError 123] - incorrectly parsed UninstallString #78

Closed sentry-io[bot] closed 4 years ago

sentry-io[bot] commented 4 years ago

Sentry Issue: HB-GALAXY-VY

OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:\\WINDOWS\\iun504.exe C:\\Program Files (x86)\\Blades of Avernum'

local\winappfinder.py in _find_executable at line 70
        location = uk.install_location_path \
            or (upath.parent if upath else None) \
            or (ipath.parent if ipath else None)
        # find all executables and get best machting (exclude uninstall_path)
>       if location and location.exists():
            executables = list(set(self._pathfinder.find_executables(location)) - {str(upath)})
            best_match = self._pathfinder.choose_main_executable(human_name, executables)
            if best_match is None:
                logging.warning(f'Main exe not found for {human_name}; \
                    loc: {uk.install_location}; up: {upath}; ip: {ipath}; execs: {executables}')
UncleGoogle commented 4 years ago

Looks like "C:\\WINDOWS\\iun504.exe" "C:\\Program Files (x86)\\Blades of Avernum" is content of UninstallString that can be found under Blades of Avernum uninstall key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall (to open registry type regedit in windows menu)

iun504.exe is univesal uninstaller from SetupFactory and the second path is an argument. Current code heuristics parses it to find LOCATION of installed game. So in this case C:\\Program Files (x86)\\Blades of Avernum should be returned by this method:

https://github.com/UncleGoogle/galaxy-integration-humblebundle/blob/73ca1decc9d80071423c745ab2944e8b07a4b009/src/local/reg_watcher.py#L34-L46

Proper test should be written as well. Current tests are here: https://github.com/UncleGoogle/galaxy-integration-humblebundle/blob/73ca1decc9d80071423c745ab2944e8b07a4b009/tests/windows/test_reg_watcher.py#L59-L81

New test scenario: