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 script with the notable difference being that it can run on any machine without Vizard being installed. 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. Simply follow the next steps:
Under the file menu, you will find "Publish as EXE". A Wizard will walk you through the necessary steps. The compiler has two steps:
There are some cases where Vizard might not be able to automatically detect all resource dependencies of your script. In this case you can manually add the files using the publish wizard (described on the next page) or you can specify them in your script.
You can force Vizard to add a file to the published EXE by using the viz.res.addPublishFile() command in your script:
You can also force Vizard to add an entire directory of files to the published EXE by using the viz.res.addPublishDirectory() command:
Vizard uses separate DLL files to support loading various image/model file formats, and these DLLs are not loaded until they are needed. You can tell Vizard that your published EXE should support certain file formats by using the viz.res.addPublishFileLoader() command:
There are cases where you might want to exclude certain files from the published EXE. You can use the viz.res.addPublishFilter() command to filter out files from the published EXE. This command can either accept a string or a callback function. If a string is specified, then all files in the published EXE matching the string pattern will be excluded. If a callback function is specified, then the callback function will be passed a filename and should return True if the file should be removed from the published EXE. The following code shows how to filter out all files containing '.svn' in the name using both the string and callback methods:
When a published EXE is executed, it runs inside a virtual directory. If you need to access files that are in the same directory as the published EXE, then use the viz.res.getPublishedPath() command:
Note: Using the viz.res.getPublishedPath() command when NOT running inside a published EXE will simply return the unmodified filename.
Published EXEs from Free/Lite editions will self-exit after 5 minutes.
Published EXEs cannot participate in clusters.
Published EXEs do not allow capturing the screen to a video by default, since end users could inadvertently trigger a recording that could quickly fill up hard drive space. To override this setting and allow recording of videos within a published EXE, simply add the following line of code to your script: