Bruce Schubert
|
Posted: September 24, 2010 14:40 by Bruce Schubert
|
|
I decided to use the NetBeans built-in license checking in lieu of using an install program to perform the license acceptance since I couldn't get the new platform installers to install correctly on macs. Here's how I got it to work. Emxsys - CPS License Module --------------------------- The purpose of this module is to display the software license to the user upon the first invocation of the program. If the user rejects the license then the application will not run. This module leverages the license check mechanism built into the NetBeans startup classes. To use the built in licensing check, we need to set the netbeans.accept_license_class system property to a class that includes to a public static void showLicensePanel() method that throws an exception if the license is rejected. For example: public static void showLicensePanel () throws Exception {
...
if ("yes".equals(command)) { // NOI18N
return;
} else {
throw new org.openide.util.UserCancelException();
}
}The netbeans.accept_license_class property should be set in the suite's app.conf file. For example: -J-Dnetbeans.accept_license_class=com.emxsys.cps.license.AcceptLicense The showLicensePanel method must be accessible by the org.netbeans.core.startup.Main class. To prevent to a NoClassDefFoundError from being thrown at startup, the module's project.properties file requires the following entry: module.jar.dir=core In summary, the following requirements make this module work: - Created a class that implements the showLicensePanel method. - Added "module.jar.dir=core" to this module's Project Properties (project.properties). - Added "-J-Dnetbeans.accept_license_class=com.emxsys.cps.license.AcceptLicense" to the suite's app.conf file used by the NetBeans launcher. --Bruce Emxsys.com |
CPS License Check via NetBeans
Replies: 0 - Last Post: September 24, 2010 14:40
by: Bruce Schubert
by: Bruce Schubert
showing 1 - 1 of 1
Replies: 0 - Last Post: September 24, 2010 14:40
by: Bruce Schubert
by: Bruce Schubert






