Return username instead of computername in a ThinApp

File:VMware ThinApp v4.0 icon.pngOne of the lesser known features of VMware ThinApp is that you can supply a Virtual Computer name.

This is documented as follows in the package.ini reference guide:

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

The result is that when the virtualised application read the computername via the GetComputerName or GetComputerNameEx API function the supplied name will be returned.

There are various scenario’s where this parameter is convenient, some examples:

  • Applications that have a computer bound license or activation
  • Applications that store settings per computer instead of per user

In the first example the solution is simply to fixate the computername. You might also want to fixate the volume serial number. See License check fails on Citrix XenApp for an example.

The second example is especially problematic in VDI Environments (user could have a different machine each day) or SBC (load balancing over a farm of servers).

For a natively installed application we can use the Terminal Server Application Compatibility mechanism to return a username instead of a computername.

With ThinApp we can simply set the VirtualComputerName to an environment variable, so we can solve the problem like this:

[BuildOptions]
VirtualComputerName=%USERNAME%
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *