5.1.1. Pre- and Post-Launch

You can enter multiple lines of command in Pre- and Post-Launch configuration, and each of them will be executed sequentially.

 Common Usage

The command entered must be in the following format:

"APP_PATH" [optional_parameters]
APP_PATH

This is the path to the application you want to launch.

[Note] Note

Applications can only be launched if it is within the computer's Program Files. This file directory is more secure and would prevent unwanted launches without administrative rights in the computer.


[Tip] Tip

If APP_PATH contains space, it needs to be enquoted with double quotation mark. If APP_PATH does not contain space, double quotation enquotes can be safely dropped.

We recommend always keep the double quotation mark as best practice.


[optional_parameters]

This is a list parameters you want to pass to the application. If there is no additional parameters to pass to the application you want to launch, just leave it empty, otherwise, please specify the parameters following the documentation given by the application you want to launch.

 

Example 5.1. Pre- and post-launch general launch commands

          "Windows NT\Accessories\wordpad.exe" "D:\My Project\ReadMe.txt"
          "C:\Program Files\My Applications\calc.exe"
          "C:\Program Files\My Applications\commsvr.exe" -f "D:\My Project\setting.dat"
        
[Tip] Tip

If a certain application or executable is not within the Program Files folder by default (e.g calc.exe), the application could be moved to Program Files (this action would usually need administrative rights) so it will be launched.


 Special Location Name

The following special location names are supported:

<BROWSER>

This will launch the user default browser if the current user has configured one, otherwise, it will launch the system default browser.

<BROWSER:BrowserName>

This syntax can be used to specify which browser to use without spelling out the full path of the browser. The browser name supported depends on the browser installed and detected by server. You can get the exact name under server's Tools > Default Browser menu.

<HOMEPAGE>

This syntax can be used to specify the project homepage.

 

Example 5.2. Pre- and post-launch special location names

"<BROWSER>" "<HOMEPAGE>index.html"
"<BROWSER:Internet Explorer>" "<HOMEPAGE>page1.html"
"<BROWSER:Google Chrome>" "<HOMEPAGE>page1.html"

 Full Screen Browser

Some browsers support kiosk mode or running in full screen.

Internet Explorer

Internet Explorer can run in kiosk mode with following command line:

 

Example 5.3. Internet Explorer kiosk mode

"<BROWSER:Internet Explorer>" -k "<HOMEPAGE>index.html"
Google Chrome

Google Chrome can run in kiosk mode with following command line:

 

Example 5.4. Google Chrome kiosk mode

"<BROWSER:Google Chrome>" --kiosk "<HOMEPAGE>index.html"
[Tip] Tip

The full screen mode command line syntax is dependent on the selected browser and could be obtained from its relevant web site.


 Multiple Browser Window

Modern browsers usually default to open new window as tab in the same browser window. In order to force the browser to open a new window, please try the following parameter.

Internet Explorer

For newer version of Internet Explorer, if you want to launch each URL in a separate window, you need to specify noframemerging option in command line.

 

Example 5.5. Internet Explorer multiple browser windows

"<BROWSER:Internet Explorer>" -noframemerging "<HOMEPAGE>page1.html"
"<BROWSER:Internet Explorer>" -noframemerging "<HOMEPAGE>page2.html"
"<BROWSER:Internet Explorer>" -noframemerging "<HOMEPAGE>page3.html"
Google Chrome

For Google Chrome, if you want to laucnh each URL in a separate window, you need to specify --new-window option in command line.

 

Example 5.6. Google Chrome multiple browser windows

"<BROWSER:Google Chrome>" --new-window "<HOMEPAGE>page1.html"
"<BROWSER:Google Chrome>" --new-window "<HOMEPAGE>page2.html"
"<BROWSER:Google Chrome>" --new-window "<HOMEPAGE>page3.html"
[Tip] Tip

The new window command line syntax is dependent on the selected browser and could be obtained from its relevant web site.


 Multiple Commands and Multiple Monitors

If there are more than one monitor connected to the computer and multiple commands are specified, server will distribute the visible window of each program defined in Pre-launch and Post-launch to all monitors.

  • If number of visible window equals number of monitor, each monitor will show one program maximized.

  • If number of visible window is less than number of monitor, the monitors in the middle of arrangement will show one program maximized.

  • If number of visible window is more than number of monitor, the programs will be distributed among all monitors with more program windows shown at monitors arranged at both sides.

  • Monitors are assigned the order from left to right following the arrangement defined in Windows Display control panel.

[Note] Note

For Internet Explorer, if kiosk mode is specified, the window will always be opened at the monitor where the last Internet Explorer window was closed, and server will not be able to reposition the kiosk mode window.


[Note] Note

For Google Chrome, if there is any Google Chrome window opened before Pre-launch and Post-launch runs, the server will not be able to reposition the new window.