Sample JWrapper App XML Configuration File
A JWrapper XML configuration file looks like this (you can copy / paste this file and modify it to suit if you like).
<JWrapper> <!-- This tells JWrapper the name of your app bundle, you should use only letters, spaces and numbers here --> <BundleName>MinimalApp</BundleName> <!-- This bit defines a virtual app - your app bundle can have one of these or a bunch of them --> <App> <!-- The name of the app that launches --> <Name>MinimalApp</Name> <!-- The logo for the app, we automatically scale and convert it to OS specific formats --> <LogoPNG>minimal_logo.png</LogoPNG> <!-- The Java main class for your app --> <MainClass>jwrapper.minimal.AppMain</MainClass> <!-- Any static parameters you want to pass in to your main method --> <Param>one</Param> <Param>two</Param> </App> <!-- Optionally specify the output folder for your builds, NOTE that that build folder will be deleted before each build --> <BuildOutputFolder>mybuild</BuildOutputFolder> <!-- This tells JWrapper what languages your app uses so JWrapper can let the user choose (if its more than one) --> <SupportedLanguages>en,fr</SupportedLanguages> <!-- If your app needs to run elevated (as admin) on Windows you can specify that here --> <WindowsElevation>None</WindowsElevation> <!-- This app installs itself for the current user, you can also install for all users (AllUsers) or run as a temporary executable (NoInstall) --> <InstallType>CurrentUser</InstallType> <!-- This is the optional update URL for the app, if the files here get updated the app will auto update--> <UpdateURL>http://minimal.jwrapper.com/</UpdateURL> <!-- This specifies the splash image for your app bundle, we automatically scale it and convert it to OS specific formats --> <SplashPNG>minimal_splash.png</SplashPNG> <!-- This specifies the logo for your app bundle, we automatically scale it and embed it in your native exes --> <BundleLogoPNG>minimal_bundle_logo.png</BundleLogoPNG> <!-- Here's where you specify your Windows 32 bit JRE, note that you can use a 32 bit JRE on 64 bit Windows --> <Windows32JRE>../windows/jre1.6.0_16</Windows32JRE> <Windows64JRE>../windows/jre1.6.0_16</Windows64JRE> <Linux32JRE>../linux/jre1.6.0_16</Linux32JRE> <Linux64JRE>../linuxx64/jre1.6.0_16</Linux64JRE> <Mac64JRE>../mac64/jre1.7.0_40</Mac64JRE> <!-- Here's where you can add JAR files or whatever else your app needs to run --> <File classpath='yes'>lib/minimal.jar</File> <File classpath='no' path='translations.properties'>resources/translation.properties</File> </JWrapper> |
Optional Extras
The file above is just a simple example of how easy it is to get up and running with JWrapper. But its much more powerful than that. Below are some optional extras.
<!-- By default we strip any unnecessary files out of your JVMs to save you space (don't worry! we stick to the Oracle licensing agreement), but you can turn that off here --> <NoStripJREs>true</NoStripJREs> <!-- You can optionally specify any JVM options here, JWrapper will test these before picking up a system JRE --> <JvmOptions> <JvmOption>-Xmx256m</JvmOption> <JvmOption>-Xss64m</JvmOption> </JvmOptions> <!-- You can have as many virtual apps as you like. On Windows and Linux they each get a shortcut. On MacOS we show a chooser. You can also extend the JWrapper installer just by writing Java classes as part of your app, like this one to do a thorough check on an imported system JRE--> <App> <Name>JWrapperJreCompatibilityApp</Name> <LogoPNG>minimal_logo.png</LogoPNG> <MainClass>jwrapper.minimal.CheckJREisOK</MainClass> <!-- You can hide apps like this from the user so that they can't launch them --> <UserAccessible>false</UserAccessible> </App> <!-- Set any launch properties in here. These are parameters that JWrapper passes through to your app that you can query using the JWSystem API. They don't have the same limits and restrictions as command line arguments. JWrapper understands a range of 'standard' dynamic launch properties so you should prefix these with a string that is specific to your organisation.--> <DynamicLaunchProperty> <Name>mycompany.name</Name> <Value>My Company</Value> </DynamicLaunchProperty> <!-- JWrapper can automatically sign your Windows exe and Applet using the same certificate on any platform! --> <SignForWindowsAndApplet> <KeyStore>MyCertificates/verisignkeystore</KeyStore> <KeyStoreType>JKS</KeyStoreType> <Alias>mycompany</Alias> <Password>BlahBlahBlahBlahBlahBlah</Password> <!-- We support timestamping too --> <WinTimestampURL>http://timestamp.verisign.com/scripts/timstamp.dll</WinTimestampURL> <AppletTimestampURL>https://timestamp.geotrust.com/tsa</AppletTimestampURL> <!-- We use jarsigner from your JDK for the applet but we know that different devs have different setups so you can specify as many possible jarsigner paths as you like --> <JarSignerPath>C:\Program Files\Java\jdk1.6.0_18\bin\jarsigner.exe</JarSignerPath> <JarSignerPath>/usr/bin/jarsigner</JarSignerPath> </SignForWindowsAndApplet> <!-- JWrapper can also automatically sign your MacOS .app using your Apple developer certificates on any platform! --> <SignForMac> <AppleRootCertificate>Certificates/AppleIncRootCertificate.cer</AppleRootCertificate> <DeveloperIdCertificate>Certificates/DeveloperIDCA.cer</DeveloperIdCertificate> <DeveloperIdP12>Certificates/DeveloperID.p12</DeveloperIdP12> <DeveloperIdAlias>my company dev key</DeveloperIdAlias> <DeveloperIdPassword>BlahBlahBlahBlah</DeveloperIdPassword> </SignForMac> <!-- If your app needs to run elevated (as admin) on Windows you can set whatever options you need --> <WindowsElevation>None/AsInvoker/HighestAvailable/RequireAdministrator</WindowsElevation> <WindowsElevationUiAccess>true</WindowsElevationUiAccess> <!-- If you want to speed up your builds during debug or to make your app launch a little faster you can disable packing --> <Pack200Effort>0</Pack200Effort> <!-- Set to false if you wish to prevent App Napp on OS X. Default is true --> <AllowOsxAppNap>false</AllowOsxAppNap> |