blob: 5a4dac89c44b16eb616a0e8bc385c07e83230f40 [file] [log] [blame]
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
= DevInstallerAddVersioningInfo
:jbake-type: wiki
:jbake-tags: wiki, devfaq, needsreview
:jbake-status: published
:keywords: Apache NetBeans wiki DevInstallerAddVersioningInfo
:description: Apache NetBeans wiki DevInstallerAddVersioningInfo
:toc: left
:toc-title:
:syntax: true
== How to add versioning information to be shown in "Installed Programs" (Windows-only)?
Question from mailing list: _"How to add version information into windows control panel for NetBeans platform applications? When the installer ran then it only added "Installed On" information for my application."_
=== Solution
What you are asking about is the information shown in MS Windows Control Panel --> Installed Programs (at least that's how you find it on Win7). First thing to realize is that Windows treats this pretty much as display info. It serves no other purpose than to be displayed in that window. It is up to the software publisher how many of these properties he wants to define. You can find a list of these properties here:
link:http://msdn.microsoft.com/en-us/library/aa372105%28v=vs.85%29.aspx[http://msdn.microsoft.com/en-us/library/aa372105%28v=vs.85%29.aspx]
You'll find that even official MS applications, like MS Word, only uses a subset of these properties. The most important ones, IMO, is "DisplayVersion" and "Publisher". Again, remember that this is nothing but text strings. Windows doesn't use them for anything. The one you ask about is "DisplayVersion".
Ok, so how can NBI support this? As these "properties" are nothing but Windows Registry keys you could set them in a native script. However NBI actually has support for this. All you need to do is override your ConfigurationLogic.java file and more specifically override the getAdditionalSystemIntegrationInfo() method to include the Registry keys you want.
Here's what I do:
[source,java]
----
/**
* Add additional properties that are specific to the platform. Currently
* only used for Windows. These properties will be displayed in the Windows
* Control Panel --> Installed Programs. Some of these will be displayed in
* the window's table (like "Publisher" and "DisplayVersion") while others
* (like "URLInfoAbout") are only displayed when a line in the table is
* highlighted. However the user can customize what columns to show in the
* table by right-clicking on any of the columns.
*
* NBI will take whatever you put in the Map below and set it as Windows
* Registry keys so you need to know the name of the appropriate Windows
* Registry key. Here's a list:
* http://msdn.microsoft.com/en-us/library/aa372105%28v=vs.85%29.aspx
*
* Beware that many of these keys are pretty much unused by software
* publishers, even Microsoft itself. Concentrate on "DisplayVersion" and
* "Publisher".
*
* @return
*/
@Override
public Map<String, Object> getAdditionalSystemIntegrationInfo() {
Map<String, Object> map = super.getAdditionalSystemIntegrationInfo();
if (SystemUtils.isWindows()) {
map.put("DisplayVersion", getString("CL.winsystem.display.version"));
map.put("Publisher", "Montana Wonder Systems Inc");
map.put("URLInfoAbout", "http://www.montanawondersys.com");
map.put("URLUpdateInfo", "http://www.montanawondersys.com");
}
return map;
}
----
With this NBI will take care of setting the Registry Keys.
How you actually override the ConfigurationLogic.java file depends if you're using Ant or Maven. You should be able to figure it out with some Googling.
Provided in the platform-dev mailing list by Peter Hansson
=== Apache Migration Information
The content in this page was kindly donated by Oracle Corp. to the
Apache Software Foundation.
This page was exported from link:http://wiki.netbeans.org/DevInstallerAddVersioningInfo[http://wiki.netbeans.org/DevInstallerAddVersioningInfo] ,
that was last modified by NetBeans user Markiewb
on 2014-12-28T20:56:56Z.
*NOTE:* This document was automatically converted to the AsciiDoc format on 2018-02-07, and needs to be reviewed.