The VirtualComputerName parameter determines whether to rename the computer name, to avoid naming conflicts between the capture process and the deployment process.

Applications can use the name of the computer on which they are installed, or connect to a database and use the name of the computer in the connection string. Because the capture process is different from the deployment process, captured applications that require a computer name must add the computer name to the virtual package to ensure that the application can run on any machine.

ThinApp comments out the initial setting of the VirtualComputerName parameter. This parameter uses a string that the GetComputerName and GetComputerNameEx API functions return in a virtual application.

Including a Virtual Computer Name

This example shows how the VirtualComputerName parameter creates a second name for a computer named LOCALHOST, which will be captured in the virtual application. The application uses the second name to connect to a virtual machine. If the capture system lacks the LOCALHOST name, ThinApp comments out the VirtualComputerName parameter.


If you rename a clean machine as LOCALHOST before performing the capture process, the Package.ini file activates the name that the VirtualComputerName parameter created. The virtual application works with the renamed LOCALHOST name because any computer that the application runs on receives this value as the computer name.

If you run a GetComputerName or GetComputerNameEx command, the computer returns LOCALHOST. If the Windows system requires the GetComputerName and GetComputerNameEx commands to operate in a standard way and return the actual name of the computer where the application runs, do not rename the machine as LOCALHOST.


Including an Environment Variable

In addition to specifying a literal string such as LOCALHOST, you can include an environment variable.

When you specify an environment variable, the value returned is the value of the environment variable. If the value of the VirtualComputerName parameter is %VCOMPNAME%, and the %VCOMPNAME% environment variable is set to EnvCompName, the GetComputerName API returns EnvCompName.