David Hughes wrote:

I'm in the process of upgrading my software from Python 2.7 to 3.7 now that wxPython has been migrated to 3. As part of a procedure for upgrading an end user's own installation I check for it's location via the desktop shortcut that Innosetup created during the original installation.

That's not a particularly good method in the general case.  I don't find much use for the desktop icon, so I suppress it.  You might be better served to use the registry, in HKEY_LOCAL_MACHINE\Software\Python\PythonCore.  32-bit installations will be in HKEY_LOCAL_MACHINE\Software\WOW6432Node\Python\PythonCore (if you're reading from a 64-bit app).


I have a procedure for doing this that worked/works fine with Python 2.7 that is very similar to the one published in /http://timgolden.me.uk/python/win32_how_do_i/read-a-shortcut.html/. Neither mine nor Tim's works under Python 3.7 (I haven't checked any other version of 3). With Tim's version, when the line

    name, _ = link.GetPath (shell.SLGP_UNCPRIORITY)

is executed, after a delay it responds with /aborted (disconnected)/ and the program terminates, as does mine.

Is it possible you have installed a 32-bit Python on a 64-bit system?  Theoretically, you should be able to use CLSID_ShellLink from either one, but I'm trying to narrow things down.  Tim's code works fine for me with Python 3.7.2 (64 bit) on Windows 10.

--
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to