WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Suggestion to Building EXEs (https://forum.worldviz.com/showthread.php?t=5237)

chris2307 11-24-2014 06:39 PM

Suggestion to Building EXEs
 
I encountered this problem for the first time this evening. I published a script to an executable which made heavy use of the Python XML processing module which was contained within another class. I also do not create an instance of this class until a file is loaded in (via a load button in the file menu).

I published the script to an EXE and was a bit perplexed as to why I was getting a error when attempting to load in an XML file. My error handling reported a missing module. It didn't take me too long to figure out that during the publishing process, when running the script, I actually needed to click on the Open dialogue in my application to load in an XML file for the process to automatically pick up the python module.

This is where my suggestion comes in. I understand that the publish function works so that it lists the dependencies when the script is run but is there no method of doing this without needing to run the script? Could a more elegant solution be found which automatically links the dependencies without needing to run the script before building it?

I am no expert on code deployment by any means so forgive me if there is a reason this cannot be accomplished but I fear it may trip others up. Especially if they're in the same boat as me and have only previously published simple scripts which load all dependencies in right at the beginning of the script and so have had no previous issues (and reason to suspect that this might happen).

Frank Verberne 11-25-2014 08:16 AM

Two options to work around this issue:
1. Load everything you need in the beginning. When publishing the exe, you can just quit the process and everything is there.
2. Put everything you don't want to load at the beginning, but need later in your code in one folder (e.g. data) and include viz.res.addPublishDirectory('./data') at the beginning of your code.

I had to get used to the publishing system as well, but it's workable when you get the hang of it. Although I agree with you that there should be a more elegant solution for making sure everything you need is included in the executable.

Jeff 11-25-2014 10:12 AM

The Publishing as an EXE tutorial covers the different ways you can add dependencies and accessing data files that are both internal/external to the EXE.


All times are GMT -7. The time now is 09:35 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC