WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
  #1  
Old 09-01-2006, 10:52 PM
tobin tobin is offline
WorldViz Team Member
 
Join Date: Feb 2003
Posts: 251
Publish as EXE - Introduction

Available starting R3 Beta 2

Publishing your simulation as an executable is a new bundled feature that “compiles” your simulation—including all scripts and resource files—into a single .EXE package. The compiled package will work as a fully functional Vizard development environment with the notable difference being that it can run on any machine now without installing Vizard first. There is a restriction, though; “compiled” simulations cannot be edited or modified (i.e., scripts or resource files changed) without recompiling on a licensed Vizard development machine.

Accessing and using this feature is easy as it’s built into the Vizard development environment. Under the file menu, you’ll now find “Publish as EXE…”. A Wizard will walk you through the necessary steps. The compiler has two steps; the first requires that you run your script so that all dependencies (across your project files, Vizard modules, Python, etc) can be identified. Second, it compresses everything together into a single EXE that can be distributed royalty-free.

Other limitations:
  • Published EXEs are unable to generate AVI recordings by the user pressing F12.
  • Published EXEs from Trial/Lite editions will self-exit after 2 minute (Beta 2 can be activated as a full Development edition and so it’s published EXEs will not have this restriction)
  • Published EXEs cannot server as members in a cluster.
Reply With Quote
  #2  
Old 09-14-2006, 09:54 AM
tobin tobin is offline
WorldViz Team Member
 
Join Date: Feb 2003
Posts: 251
Running EXEs on machines w/previous R2 installations

If you attempt to run a R3 published EXE on a machine that has had R2 installed but never R3 installed, then the EXE will not function correctly and will produce a number of errors. R2 unfortunately defined itself in the system path and this collides with R3. The R3 installer removes this entry from the system path.

To remedy this, either install R3 Beta or manually remove "c:\program files\vizard25" from you system's PATH environment variable.
Reply With Quote
  #3  
Old 09-20-2006, 01:59 PM
cade_mccall cade_mccall is offline
Member
 
Join Date: Sep 2004
Posts: 61
publishing as exe

Hi-

We've tried publishing as EXE on a couple computers and we can't seem to get it to work (even with a bare-bones script). I get to the point of running the program within the Publish as EXE dialogue box but then when I close the script, the process fails. The two computers I've tried this on have 2.53 on them, if that matters.

-Cade
Reply With Quote
  #4  
Old 09-20-2006, 04:16 PM
mspusch mspusch is offline
WorldViz Team Member
 
Join Date: Feb 2003
Posts: 211
Hi Cade,

are you sure that either R3 is installed and/or "c:\program files\vizard25" is removed from you system's PATH environment variable?
Please have a look at the previous post and the implications of an R2 installation on running an executable on a computer. Hope this helps.
Reply With Quote
  #5  
Old 05-20-2007, 11:11 AM
cade_mccall cade_mccall is offline
Member
 
Join Date: Sep 2004
Posts: 61
writing a text file

Hi-

I want the exe I've made with Publish to EXE to write to a text file for recording data. Is that possible?

Thanks,
Cade
Reply With Quote
  #6  
Old 05-21-2007, 10:59 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Yes, it should be possible. Did you have a problem trying it?
Reply With Quote
  #7  
Old 05-21-2007, 10:30 PM
cade_mccall cade_mccall is offline
Member
 
Join Date: Sep 2004
Posts: 61
No. When I publish this script as an exe . . .

import viz
viz.go()
file = open( 'test.txt', 'a' )
file.write( 'hello' )
file.close()

. . . I can't get the exe to write anything.
Reply With Quote
  #8  
Old 05-22-2007, 09:55 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Keep in mind that published EXEs are extracted to a temporary directory then executed from there. So the file is probably being created in that temp directory, which gets deleted after your script exits. I'm assuming you want the file to be created in the same directory as the EXE? Here is sample code that does this:
Code:
import viz
viz.go()

#Get path to publish EXE
path = viz.getOption('viz.publish.path','.')+'/'

#Open file in path
file = open( path + 'test.txt', 'a' )
file.write( 'hello' )
file.close()
Reply With Quote
  #9  
Old 05-22-2007, 10:13 PM
cade_mccall cade_mccall is offline
Member
 
Join Date: Sep 2004
Posts: 61
Perfect. Thanks.
Reply With Quote
  #10  
Old 12-23-2008, 02:15 PM
TrashcanPatrol TrashcanPatrol is offline
Member
 
Join Date: Aug 2008
Posts: 43
I'm having the same problem... I tried what you said and it works for when I'm running the script inside Vizard, but not when I'm running it as a published EXE. It creates instead a blank document named whatever I named it... am I doing something wrong?
Reply With Quote
  #11  
Old 12-23-2008, 03:37 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,455
This happened when you published the short script posted here?
Reply With Quote
  #12  
Old 12-24-2008, 02:03 PM
TrashcanPatrol TrashcanPatrol is offline
Member
 
Join Date: Aug 2008
Posts: 43
Hmm it works when I try to run just the script posted here... just not when I try to put it into my own script
Reply With Quote
  #13  
Old 01-22-2009, 02:01 AM
moooh moooh is offline
Member
 
Join Date: Dec 2008
Posts: 19
I'm just going to slide into this conversation and add my problem with publishing instead of making a new topic.

I'm using the module xml.dom.minidom but when I publish an exe and try to run it on an other computer, the exe is unable to find this module. The publish as exe wizard found a dependancy for minicompat.pyc but having it included does not change anything.

I noticed that the minidom.py didn't have it's own .pyc file so I tried manually compiling one and included in the list of dependencies. This didn't change anything either.

Being fairly new to Python I'm not entirely sure how the structuring works for the .pyc-files.
The minidom is importing other modules from the xml.dom namespace, do I need to create .pyc files for all of those as well? Or are they recursively bundled toghether inside the minidom.pyc?
Reply With Quote
  #14  
Old 01-22-2009, 05:58 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Using the xml.dom.minidom module in a published exe works fine for me. Can you publish the following script to an exe?
Code:
import viz
viz.go()

import xml.dom.minidom
Reply With Quote
  #15  
Old 01-25-2009, 01:52 AM
moooh moooh is offline
Member
 
Join Date: Dec 2008
Posts: 19
No that one fails as well.

Code:
Traceback (most recent call last):
  File "<string>", line 11, in ?
  File "testfile.py", line 4, in ?
      import xml.dom.minidom
ImportError: No module named xml.dom.minidom
Note that this is on a computer which do not have neither Python nor Vizard installed. If I publish the same exe and run it from my own system which has Vizard, the exe finds the module. Presumably it also fails to find it in the exe in that case, but has the option of looking up and finding it elsewhere.
Reply With Quote
  #16  
Old 02-04-2009, 01:40 AM
moooh moooh is offline
Member
 
Join Date: Dec 2008
Posts: 19
Found out anything regarding this?
The dependencies I get when publishing the 3 line script is the following:

viz_python.dll
python24.dll
osgDB.dll
MSVCP71.dll
osg.dll
osgText.dll
osgParticle.dll
MSVCR71.dll
vizcore.dll
Producer.dll
OpenThreadsWin32.dll
transform.dll
osgUtil.dll
codecs.pyc
minidom.pyc
sre_parse.pyc
HTMLDOMImplementation.pyc
traceback.pyc
domreg.pyc
MessageSource.pyc
__init__.pyc
Range.pyc
viz.pyc
dis.pyc
UserDict.pyc
sre_constants.pyc
token.pyc
__init__.pyc
re.pyc
types.pyc
sre_compile.pyc
linecache.pyc
testfile.py
random.pyc
cp1252.pyc
tokenize.pyc
xmlbuilder.pyc
gettext.pyc
stat.pyc
sre.pyc
locale.pyc
vizmat.pyc
inspect.pyc
site.pyc
FtCore.pyc
__init__.pyc
__init__.pyc
DOMImplementation.pyc
aliases.pyc
NodeFilter.pyc
ntpath.pyc
opcode.pyc
minicompat.pyc
os.pyc
copy_reg.pyc
string.pyc
warnings.pyc
copy.pyc
vizact.pyc

Is this the same list that you get for your exe that is working?
Reply With Quote
  #17  
Old 02-10-2009, 01:10 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
You probably have another Python installation on your computer that is interfering with the Vizard installation. Run the following script and post the output. If the output contains any directories that are outside the Vizard directory, then that is most likely the problem.
Code:
import sys
for p in sys.path:
	print p
Reply With Quote
  #18  
Old 02-11-2009, 01:19 AM
moooh moooh is offline
Member
 
Join Date: Dec 2008
Posts: 19
Here's what I get. Seems to be the expected normal result, everything is under Vizard.

C:\Program Files\WorldViz\Vizard30\python
C:\Program Files\WorldViz\Vizard30\bin\python24.zip
C:\Program Files\WorldViz\Vizard30\bin\lib
C:\Program Files\WorldViz\Vizard30\bin\DLLs
C:\Program Files\WorldViz\Vizard30\bin\lib\plat-win
C:\Program Files\WorldViz\Vizard30\bin\lib\lib-tk
C:\Program Files\WorldViz\Vizard30\bin
C:\Program Files\WorldViz\Vizard30\bin\lib\site-packages
C:\Program Files\WorldViz\Vizard30\bin\lib\win32

For some reason I seem to have failed to mention that I'm running Vizard under Windows Vista. That may or may not have anything to do with this problem.
Reply With Quote
  #19  
Old 02-11-2009, 09:27 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
In that case you have a corrupted version of Vizard. Some of the files in the list you previously posted are not included with Vizard (MessageSource.py, HTMLDOMImplementation.py, DOMImplementation.py). I would recommend that you uninstall Vizard, delete the entire Vizard directory, then reinstall it. Hopefully this will fix the issue.
Reply With Quote
  #20  
Old 02-12-2009, 02:51 AM
moooh moooh is offline
Member
 
Join Date: Dec 2008
Posts: 19
A fresh install and the problem is no more. Thanks.
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


All times are GMT -7. The time now is 07:06 AM.


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