Guide: How Virtual Apps work
Sometimes when you're deploying an app you actually need to deploy more than one 'runnable thing'. As an example, imagine you're deploying something like OpenOffice and you want to have an app for spreadsheets, one for word documents, one for presentations etc:
Alternatively maybe your app really is just one app but you want to let the user run a configuration utility separately from your app (some games might be a good example of this).
This is the idea behind Apps versus Virtual Apps in JWrapper.
Your App Bundle is the whole downloadable, installable bundle that sets up its own JRE and extracts all the files. Inside that though JWrapper lets you define multiple Virtual Apps, each of which the user ends up seeing as a 'runnable thing'.
Exactly how the user sees this depends on the OS. On Windows and Linux they get a shortcut for each one but MacOS is a bit different. MacOS doesn't have the concept of a 'start menu' with folders for grouping so if you wanted to deploy all the 8 virtual apps above you'd end up with quite a disjointed mess in your Applications folder. Instead, JWrapper puts one app into the Applications folder and shows a chooser to the user when it launches:
This is the idea behind Apps versus Virtual Apps in JWrapper.
Your App Bundle is the whole downloadable, installable bundle that sets up its own JRE and extracts all the files. Inside that though JWrapper lets you define multiple Virtual Apps, each of which the user ends up seeing as a 'runnable thing'.
Exactly how the user sees this depends on the OS. On Windows and Linux they get a shortcut for each one but MacOS is a bit different. MacOS doesn't have the concept of a 'start menu' with folders for grouping so if you wanted to deploy all the 8 virtual apps above you'd end up with quite a disjointed mess in your Applications folder. Instead, JWrapper puts one app into the Applications folder and shows a chooser to the user when it launches:
Virtual Apps though aren't just to let the user choose between different things they can run. You can configure them to be invisible to the user and then use them under the hood in your application.
When you create a virtual app in JW you can make it hidden and then use the JWSystem.forkVirtualApp method to run it. You can pass in launch properties rather than command line parameters which removes OS specific issues of encoding or special characters along with any limits on how much you can pass to your child app. You can have it check for an update before it runs and you can also ask it to prompt the user for elevated permissions.
When you create a virtual app in JW you can make it hidden and then use the JWSystem.forkVirtualApp method to run it. You can pass in launch properties rather than command line parameters which removes OS specific issues of encoding or special characters along with any limits on how much you can pass to your child app. You can have it check for an update before it runs and you can also ask it to prompt the user for elevated permissions.
How to create virtual apps
To define a virtual app you should add a top level <App> tag and then you can use the following tags within that:
To see a sample <App> definition have a look at the top of the sample JWrapper XML configuration file
- <Name> the name of your virtual app, this will be visible to the user via the chooser if it is a user accessible app
- <LogoPNG> a PNG file for the logo of your virtual app, will be used for Windows/Linux shortcuts to this virtual app and also in the chooser if it is shown.
- <MainClass> the main class of your virtual app
- <UserAccessible> whether this is a user visible virtual app or one that will only be used / launched by your other virtual apps (this is used when specifying virtual apps that extend and customise the install for example)
- <Param> (can specify more than one) command line parameters for your virtual app. Any parameters added to the command line when your app is launched will be appended onto these.
To see a sample <App> definition have a look at the top of the sample JWrapper XML configuration file