makehumancommunity / makehuman

This is the main repository for the MakeHuman application as such.

Home Page:http://www.makehumancommunity.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

On Windows, fails silently if registry key-value "...\User Shell Folders\Personal" is missing

zmic opened this issue · comments

commented

For whatever reason, "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Personal" was missing on my system which causes getpath.getHomePath() to throw error.

So double-clicking the desktop icon just did nothing which was very confusing for first-time user me.

The value defaults to "%USERPROFILE%\Documents" so changing getpath.py like this fixed it for me:

        with winreg.OpenKey(winreg.HKEY_CURRENT_USER, keyname) as k:
            try:
                value, type_ = winreg.QueryValueEx(k, 'Personal')
            except FileNotFoundError:
                value, type_ = "%USERPROFILE%\Documents", winreg.REG_EXPAND_SZ

Thanks. Having a fallback seems like an obviously good thing to have. I have added it to master now, so it should appear in the next nightly build.

commented

Now I notice it should be r"%USERPROFILE%\Documents" with the "r" in front to escape the backslash. Maybe you caught that.

FWIW, Windows supports the forward slash just fine. It is preferrable to use the forward slash for paths in a cross-platform context to avoid having to include unnecessary escape characters.

commented

Is this still relevant ?