Custom events (licensed versions)

<< Click to Display Table of Contents >>

Navigation:  Advanced topics >

Custom events (licensed versions)

You can configure Cameyo virtual packages to launch custom commands at different points during the application's execution.

 

The syntax for adding a script to a package is:

Cameyo.exe -AddScript ScriptFile EventName wait/nowait ExePath

With:

- ScriptFile: full path to the script file to add. If this is a vbs / wsh / js / jse file, it will be executed by the Windows Script host (wscript.exe). If it is a bat or cmd file, it will be executed using "cmd.exe /c". Otherwise it will be executed directly.

- EventName: the moment at which the script is to execute. See event tables below.

- wait / nowait: specify "wait" to make the application wait until the script is done executing. Specify "nowait" if you wish the application to proceed while the script executes in the background.

- ExePath: full path to the .cameyo.exe virtual package.

 

Examples:

- Cameyo.exe -AddScript C:\Scripts\DoSomething.vbs OnProcessStartUnvirtualized wait C:\AppName.cameyo.exe

- Cameyo.exe -AddScript C:\Scripts\DoSomething.vbs OnStartVirtualized nowait C:\AppName.cameyo.exe

 

Event name:

Triggered:

Order:

OnStartUnvirtualized

When the very first process of the application starts. The command executes outside the virtualization context.

Loading #1

OnStartVirtualized

When the very first process of the application starts. The command executes inside the virtualization context.

Loading #3

OnProcessStartUnvirtualized

Whenever a new process starts. The command executes outside the virtualization context.

Loading #2

OnProcessStartVirtualized

Whenever a new process starts. The command executes inside the virtualization context.

Loading #4

OnProcessStopVirtualized

Whenever a process stops. The command executes inside the virtualization context.

Unloading #1

OnProcessStopUnvirtualized

Whenever a process stops. The command executes outside the virtualization context.

Unloading #4

OnStopVirtualized

When the very last process of the application ends. The command executes inside the virtualization context.

Unloading #2

OnStopUnvirtualized

When the very last process of the application ends. The command executes outside the virtualization context.

Unloading #3

The "order" column describes the order by which events are triggered during the executable process' loading / unloading sequence.

 

Virtualized / Unvirtualized

Each events can trigger before or after the virtualized environment is started / stopped. This allows you to choose whether to execute commands within or outside of the virtual application's context.

For example, if you need to run a command when a virtual application starts, but you need it to run outside of the sandbox (i.e. create files on the real system), then you can specify it in the "On start (unvirtualized)" event. If on the other hand you would like to execute a certain command when the virtual application ends, but you want it to still run inside the virtual environment, then you can specify it in the "On stop (virtualized)" event. The option "Wait until program ends" delays the virtual application's start or stop until your command has finished executing.

 

Information about the package properties

Regardless of which event triggered your script, your script will have detailed information about the package, its properties and its different paths, through Cameyo's standard Environment variables.

 

Stopping application execution

If your script runs in "wait" mode, it can issue the exit code 1234 to stop / cancel the application's execution.