[python-win32] Problem reading a shortcut (.lnk) with cPython 3.7 (32 bit)
Tim Roberts
timr at probo.com
Tue Jun 18 17:38:01 EDT 2019
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, timr at probo.com
Providenza & Boekelheide, Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3980 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/python-win32/attachments/20190618/2db77226/attachment.bin>
More information about the python-win32
mailing list