Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 62158 - Show license dialog when user did not accept license during installation
Show license dialog when user did not accept license during installation
Product: platform
Classification: Unclassified
Component: -- Other --
All All
: P2 (vote)
: 5.x
Assigned To: mslama
Depends on: 62791 62829 62831
  Show dependency treegraph
Reported: 2005-08-11 13:27 UTC by mslama
Modified: 2008-12-22 18:41 UTC (History)
1 user (show)

See Also:
Issue Type: TASK

Diff (672 bytes, text/plain)
2005-08-11 13:49 UTC, mslama
New files to be added (4.63 KB, application/octet-stream)
2005-08-11 13:50 UTC, mslama
Correct original diff (for completness) (20.01 KB, text/plain)
2005-08-16 09:26 UTC, mslama
Modified new files 1 (12.52 KB, application/x-compressed)
2005-08-16 14:03 UTC, mslama
Modified diff1 (21.37 KB, text/plain)
2005-08-16 14:04 UTC, mslama

Note You need to log in before you can comment on or make changes to this bug.
Description mslama 2005-08-11 13:27:09 UTC
Task is to maake sure that user accept license if she does not use installer to
install IDE. (When user uses installer she must accept license during
installation.) This should be done per user not per user dir to avoid repeated
license dialog when the same user creates new user dir. License must be shown
very soon. As there is similar task (import of user dir) I decided to use the
same property and not to introduce another class/system property for this task.
(Of course it can be separeted completely if necessary ie. create separate
module, separate system property,...). At this moment there is only added new
method to existing netbeans.importclass.

There are 3 markers:
1.File $NBINSTALLDIR/$nbcluster.dir/var/license_accepted.
2.File $netbeans.home/var/license_accepted.
3.In user preferences node org.netbeans.core.startup.Main.class there is key   
                string "LICENSE" + "|" + [IDE (License) version] + "|" + [MD5
fingerprint of install dir]. Special key is in Bundle for [IDE (License) version].
MD5 fingerprint is used because key length in default preferences implementation
is limited to 80 characters.

How it works:
1.Installer creates file $NBINSTALLDIR/$nbcluster.dir/var/license_accepted.
2.IDE starts and looks for var/license_accepted. If it is found check passes.
3.If it is not found user preference is checked for given key. If key is found
with any value check passes.
4.If key is not found license dialog is displayed. If user does not accept
license IDE exits.
5.If user accepts license preference key is created and marker
var/license_accepted is created in user dir. (It is created to speed up check as
then only 2 is necessary to pass test. Positive check of preference key is about
4 times slower than looking for file using InstalledFileLocator. By this way
positive test takes about 100ms according to my measurement.)

UI: Simple JEditorPane and JOptionPane is used to display license (it is similar
to license dialogs used when building IDE from sources).
Comment 1 mslama 2005-08-11 13:49:32 UTC
Created attachment 23722 [details]
Comment 2 mslama 2005-08-11 13:50:51 UTC
Created attachment 23723 [details]
New files to be added
Comment 3 mslama 2005-08-11 13:55:30 UTC
Note: Currently license text is directly in module updater jar. As license will
be added to nb cluster UI will use it and it will be removed from jar.
Comment 4 Jaroslav Tulach 2005-08-16 06:46:23 UTC
Where is the change to core/startup code? I cannot find any. 
However I am affraid that there is small problem. If I am not mistaken, you 
are reusing netbeans.importclass and searching for method acceptLicense in it. 
This may cause problems to our partners using the property in earlier versions 
and not defining the acceptLicense there.  
Of course, this is just friend contract, but maybe the correct way is to add 
new property? 
Comment 5 mslama 2005-08-16 07:40:15 UTC
Oops I attached incorrect diff.

If there can be problem with anyone else using this friend API I will introduce
new system property 'netbeans.acceptlicenseclass'. Then it is necessary also to
modify IDE launcher to define new property. I assume it is not necessary to
create separate module for it. I just create new class. I will modify sources
and attach modified and correct diff.
Comment 6 mslama 2005-08-16 09:26:24 UTC
Created attachment 23880 [details]
Correct original diff (for completness)
Comment 7 mslama 2005-08-16 14:03:55 UTC
Created attachment 23940 [details]
Modified new files 1
Comment 8 mslama 2005-08-16 14:04:25 UTC
Created attachment 23941 [details]
Modified diff1
Comment 9 Jaroslav Tulach 2005-08-17 11:18:06 UTC
Ok. I guess. Btw. you can do cvs add and then use cvs diff -N to generate diff 
even for new files. 
Comment 10 mslama 2005-08-19 08:43:44 UTC
Today I am going to modify License dialog UI according to UI review and add some
details about logic (The same description as given above.) I am going to commit
changes on Monday.

Last undecided issue is if license text should be in jar or not. I prefer to
have license text in jar so that jar will be independent and solution will be
more robust. License text is also present in nb cluster dir to be available to
user. But if it would be deleted from nb cluster this dialog could not work.
License is now small (~15KB) so saved disk space is not issue here.
Comment 11 mslama 2005-08-22 15:21:46 UTC
Fixed in main trunk.

new revision: 1.31; previous revision: 1.30

new revision: 1.6; previous revision: 1.5

new revision: 1.3; previous revision: 1.2

initial revision: 1.1

new revision: 1.3; previous revision: 1.2

new revision: 1.11; previous revision: 1.10

new revision: 1.23; previous revision: 1.22

new revision: 1.2; previous revision: 1.1

initial revision: 1.1

initial revision: 1.1

initial revision: 1.1

initial revision: 1.1

new revision: 1.17; previous revision: 1.16

new revision: 1.2; previous revision: 1.1

new revision: 1.2; previous revision: 1.1

new revision: 1.13; previous revision: 1.12

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo