From: David R. <dr...@as...> - 2015-09-09 02:20:08
|
I have been able to get Py2Exe to work well with my Python 3.4 code that implements a Windows service (that implements a Tornado HTTP server). Thanks, Mark and others who have made Py2Exe such a useful tool! I am having one problem, which is this: when I install the service by running: "myservice.exe - install", the service gets installed fine. I can start the service, and this tries to register the .dll (.pyd) that contains the string resource files needed by the Windows event viewer. However, my options in setup.py call for files to be bundled into the .exe. (In other words: bundle_files: 1, compressed: true, and zipfile=None.) This leads to errors when trying to access Windows event log events: "The description for Event ID 4100 from source myservice cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer." When I inspect the Windows registry, I see that (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\m yservice ) gets updated with something like this: C:\Projects\MyApp\dist\myservice.exe\servicemanager.pyd This makes sense, sort of, except that Windows can't really access the .pyd file inside the zip archive bundled into myservice.exe. If I manually make a copy of servicemanager.pyd, and manually edit the registry to point to C:\Projects\MyApp\dist\servicemanager.pyd then Windows Event Viewer works fine to view messages logged by myservice. What I would really like to be able to do is to write the needed string resources to the myservices.exe file itself, and register THIS .exe file for the Windows event viewer to use. This way I would not need to distribute any additional files, and would not need to manually mess around with things (though my app may need to explicitly update the registry setting.) Can anyone provide any information on any of the following: 1) Writing to string resources in myservice.exe (such as in a script that runs after Py2Exe builds myservices.exe). Is there any reason why this should not be possible? 2) Is Py2Exe currently building string resources? I see resources.py, but would love some more information or suggestions. I saw an old post that suggests using pyrcc4 ( http://comments.gmane.org/gmane.comp.python.py2exe/2907 ) to add in resources, but if Py2Exe can write the resources natively that seems cleaner. 3) Am I making this harder than it needs to be? Is there just a setting that I am missing that would tell Py2Exe to include the resources automatically? 4) Is there any other active community or wiki for Py2Exe, or is this mailing list the best place to ask questions and collaborate on Py2Exe? FYI, here is Microsoft documentation on creating Event Sources: https://msdn.microsoft.com/en-us/library/windows/desktop/aa363648(v=vs.85).a spx https://msdn.microsoft.com/en-us/library/windows/desktop/aa363661(v=vs.85).a spx https://msdn.microsoft.com/en-us/library/windows/desktop/aa363669(v=vs.85).a spx Thanks in advance. David Rueter dr...@as... |