WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-24-2014, 06:39 PM
chris2307 chris2307 is offline
Member
 
Join Date: Nov 2013
Posts: 36
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).
Reply With Quote
  #2  
Old 11-25-2014, 08:16 AM
Frank Verberne Frank Verberne is offline
Member
 
Join Date: Mar 2008
Location: Netherlands
Posts: 148
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.
Reply With Quote
  #3  
Old 11-25-2014, 10:12 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,467
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.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Suggestion: Code Browser kopper Vizard 5 05-23-2011 03:39 AM
building a maze GoldenSun Vizard 3 06-04-2008 10:27 AM


All times are GMT -7. The time now is 02:04 PM.


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