SmalltalkStartup.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sat, 31 Dec 2016 00:05:51 +0000
branchjv
changeset 1485 bde224d85196
parent 1447 0b149293564f
child 1558 36927a04ace3
permissions -rw-r--r--
Cleanup: moved code to accept license to `SmalltalkStartup` Also ask only once and if accepted, remember this so next time user wont be bothered with this. Once is enough, even for lawyers.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1442
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
 COPYRIGHT (c) 2006 by eXept Software AG
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
               2016-now by Jan Vrany <jan.vrany@fit.cvut.cz>
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
              All Rights Reserved
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
 This software is furnished under a license and may be used
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
 only in accordance with the terms of that license and with the
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
 inclusion of the above copyright notice.   This software may not
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
 be provided or otherwise made available to, or used by, any
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
 other person.  No title to or ownership of the software is
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
 hereby transferred.
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
"
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
"{ Package: 'stx:projects/smalltalk' }"
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
"{ NameSpace: Smalltalk }"
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    17
StandaloneStartup subclass:#SmalltalkStartup
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
	instanceVariableNames:''
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
	classVariableNames:''
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
	poolDictionaries:''
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
	category:'Interface-Smalltalk'
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
!
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
!SmalltalkStartup class methodsFor:'documentation'!
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
copyright
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
"
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
 COPYRIGHT (c) 2006 by eXept Software AG
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
               2016-now by Jan Vrany <jan.vrany@fit.cvut.cz>
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
              All Rights Reserved
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
 This software is furnished under a license and may be used
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    33
 only in accordance with the terms of that license and with the
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    35
 be provided or otherwise made available to, or used by, any
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    36
 other person.  No title to or ownership of the software is
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    37
 hereby transferred.
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    38
"
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    39
!
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    40
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    41
documentation
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    42
"
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    43
    Smalltalk/X IDE startup.
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    44
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    45
    For historical reasons, IDE startup is not actually implemented as
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    46
    a StandaloneStartup class as for Smalltalk/X-based applications.
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    47
    Instead, the Smalltalk>>start reads smalltalk.rc and startup procedure
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    48
    is defined there.
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    49
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    50
    In order to reduce a number of .rc script hackery, functionality will be
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
    incrementally moved from those scripts to this class and scripts will be
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
    changed to call methods in this class. Eventually we will reach the point
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
    when scripts will be empty and all functionality will be here. Let's hope.
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
    [author:]
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
        Jan Vrany <jan.vrany@fit.cvut.cz>
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
    [instance variables:]
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
    [class variables:]
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    61
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
    [see also:]
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    64
"
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
! !
14aa87cd5d2d Added SmalltalkStartup class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    66
1447
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    67
!SmalltalkStartup class methodsFor:'startup-to be redefined'!
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    68
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    69
main:argv
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    70
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    71
    "/ Due to a historical reasons (see this class's comment), this 
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    72
    "/ method is called from `smalltalk.rc` startup script manually. 
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    73
    "/ Hopefully at some point we will move all the code from there
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    74
    "/ to here. Hopefully...
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    75
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    76
    | optparser unparsed |
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    77
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    78
    optparser := CmdLineParser new.
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    79
    optparser ignoreUnknownOptions: true.
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    80
    optparser on:#('--package-path PATH') do:[:pp |  
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    81
        (pp asCollectionOfSubstringsSeparatedBy: OperatingSystem pathSeparator) reverseDo:[:e |
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    82
            Smalltalk packagePath addFirst: e  
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    83
        ]
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    84
    ].
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    85
    unparsed := optparser parse: argv.
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    86
    argv isOrderedCollection ifTrue:[
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    87
        argv removeAll; addAll: unparsed.
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    88
    ].
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
    89
1485
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
    90
    "/ Ask user to accept 'Smalltalk/X Software Licence Agreement'. 
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
    91
    "/ This could be suppressed with a command-line argument;
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
    92
    "/ however, if you do so, we assume you have read & accepted it at least
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
    93
    "/ once (since this command-line-argument is not documented, you obviously
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
    94
    "/ read the code below).        
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
    95
    (argv includesAny: #('--noLicenceBox' '--quick' '--faststart' '--fastStart')) ifFalse:[
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
    96
        Smalltalk addStartBlock:[                            
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
    97
        	self acceptLicense 
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
    98
        ].
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
    99
    ]
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   100
1447
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   101
    "
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   102
    SmalltalkStartup main: #('-I' '--quick' '--package-path' '/home/some/packages') asOrderedCollection.
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   103
    Smalltalk packagePath
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   104
    "
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   105
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   106
    "Created: / 28-06-2016 / 23:43:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1485
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   107
    "Modified: / 31-12-2016 / 00:02:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   108
! !
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   109
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   110
!SmalltalkStartup class methodsFor:'startup-utilities'!
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   111
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   112
acceptLicense
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   113
    "
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   114
    Ask user to accept 'Smalltalk/X Software Licence Agreement'. If rejected,
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   115
    exit.
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   116
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   117
    You may find this annoying - but lawers say: 'this is a must ...' ;-)
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   118
    License Agreement is shown only once.
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   119
    "
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   120
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   121
    | licenseAcceptedFile |
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   122
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   123
    licenseAcceptedFile := Filename homeDirectory / '.smalltalk' / '.license-accepted'.
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   124
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   125
    (Smalltalk isStandAloneApp or:[ Smalltalk isPlugin or:[ Display isNil]]) ifTrue:[ 
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   126
        ^ self
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   127
    ].
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   128
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   129
    licenseAcceptedFile exists ifTrue:[ 
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   130
        "/ License has been already accepted, don't dhow it again
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   131
        ^ self 
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   132
    ].
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   133
    LicenceBox autoload.
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   134
    [
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   135
       | licenseAcceptedDir |
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   136
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   137
	   Display exitOnLastClose:false.
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   138
       (LicenceBox open) ifFalse:[
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   139
           Smalltalk exit
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   140
       ].              
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   141
       licenseAcceptedDir := licenseAcceptedFile directory.
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   142
       licenseAcceptedDir exists ifFalse:[
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   143
           licenseAcceptedDir recursiveMakeDirectory.
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   144
       ].
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   145
       licenseAcceptedDir isWritable ifTrue:[
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   146
           licenseAcceptedFile writingFileDo:[ :s| s nextPutLine: 'accepted' ]
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   147
       ].
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   148
    ] on: LicenceBox licenceRejectSignal do:[ 
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   149
        Smalltalk exit
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   150
    ] on: Error do:[
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   151
        "/ Ignore this, but user will be acc
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   152
    ].
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   153
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   154
    "
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   155
    SmalltalkStartup acceptLicense
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   156
    "
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   157
bde224d85196 Cleanup: moved code to accept license to `SmalltalkStartup`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1447
diff changeset
   158
    "Created: / 30-12-2016 / 23:41:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1447
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   159
! !
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   160
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   161
!SmalltalkStartup class methodsFor:'documentation'!
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   162
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   163
version_HG
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   164
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   165
    ^ '$Changeset: <not expanded> $'
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   166
! !
0b149293564f Issue #98: Added -P / --package-path command line option
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1442
diff changeset
   167