How to change Eclipse RCP product exe properties - eclipse

I am using Maven with Tycho plugin to materialize the Eclipse RCP product. What I need is when I right-click the product exe file and choose properties I need some relevant information onthe Details tab (File Description, Product Name, Product Version...).
Now I have found so far, that this could be achieved with .rc file with VERSIONINFO statement
(see Comment 10 at this bug). I also found in tycho-user mailing list that rc file CAN be included in Tycho build to achieve the desired behavior. Nontheless I was unable to find out where to put the rc file, or how to name it or where to set its location.
Thanks

You are misreading the bugzilla discussion, as that is only possible by self-compiling the eclipse launcher source (with a modified rc file).
However, there is an alternative: You can patch the launcher executable manually (using any kind of resource editor) and then put it into your product as root file. This works with tycho, I use that approach. The drawback is of course that this executable will not be updated, if you change branding details in the product definition file.
Alternatively to a root file you could also overwrite the launcher executable during an installation creation (outside of Eclipse). E.g. we create an NSIS installer around an RCP app and can also modify it there.

Related

Eclipse Plugin's plugin.xml file doesn't add a menu or export wizard specified in plugin.xml

I am trying to add a export action to the Eclipse File > Export dialog. I've tried adding it through plugin.xml (see below update about dropins vs plugins folder) and while it works in a Mars 2 (Eclipse Platform / RCP version 4.5.2) instance it does not work with version 4.6.2 where I'm intending to use the jar. Previously the plugin.xml did not work also for a menu item, however I was able to do that programmatically (but seemingly not add an export wizard programmatically).
Update 2: It seems it may have to do with the eclipse's configuration config.ini file or Equinox Transforms (see https://wiki.eclipse.org/Equinox_Transforms). I think it may be the later because the plugins run and you can add ui elements later (like the aforementioned menu) with programming, but not with the plugin.xml. Also the config.ini makes reference to the Equinox Transforms class.
Update 1: The plugin.xml not running seems to be related to something to do with the dropins folder.
Foo.jar provides some exports and was provided by the vendor through a P2 update site I believe and exists in a plugins folder.
When I rename Foo.jar to Foo.jar.old and re run the app (with -clean) the exports are removed (Good)
When I name it back to Foo.jar in the plugins folder it re adds the exports on startup (Good)
When I move Foo.jar to the dropins folder the plugin DOES LOAD (it's listed in Help > Installation Details > Plugins), however the export options specified in the plugin.xml are not populated. (Bad)
Is there a difference between the eclipse dropins folder and the eclipse plugins folder of a P2 update site?
I have since confirmed it was a Equinox Transform in use (it shows up in the plugin list). Upon searching for jar files mentioning transform one had the xlst files in the jar and unzipping them, editing them, rezipping them to a jar file and replacing the original fixed the problem (I did have to run eclipse.exe -clean otherwise it did cache the old one and seem not to work).
Also of note look at the config.ini it should make reference to Equinox Transforms.

Debugging eclipse e4 source code

I have an Eclipse e4 RCP project using the compatibility layer.
The targets include org.eclipse.e4.* plug-ins and their source code. For example:
$ ls org.eclipse.e4.core.di*
org.eclipse.e4.core.di.extensions.source_0.12.0.v20140417-2033.jar
org.eclipse.e4.core.di.extensions_0.12.0.v20140417-2033.jar
org.eclipse.e4.core.di.source_1.4.0.v20140414-1837.jar
org.eclipse.e4.core.di_1.4.0.v20140414-1837.jar
The launcher configurations include the plug-ins without source code.
Source code for classes within those plug-ins is not being found with Navigate>Open Type or when debugging. In the debugger, I'm given a button Edit Source Lookup Path -- but I'd like the source path to automatically update when I switch targets.
I can make that happen by adding these plug-ins to the manifest of one of my plug-ins. However, these are not direct dependencies, and it seems inelegant to list these here.
Adding the plug-ins to the product configuration file does not appear to help.
How can I automatically access the current target's source code within the org.eclipse.e4 packages, when debugging, and when using Navigate>Open Type?
You include the target platform plugins in the Java searches (including Navigate > Open Type) by checking the
Include all plug-ins from target in Java search
check box on the Preferences > Plug-in Development preference page.
The first time after this that you use Navigate > Open Type or another search it may be a bit slow while the Java indexer runs on the extra source files. It should run normally once the indexes are built.

Eclipse RCP product - is there anyway to update the PATH during launch

I am working on an eclipse RCP product on windows which internally uses some native binaries (dlls) located in a folder called "bin" which would be available as a part of the product.
I need to make sure that the folder "bin" is present in the PATH when the product.exe file is executed. Is there a clean way to make sure that the folder "bin" is added to PATH when the eclipse RCP product is launched?
I don't want to write any script or batch file that updates the PATH and then calls the product.exe. I also don't want to update the environment variable through the windows UI or command prompt.
I know that when we try to run my product from the eclipse IDE environment, there is an option in the run-configuration, wherein one can configure Environment variables on the Environment tab. I can append the "bin" folder to the PATH by creating a new environment variable called "Path" whose value is C:\EclipseRCPProduct\bin;${env_var:PATH}.
However - I would like to do the same when I run my product directly from the Product.exe which is generated. Does anyone have any idea regarding this?
Also - if anyone has any idea regarding the eclipse code which processes the information specified on the Environment tab of the run configuration, it would be great. I could try playing around with the code to see if I could get it to work when the product is launched from outside eclipse IDE - via the generated RCP product.exe
I don't think there's a way to define system environment variables within the launcher.
The following bug seems to request just that
https://bugs.eclipse.org/bugs/show_bug.cgi?id=286463
In the above mentioned bug, a .bat is attached to achieve your goal.
That said, why do the native binaries have to be located in a bin folder?
I.e. why are they not included in a plugin/fragment?

exclude files from jar or war in eclipse

Is there a way to tell Eclipse to not include specified files, directories, or patterns in a JAR or WAR?
You can specify includes and excludes by opening the Project Properties (alt-enter) then opening Java Build Path and the Source tab. Against each source location there is a little plus sign, click on that then select Included or Excluded then select the Edit... button.
source path screenshot http://help.eclipse.org/ganymede/topic/org.eclipse.jdt.doc.user/gettingStarted/images/qs-WorkingWithExistingLayout26.png
You can then specify multiple patterns for files to be included/excluded. These files will not be processed to the output directory. The patterns follow Ant's wildcard patterns so you have quite fine-grained control over what to include.
(source: eclipse.org)
We fought with this problem too and didn't find a good standard solution for it in Eclipse WTP.
Hence we added Project Archives to JBoss Tools (http://jboss.org/tools) which allow you to control explicitly via "ant filter sets" what goes in and what goes out of your archive.
This archive you can then deploy with the standard WTP mechanism for deployment on the server types supplied by JBoss tools.
We are working on adding similar support back into native Eclipse WTP, but that won't be available until sometime next year.
to add to what #Rich_Seller said: in Eclipse Indigo:
Select your package from the package view right click, and choose Export.
Choose Java -> JAR file from the "select an export destination" tree.
Click Next to go to the next page of the wizard.
Under the "Select the resource to export" you are presented with a
tree view here you can select and deselect components that will be
included and excluded from the JAR.
I think including an XML file in another and then removing its visibility in the war file should give you an on off switch.

how to add a tool to eclipse-cdt to automatically generate a header file during make

I have a tool that converts an data file into a C header file for inclusion into my project.
Now I would like to have this tool run automatically during make whenever the data file changes.
Where can I tell Eclipse CDT which tool to run and what data file the header depends on?
The article "Extending the Eclipse CDT Managed Build System" can give a concrete example of the managed build system (MBS) of CDT.
The MBS can be extended by modifying/adding a "tool" to the tool-chain (An ordered set of tools used to transform the project resources into the final output (build artifacts) of the project)
You should be able to add your tool, and set it up to be active for each file modification.
Open the properties of your project. There is an entry "Builders" where you can add other executables to the build.