Changing Eclipse RCP Launch Attributes in a Secure Directory

I am using internationalization for my RCP application. The Settings tab allows the user to choose between languages. I understand that Eclipse (3.7) must load the language at startup and cannot dynamically change languages.

I know three approaches to this: 1) Change the OS-level shortcut to go to -nl XX 2) Change the app.ini file to -nl XX (on separate lines) 3) Change config.ini to have osgi.nl = XX

The problem with these approaches is that they all require write permissions to the application directory. When working under versions of Vista / Windows 7 and Linux that do not provide write access for programs, the average user does not have the right to modify these files.

Is there any other approach to passing in arguments that change the language of the VM? Is there a way to circumvent file protection provided by the OS?

+4
source share
1 answer

On Windows, the application directory is write-protected for a good reason. Fortunately, you can install the Eclipse Runtime Options to configure where the RCP application should be stored.

  • configuration data
  • workspace data

There are two ways to do this:

  • command line options (-configuration, -data)
  • definition of system properties (osgi.configuration.area to, osgi.instance.area to), for example, in config.ini

For more information, see Runtime Settings in the Eclipse Official Help .

On Windows, such data must be stored in the user directory. By the way, you can find these options in the Installation Information panel in the About Standard dialog box.

However, setting these properties is a bit complicated. In my case, the application installer estimates the location of the user directory during installation and modifies the config.ini file accordingly.

+2
source

Source: https://habr.com/ru/post/1431993/


All Articles