pybonjour distribution

112 views
Skip to first unread message

Radu Savutiu

unread,
Mar 18, 2013, 5:11:38 AM3/18/13
to pybo...@googlegroups.com
Hi everyone,

I have a script in Python using pybonjour quite nicely. I was wondering how could I distribute it? py2exe seems not to include the needed dlls.

Regards,
Radu

Radu Savutiu

unread,
Mar 19, 2013, 7:24:59 AM3/19/13
to pybo...@googlegroups.com
Actually I figured it out eventually. I had to change the bonjour code for windows platform, so that instead of looking for the dll in the registry, it will find it locally, load it, and then use it.

The code to change:
if sys.platform == 'win32':
    # Need to use the stdcall variants
    _libdnssd = ctypes.windll.dnssd
    _CFunc = ctypes.WINFUNCTYPE

What to change it with:
Just have a look at how the library is trying to load the dnssd lib for Linux. I do not have the code in front of me, but it should be like this:

_libdnssd = ctypes.cdll.LoadLibrary("dnssd.dll")

Then it is just a matter of including the dnssd.dll in my dist folder, so my users do not have to download and install Apple's Bonjour.
Of course, there is also the matter of including the logo and obtaining permission from Apple - if you're making commercial software.

macbroadcast

unread,
Mar 20, 2013, 5:22:00 PM3/20/13
to pybo...@googlegroups.com


2013/3/18 Radu Savutiu <rsav...@gmail.com>
Nice radu , any chance to test it on windows and ubuntu ?

Regards


--
http://www.let.de

Radu Savutiu

unread,
Mar 21, 2013, 10:30:19 AM3/21/13
to pybo...@googlegroups.com, ma...@let.de
It works on Windows, yes. I've tested it. Are you saying you want the change I made to pybonjour.py ?
Reply all
Reply to author
Forward
0 new messages