Multiple Instances of an Application with ThinApp
Here is a little overview kinda q&a style of running multiple instances of an application with VMware ThinApp.
I can’t run more than one instance of my ThinApp?
Have you ever tried to ThinApp multiple instances of Adobe Reader or Firefox and then execute them at the same time on the same system? If you have, then you’ll know it doesn’t work!
Why is that??
This is because the application (in our examples here, Firefox and Adobe Reader) check to see if an instance of the application is already being executed. Now, most applications will not check to see if there is already an instance of the app’s primary process being executed and residing in memory. However, more and more applications are starting to do this.
Why doesn’t ThinApp resolve this?
First and foremost, ThinApp does not (and will not ever) virtualize the process list. While there are a number of reasons for this, the simplest explanation is, hiding the processes of an application is a bad thing! It’s what black hatters (a.k.a. bad hackers) do.
Secondly, this is not an issue with ThinApp but rather the application which you are attempting to package with ThinApp as the application is probably designed to re-use the parts of itself already in memory vs. executing additional copies of itself for whatever reasons (maybe the application requires a large amount of memory to execute one instance of itself or maybe it can only lock certain files or memory addresses once).
So how can I make multiple instances of my application work under ThinApp?
The solution is actually not directly a ThinApp solution, but an application solution, since it is an application issue. In our examples of Adobe Reader and Firefox above, these applications look for previous running instances of themselves to save on memory and screen real estate. This functionality for these two applications is solved very simply by a command line switch which disables the check for an existing instance of themselves. In the case of Adobe Reader, the command line switch is a “-k”. For Firefox it is a “–no-remote” command line switch.
How do I configure my ThinApp package to utilize a Command Line switch?
Very simply, make an entry point or modify an existing entry point and add the “CommandLine=” entry to the Entry Point. It’s value will be the “source” plus the command line switch or switches you wish to add.
Example: Here’s an example of Firefox with a CommandLine entry to disable the pre-existing instance checking (i.e. allow multiple instances of Firefox).
Shortcuts=%Desktop%;%Programs%\Mozilla Firefox;%AppData%\Microsoft\Internet Explorer\Quick Launch
CommandLine=%ProgramFilesDir%\Mozilla Firefox\firefox.exe –no-remote
How do I find Command Line Switches or Arguments for my application?
Here’s where I can’t be a lot of assistance (since there are millions of Windows apps). I usually Google these myself. A good reference, though, is Rob Vanderwoude’s Command Line Switches page, which is worth reading.
Probably the best suggestion I can give you is to open your favorite browser, go to your favorite Search Engine, and search for your application’s command line options using one of the following set of keywords.
“<your app> Command Line Options”
“<your app> Command Line Switches”
“<your app> Command Line Arguments”
If none of these work, I would then suggest browsing your application manufacturer’s support section of their web site for these. If not found here, my only other suggestion is to contact your application’s manufacturer by phone or email for this information.
My application doesn’t have Command Line Option for allowing multiple instances? Is there anything else I can do?
If you’ve contacted your application’s manufacturer and they have specifically told you a command line option doesn’t exist to allow multiple instances to be executed…all is not entirely lost (I’d be surprised if this were the case since this means the app likely won’t run on a Terminal Server). My suggestion here is make an official request to the app manufacturer requesting this feature. Next, there are scripting options and potentially 3rd party options.
For scripting options, see the ThinApp Scripts section for support. It may be possible to use a validation option to see if the application is already running since virtually anything scripted can be ThinApp’ed. While there are numerous ways you might be able to make this work (I won’t speculate as the options are nearly infinite here) the worst case here is you just don’t let the 2nd instance execute until the 1st instance is shut down.
The same thing goes for 3rd party solutions – you may be able to make your own application “wrapper” or have one built which accomplishes a viable goal.
One other thing, check to see if you can rename the source EXE (in my Mozilla Firefox example that would be “firefox.exe”) to something different. This, combined with a script, could accomplish the goal to execute multiple instances of the app at the same time.