Search code examples
eclipse-rcprcpini

How to handle spaces in launcher.ini file of RCP product configuration


I use the launcher.openfile feature from eclipse in my RCP app and so the .ini file of my product contains:

--launcher.defaultAction
openFile

In order to make this work with my app the launcher name has to be the same as the main window name of my rcp app. My main window label is set with the product name. The launcher name is set via the Launcher tab of my product configuration file to:

myLauncherName which results to a myLauncherName.exe after the build process of my app with maven and tycho

My product name has spaces in it:

My Product App

I do not want a long launcher name so I have to set the -name property in the .ini file. Therefore I set the Program Arguments in my product configuration editor to:

--launcher.defaultAction
openFile
-name
My Product App

But when I build my product I get an .ini file with the following content:

--launcher.defaultAction
openFile
-name
My
Product
App

How can I prevent spaces in the Program arguments being replaced by carriage return/linefeed after the build process with maven and tycho? I even tried to insert xml space signs (&#32) without any luck. Or is there a way to use a variable in the .ini file? Something like ${product.name} would be nice to have always the same name like my main window.


Solution

  • The appName property of the product configuration in the RCP plugin.xml sets the application name with running in to problems with spaces.

    <extension
          id="product"
          point="org.eclipse.core.runtime.products">
       <product
             name="%product.name"
             "org.eclipse.e4.ui.workbench.swt.E4Application">
          <property
                name="appName"
                value="%product.name">
          </property>
    

    This is also using %xxx to get the text from the bundle.properties