StandaloneStartup.st
author Claus Gittinger <cg@exept.de>
Mon, 15 Nov 2010 14:19:37 +0100
changeset 13127 60b2005943bb
parent 13126 8cbc00290e5b
child 13130 1aa18e8d0e26
permissions -rw-r--r--
changed: #start
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 2006 by eXept Software AG
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libbasic' }"
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
Object subclass:#StandaloneStartup
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
	instanceVariableNames:''
10772
13bb80f40496 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10636
diff changeset
    16
	classVariableNames:'Verbose CommandLineArguments'
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'System-Support'
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
    21
StandaloneStartup class instanceVariableNames:'MutexHandle'
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
    22
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
    23
"
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
    24
 No other class instance variables are inherited by this class.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
    25
"
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
    26
!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
    27
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
!StandaloneStartup class methodsFor:'documentation'!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
copyright
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
"
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 COPYRIGHT (c) 2006 by eXept Software AG
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
              All Rights Reserved
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 This software is furnished under a license and may be used
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 only in accordance with the terms of that license and with the
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
 inclusion of the above copyright notice.   This software may not
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
 be provided or otherwise made available to, or used by, any
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
 other person.  No title to or ownership of the software is
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
 hereby transferred.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
"
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
documentation
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
"
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    a subclassable template class for a standalone GUI-application's startup;
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    For your own stand alone programs, define a subclass of this, 
12335
af9a7bc14d6a changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 11807
diff changeset
    48
    and redefine the #main: method there.
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    (of course, the other methods can also be redefined.)
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    [author:]
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
        Claus Gittinger
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    [start with:]
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
        <yourNamehere>Startup start
10886
f5ce5c02e1a7 comments
Claus Gittinger <cg@exept.de>
parents: 10773
diff changeset
    56
f5ce5c02e1a7 comments
Claus Gittinger <cg@exept.de>
parents: 10773
diff changeset
    57
    [see also:]
f5ce5c02e1a7 comments
Claus Gittinger <cg@exept.de>
parents: 10773
diff changeset
    58
        Smalltalk
f5ce5c02e1a7 comments
Claus Gittinger <cg@exept.de>
parents: 10773
diff changeset
    59
        GetOpt
f5ce5c02e1a7 comments
Claus Gittinger <cg@exept.de>
parents: 10773
diff changeset
    60
        ReadEvalPrintLoop
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
"
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
    62
!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
    63
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
    64
howToDealWithMultipleApplicationInstances
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
    65
"
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
    66
    please read the comment in the corresponding ApplicationModel class-documentation method.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
    67
"
11352
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
    68
!
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
    69
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
    70
whichMethodsToRedefine
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
    71
"
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
    72
    main:argv
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
    73
        thats the actual program.
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
    74
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
    75
    suppressRCFileReading
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
    76
        false here; redefine to return true, to disable the rc-file reading.
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
    77
        you loose the chance of configuration, but lock the user out from any access to any smalltalk
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
    78
        (if you have a user-phobia)
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
    79
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
    80
    allowDebugOption
11361
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
    81
        false here; redefine to return true, to enable the --debug startup option.
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
    82
        if disabled, you loose the chance of debugging, but lock the user out from any access to any smalltalk
11352
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
    83
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
    84
    allowScriptingOption
11361
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
    85
        false here; redefine to return true, to enable the --scripting startup option.
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
    86
        if disabled, you loose the chance of remote control, but lock the user out from any access to any smalltalk
11352
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
    87
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
    88
"
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
! !
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
!StandaloneStartup class methodsFor:'initialization'!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
initialize
11360
e309e560dcee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11359
diff changeset
    94
    "/ Verbose := true.
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
    Verbose := false.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
! !
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
11361
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
    98
!StandaloneStartup class methodsFor:'defaults'!
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
    99
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
   100
allowDebugOption
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
   101
    "enable/disable the --debug startup option.
11363
de78c218cc36 comments
Claus Gittinger <cg@exept.de>
parents: 11361
diff changeset
   102
     The default is now false, so standAlone apps are closed by default.
de78c218cc36 comments
Claus Gittinger <cg@exept.de>
parents: 11361
diff changeset
   103
     Can be redefined in subclasses to enable it"
11361
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
   104
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
   105
    ^ false
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
   106
!
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
   107
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
   108
allowScriptingOption
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
   109
    "enable/disable the --scripting startup option.
11363
de78c218cc36 comments
Claus Gittinger <cg@exept.de>
parents: 11361
diff changeset
   110
     The default is now false, so standAlone apps are closed by default.
de78c218cc36 comments
Claus Gittinger <cg@exept.de>
parents: 11361
diff changeset
   111
     Can be redefined in subclasses to enable it"
11361
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
   112
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
   113
    ^ false
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
   114
!
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
   115
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
   116
suppressRCFileReading
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
   117
    "enable/disable the rc-file reading (and also the --rcFileName option).
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
   118
     If suppressed, there is no chance to interfere with the startup.
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
   119
     Can be redefined in subclasses to disable it"
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
   120
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
   121
    ^ false
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
   122
! !
36d809458749 defaults for allowDebug and allowScripting
Michael Beyl <mb@exept.de>
parents: 11360
diff changeset
   123
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
!StandaloneStartup class methodsFor:'helpers'!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
11423
25a27bdeff4c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11379
diff changeset
   126
printInfo:msg
25a27bdeff4c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11379
diff changeset
   127
    Transcript 
25a27bdeff4c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11379
diff changeset
   128
        show:('%1 [info]: ' bindWith:(self applicationName));
25a27bdeff4c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11379
diff changeset
   129
        showCR:msg
25a27bdeff4c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11379
diff changeset
   130
!
25a27bdeff4c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11379
diff changeset
   131
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
redirectStandardStreams
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
    Stdout := Stderr.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
    Transcript := Stderr.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
verboseInfo:msg
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
    Verbose == true ifFalse:[^ self].
11423
25a27bdeff4c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11379
diff changeset
   139
    self printInfo:msg
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
    "Modified: / 19-09-2006 / 16:30:27 / cg"
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
! !
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   144
!StandaloneStartup class methodsFor:'multiple applications support'!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   145
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   146
applicationRegistryPath
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   147
    "the key under which this application stores its process ID in the registry
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   148
     as a collection of path-components.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   149
     i.e. if #('foo' 'bar' 'baz') is returned here, the current applications ID will be stored
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   150
     in HKEY_CURRENT_USER\Software\foo\bar\baz\CurrentID.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   151
     (would also be used as a relative path for a temporary lock file under unix).
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   152
     Used to detect if another instance of this application is already running."
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   153
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   154
    self subclassResponsibility
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   155
!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   156
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   157
applicationUUID
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   158
    "answer an application-specific unique uuid.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   159
     This is used as the name of some exclusive OS-resource, which is used to find out,
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   160
     if another instance of this application is already running.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   161
     Under win32, a mutex is used; under unix, an exclusive file in the tempDir could be used."
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   162
    
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   163
    self subclassResponsibility
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   164
!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   165
12998
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   166
shouldReuseRunningApplication
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   167
    "answer true, if an already running application instance should be re-used"
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   168
12998
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   169
    ^ false
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   170
! !
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   171
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   172
!StandaloneStartup class methodsFor:'multiple applications support-helpers'!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   173
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   174
applicationRegistryEntry
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   175
    "retrieve the registry entry in which (if present), any currently running application
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   176
     has left its process ID"
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   177
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   178
    |path relPathName applicationEntry softwareEntry|
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   179
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   180
    path := self applicationRegistryPath.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   181
    relPathName := path asStringWith:$\.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   182
    applicationEntry := Win32OperatingSystem registryEntry key:'HKEY_CURRENT_USER\Software\',relPathName.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   183
    applicationEntry isNil ifTrue:[
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   184
        softwareEntry := Win32OperatingSystem registryEntry key:'HKEY_CURRENT_USER\Software'.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   185
        softwareEntry isNil ifTrue:[
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   186
            Transcript showCR: 'Failed to get Software entry in registry'.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   187
            ^ nil.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   188
        ].
11103
aae220bd7157 changed: #applicationRegistryEntry
fm
parents: 11102
diff changeset
   189
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   190
        path do:[:subKey |
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   191
            |subEntry|
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   192
11103
aae220bd7157 changed: #applicationRegistryEntry
fm
parents: 11102
diff changeset
   193
            subEntry := softwareEntry createSubKeyNamed:subKey.
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   194
            subEntry isNil ifTrue:[
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   195
                Transcript showCR: 'Failed to create ',subKey,' entry in registry'.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   196
                ^ nil.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   197
            ].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   198
            softwareEntry := subEntry.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   199
        ].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   200
        applicationEntry := softwareEntry.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   201
    ].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   202
    ^ applicationEntry
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   203
!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   204
12998
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   205
checkForAndExitIfAnotherApplicationInstanceIsRunning
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   206
    "if another instance of this application is running,
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   207
     send it an openFile command for my file-argument, and exit.
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   208
     (i.e. to let the already running application open up another window)."
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   209
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   210
    |shouldExit|
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   211
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   212
    self isAnotherApplicationInstanceRunning ifTrue:[
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   213
        shouldExit := self processStartupOfASecondInstance.
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   214
        shouldExit ifTrue:[
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   215
            self releaseApplicationMutex.
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   216
            Smalltalk isStandAloneApp ifTrue:[
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   217
                Smalltalk exit.
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   218
            ]
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   219
        ].
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   220
    ].
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   221
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   222
    "Modified: / 03-08-2010 / 17:27:25 / cg"
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   223
!
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   224
11107
2c1b779bc57a *** empty log message ***
fm
parents: 11106
diff changeset
   225
confirmOpenNewApplicationInstance
2c1b779bc57a *** empty log message ***
fm
parents: 11106
diff changeset
   226
2c1b779bc57a *** empty log message ***
fm
parents: 11106
diff changeset
   227
    ^ Dialog confirm: ('Continue opening a new instance of %1 or exit?' bindWith:self applicationName)
2c1b779bc57a *** empty log message ***
fm
parents: 11106
diff changeset
   228
                title: ('%1 is already open!!' bindWith:self applicationName)
2c1b779bc57a *** empty log message ***
fm
parents: 11106
diff changeset
   229
             yesLabel: 'Continue' 
2c1b779bc57a *** empty log message ***
fm
parents: 11106
diff changeset
   230
              noLabel: 'Exit'
2c1b779bc57a *** empty log message ***
fm
parents: 11106
diff changeset
   231
!
2c1b779bc57a *** empty log message ***
fm
parents: 11106
diff changeset
   232
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   233
currentIDKeyInRegistry
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   234
    ^ 'CurrentID'
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   235
!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   236
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   237
getCurrentIDFromRegistry
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   238
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   239
    |applicationEntry|
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   240
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   241
    applicationEntry := self applicationRegistryEntry.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   242
    applicationEntry isNil ifTrue:[^ nil.].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   243
    ^ applicationEntry valueNamed: self currentIDKeyInRegistry
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   244
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   245
    "
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   246
     |hWnd externalAddress|
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   247
     hWnd := DapasXStartup getCurrentIDFromRegistry.   
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   248
     hWnd isEmptyOrNil ifTrue:[^ self halt.].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   249
     hWnd := hWnd asInteger.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   250
     externalAddress := ExternalAddress newAddress: hWnd.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   251
     Display raiseWindow:externalAddress.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   252
     Display setForegroundWindow:externalAddress
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   253
    "
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   254
!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   255
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   256
getIDOfRunningApplicationFromRegistryEntry
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   257
    |applicationEntry|
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   258
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   259
    applicationEntry := self applicationRegistryEntry.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   260
    applicationEntry isNil ifTrue:[^ nil.].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   261
    ^ applicationEntry valueNamed: self currentIDKeyInRegistry
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   262
!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   263
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   264
isAnotherApplicationInstanceRunning
13083
66a8fb472eb5 comment/format in: #isAnotherApplicationInstanceRunning
Claus Gittinger <cg@exept.de>
parents: 12999
diff changeset
   265
    "answer true, if another instance of myself is currently running.
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   266
     For now, it only works under win32, because it uses the underlying mutex mechanism."
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   267
    
11106
740c42559ef7 changed: #isAnotherApplicationInstanceRunning
fm
parents: 11105
diff changeset
   268
    | lastErrorCode alreadyExists handleAndLastErrorCode |
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   269
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   270
    OperatingSystem isMSDOSlike ifTrue:[
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   271
        handleAndLastErrorCode := OperatingSystem createMutexNamed: (self applicationUUID printString).
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   272
        MutexHandle := handleAndLastErrorCode first.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   273
        lastErrorCode := handleAndLastErrorCode second.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   274
        "/ self assert: lastErrorCode == 0.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   275
        alreadyExists := 
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   276
            MutexHandle isNil 
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   277
            or:[lastErrorCode == 183 "ERROR_ALREADY_EXISTS"
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   278
            or:[lastErrorCode == 5 "ERROR_ACCESS_DENIED"]].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   279
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   280
        alreadyExists ifFalse:[OperatingSystem waitForSingleObject: MutexHandle].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   281
        ^ alreadyExists
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   282
    ].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   283
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   284
    ^ false.
13083
66a8fb472eb5 comment/format in: #isAnotherApplicationInstanceRunning
Claus Gittinger <cg@exept.de>
parents: 12999
diff changeset
   285
66a8fb472eb5 comment/format in: #isAnotherApplicationInstanceRunning
Claus Gittinger <cg@exept.de>
parents: 12999
diff changeset
   286
    "Modified: / 01-10-2010 / 18:27:29 / cg"
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   287
!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   288
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   289
processStartupOfASecondInstance
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   290
    "This is executed when I have been started as a second instance of an already running application.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   291
     If I can get the currentID (i.e. windowID) of the first one and there is a command line argument with a file, 
12935
49210cf2d978 comment/format in: #processStartupOfASecondInstance
Claus Gittinger <cg@exept.de>
parents: 12933
diff changeset
   292
     send a message to the main window of the already running application, to ask it for another window.
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   293
     If the currentID is unknown, ask if the user wants to open a new instance of the application anyway.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   294
     Return true if the first instance has been notified, and this second instance should exit."
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   295
11107
2c1b779bc57a *** empty log message ***
fm
parents: 11106
diff changeset
   296
    |currentIDStringFromRegistry currentIDFromRegistry fileArg commands aWindowId setForegroundWindowSucceeded|
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   297
12998
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   298
    commands := CommandLineArguments.
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   299
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   300
    currentIDStringFromRegistry := self getCurrentIDFromRegistry.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   301
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   302
    "If the currentID is not found and there are arguments from the command line, 
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   303
     we should wait in case of starting the first instance of the application 
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   304
     with a multiple selection of files."
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   305
    (currentIDStringFromRegistry isEmptyOrNil and:[commands notEmptyOrNil]) ifTrue:[
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   306
        Delay waitForSeconds: 2.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   307
    ].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   308
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   309
    currentIDStringFromRegistry := self getCurrentIDFromRegistry.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   310
    currentIDStringFromRegistry isEmptyOrNil ifTrue:[
11107
2c1b779bc57a *** empty log message ***
fm
parents: 11106
diff changeset
   311
        ^ self confirmOpenNewApplicationInstance not.
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   312
    ].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   313
11107
2c1b779bc57a *** empty log message ***
fm
parents: 11106
diff changeset
   314
    currentIDFromRegistry := Integer readFrom:currentIDStringFromRegistry onError: 0.
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   315
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   316
    "/ bring the other application to the foreground
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   317
    aWindowId := ExternalAddress newAddress: currentIDFromRegistry.
11107
2c1b779bc57a *** empty log message ***
fm
parents: 11106
diff changeset
   318
    setForegroundWindowSucceeded := Display primSetForegroundWindow: aWindowId.
11379
2cd74df95a0e changed: #processStartupOfASecondInstance
fm
parents: 11363
diff changeset
   319
"/    setForegroundWindowSucceeded ifFalse:[^ self confirmOpenNewApplicationInstance not].
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   320
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   321
    "Autostart for associated extension"
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   322
    commands notEmpty ifTrue:[
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   323
        fileArg := commands last asFilename.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   324
        fileArg exists ifTrue:[
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   325
            self sendOpenPathCommand:(fileArg pathName) toWindowId: aWindowId.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   326
        ].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   327
    ].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   328
    ^ true
12935
49210cf2d978 comment/format in: #processStartupOfASecondInstance
Claus Gittinger <cg@exept.de>
parents: 12933
diff changeset
   329
49210cf2d978 comment/format in: #processStartupOfASecondInstance
Claus Gittinger <cg@exept.de>
parents: 12933
diff changeset
   330
    "Modified: / 08-07-2010 / 00:47:44 / cg"
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   331
!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   332
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   333
releaseApplicationMutex
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   334
12933
4e196c41604d changed: #releaseApplicationMutex set MutexHandle to nil
ca
parents: 12626
diff changeset
   335
    (MutexHandle notNil and:[OperatingSystem isMSDOSlike]) ifTrue:[
4e196c41604d changed: #releaseApplicationMutex set MutexHandle to nil
ca
parents: 12626
diff changeset
   336
        OperatingSystem releaseMutex: MutexHandle.
4e196c41604d changed: #releaseApplicationMutex set MutexHandle to nil
ca
parents: 12626
diff changeset
   337
        OperatingSystem primCloseHandle: MutexHandle.
4e196c41604d changed: #releaseApplicationMutex set MutexHandle to nil
ca
parents: 12626
diff changeset
   338
4e196c41604d changed: #releaseApplicationMutex set MutexHandle to nil
ca
parents: 12626
diff changeset
   339
        MutexHandle := nil.
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   340
    ].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   341
!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   342
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   343
sendCommand:message toWindowId:aWindowId
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   344
    "use the event send mechanism to forward a command to the already running application"
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   345
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   346
    Display 
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   347
        sendCopyDataString: message 
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   348
        toWindowId: aWindowId.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   349
!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   350
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   351
sendOpenPathCommand:pathName toWindowId:aWindowId
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   352
    "use the event send mechanism to forward an open-Path command to the already running application"
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   353
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   354
    self sendCommand:('openPath:', pathName) toWindowId:aWindowId.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   355
!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   356
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   357
writeCurrentIDIntoRegistry: currentID
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   358
11104
d1a963670d67 changed: #writeCurrentIDIntoRegistry:
fm
parents: 11103
diff changeset
   359
    |applicationEntry currentIDEntry|
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   360
11104
d1a963670d67 changed: #writeCurrentIDIntoRegistry:
fm
parents: 11103
diff changeset
   361
    applicationEntry := self applicationRegistryEntry.
d1a963670d67 changed: #writeCurrentIDIntoRegistry:
fm
parents: 11103
diff changeset
   362
    applicationEntry isNil ifTrue:[^ false.].
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   363
11104
d1a963670d67 changed: #writeCurrentIDIntoRegistry:
fm
parents: 11103
diff changeset
   364
    currentIDEntry := applicationEntry createSubKeyNamed:(self currentIDKeyInRegistry).
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   365
    currentIDEntry isNil ifTrue:[
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   366
        Transcript showCR: 'Failed to create CurrentID entry in registry'.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   367
        ^ false.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   368
    ].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   369
11104
d1a963670d67 changed: #writeCurrentIDIntoRegistry:
fm
parents: 11103
diff changeset
   370
    ^ applicationEntry valueNamed:(self currentIDKeyInRegistry) put:(currentID printString).
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   371
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   372
    "
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   373
     | currentID returnedCurrentID |
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   374
     currentID := 999.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   375
     DapasXStartup writeCurrentIDIntoRegistry: currentID.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   376
     returnedCurrentID := DapasXStartup getCurrentIDFromRegistry.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   377
     self assert: currentID = returnedCurrentID asNumber.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   378
    "
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   379
! !
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   380
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   381
!StandaloneStartup class methodsFor:'queries'!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   382
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   383
applicationName
11352
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   384
    "used in verbose messages - can/should be redefined in subclasses"
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   385
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   386
    |nm|
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   387
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   388
    nm := self nameWithoutPrefix.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   389
    (nm endsWith:'Startup') ifTrue:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   390
        ^ nm copyWithoutLast:('Startup' size).
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   391
    ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   392
    (nm endsWith:'Start') ifTrue:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   393
        ^ nm copyWithoutLast:('Start' size).
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   394
    ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   395
    ^ nm
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   396
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   397
    "Created: / 19-09-2006 / 16:26:44 / cg"
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   398
!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   399
12523
df8cb7ffe5eb added: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents: 12335
diff changeset
   400
iconInBrowserSymbol
df8cb7ffe5eb added: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents: 12335
diff changeset
   401
    <resource: #programImage>
df8cb7ffe5eb added: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents: 12335
diff changeset
   402
df8cb7ffe5eb added: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents: 12335
diff changeset
   403
    self == StandaloneStartup ifFalse:[
df8cb7ffe5eb added: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents: 12335
diff changeset
   404
        ^ #standaloneStartupIcon 
df8cb7ffe5eb added: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents: 12335
diff changeset
   405
    ].
df8cb7ffe5eb added: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents: 12335
diff changeset
   406
    ^ super iconInBrowserSymbol
df8cb7ffe5eb added: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents: 12335
diff changeset
   407
!
df8cb7ffe5eb added: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents: 12335
diff changeset
   408
10040
59d0c20b139f protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9944
diff changeset
   409
isBrowserStartable
59d0c20b139f protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9944
diff changeset
   410
    "do not allow clicking on me in the browser"
59d0c20b139f protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9944
diff changeset
   411
59d0c20b139f protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9944
diff changeset
   412
    ^ false
59d0c20b139f protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9944
diff changeset
   413
59d0c20b139f protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9944
diff changeset
   414
    "Created: / 06-10-2006 / 11:33:13 / cg"
59d0c20b139f protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9944
diff changeset
   415
!
59d0c20b139f protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9944
diff changeset
   416
12626
f85aaddaea1d added: keepSplashWindowOpen
Claus Gittinger <cg@exept.de>
parents: 12523
diff changeset
   417
keepSplashWindowOpen
f85aaddaea1d added: keepSplashWindowOpen
Claus Gittinger <cg@exept.de>
parents: 12523
diff changeset
   418
    "if true is returned here, the splashWindow is not closed and will be still open
f85aaddaea1d added: keepSplashWindowOpen
Claus Gittinger <cg@exept.de>
parents: 12523
diff changeset
   419
     when the main: method is invoked. This allows for plugin-loads etc. to be shown in the
f85aaddaea1d added: keepSplashWindowOpen
Claus Gittinger <cg@exept.de>
parents: 12523
diff changeset
   420
     splash screen. However, my subclass's main: has to make sure that the splashScreen is closed.
f85aaddaea1d added: keepSplashWindowOpen
Claus Gittinger <cg@exept.de>
parents: 12523
diff changeset
   421
     (calling hideSplashWindow)
f85aaddaea1d added: keepSplashWindowOpen
Claus Gittinger <cg@exept.de>
parents: 12523
diff changeset
   422
     The default is false here which means that the splashWindow will be already closed when the
f85aaddaea1d added: keepSplashWindowOpen
Claus Gittinger <cg@exept.de>
parents: 12523
diff changeset
   423
     subclasses main: is invoked."
f85aaddaea1d added: keepSplashWindowOpen
Claus Gittinger <cg@exept.de>
parents: 12523
diff changeset
   424
f85aaddaea1d added: keepSplashWindowOpen
Claus Gittinger <cg@exept.de>
parents: 12523
diff changeset
   425
    ^ false
f85aaddaea1d added: keepSplashWindowOpen
Claus Gittinger <cg@exept.de>
parents: 12523
diff changeset
   426
!
f85aaddaea1d added: keepSplashWindowOpen
Claus Gittinger <cg@exept.de>
parents: 12523
diff changeset
   427
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   428
startupFilename
11352
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   429
    "used in verbose messages - can/should be redefined in subclasses"
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   430
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   431
    ^ self applicationName asLowercase,'Start.rc'
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   432
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   433
    "
11352
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   434
     ExpeccoStartup startupFilename -> 'expecco.rc'
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   435
    "
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   436
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   437
    "Created: / 19-09-2006 / 16:38:28 / cg"
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   438
! !
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   439
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   440
!StandaloneStartup class methodsFor:'startup'!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   441
11055
e600e19e2e7f loadPatch extracted to be redefinable.
Claus Gittinger <cg@exept.de>
parents: 10956
diff changeset
   442
loadPatch:fileName
11056
e2c4a6e948b6 loadPatch extracted to be redefinable.
Claus Gittinger <cg@exept.de>
parents: 11055
diff changeset
   443
    self verboseInfo:('loading patch: ',fileName baseName).
11055
e600e19e2e7f loadPatch extracted to be redefinable.
Claus Gittinger <cg@exept.de>
parents: 10956
diff changeset
   444
    Smalltalk fileIn:fileName pathName.
e600e19e2e7f loadPatch extracted to be redefinable.
Claus Gittinger <cg@exept.de>
parents: 10956
diff changeset
   445
!
e600e19e2e7f loadPatch extracted to be redefinable.
Claus Gittinger <cg@exept.de>
parents: 10956
diff changeset
   446
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   447
loadPatches
11764
89c0c60feb24 Discard source code of patches that are loaded at startup
Stefan Vogel <sv@exept.de>
parents: 11753
diff changeset
   448
    |patchesDir prevMode|
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   449
10934
970557a121e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10886
diff changeset
   450
    patchesDir := OperatingSystem pathOfSTXExecutable asFilename directory construct:'patches'.
970557a121e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10886
diff changeset
   451
    (patchesDir exists and:[patchesDir isDirectory]) ifTrue:[
11764
89c0c60feb24 Discard source code of patches that are loaded at startup
Stefan Vogel <sv@exept.de>
parents: 11753
diff changeset
   452
        prevMode := ClassCategoryReader sourceMode.
89c0c60feb24 Discard source code of patches that are loaded at startup
Stefan Vogel <sv@exept.de>
parents: 11753
diff changeset
   453
        ClassCategoryReader sourceMode:#discard.
89c0c60feb24 Discard source code of patches that are loaded at startup
Stefan Vogel <sv@exept.de>
parents: 11753
diff changeset
   454
        [
89c0c60feb24 Discard source code of patches that are loaded at startup
Stefan Vogel <sv@exept.de>
parents: 11753
diff changeset
   455
            patchesDir directoryContents sort do:[:eachFilenameString |
89c0c60feb24 Discard source code of patches that are loaded at startup
Stefan Vogel <sv@exept.de>
parents: 11753
diff changeset
   456
                self loadPatch:(patchesDir construct:eachFilenameString).
89c0c60feb24 Discard source code of patches that are loaded at startup
Stefan Vogel <sv@exept.de>
parents: 11753
diff changeset
   457
            ].
89c0c60feb24 Discard source code of patches that are loaded at startup
Stefan Vogel <sv@exept.de>
parents: 11753
diff changeset
   458
        ] ensure:[
89c0c60feb24 Discard source code of patches that are loaded at startup
Stefan Vogel <sv@exept.de>
parents: 11753
diff changeset
   459
            ClassCategoryReader sourceMode:prevMode.
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   460
        ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   461
    ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   462
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   463
    "Modified: / 19-09-2006 / 16:30:58 / cg"
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   464
!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   465
12998
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   466
loadRemainingClassLibraries
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   467
    "To speedup startup, we did not load all dll's (only a subset of non-GUI dll's is present).
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   468
     Now, load all skipped libs (the ones marked with '*') from modules.stx."
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   469
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   470
    |modulesFile dllDirectory dlls|
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   471
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   472
    OperatingSystem isMSWINDOWSlike ifFalse:[^ self ].
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   473
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   474
    self verboseInfo:'loadRemainingClassLibraries'.
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   475
    modulesFile  := self stxModulesFilename.
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   476
    dllDirectory := modulesFile directory.
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   477
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   478
    dlls := OrderedCollection new.
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   479
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   480
    modulesFile readingLinesDo:[:eachModulesLine|
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   481
        |basename dllFile|
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   482
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   483
        basename := eachModulesLine withoutSeparators.
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   484
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   485
        (basename notEmpty and:[basename first == $*]) ifTrue:[
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   486
            basename := (basename copyFrom:2) withoutSeparators, '.dll'.
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   487
            dllFile := dllDirectory construct:basename.
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   488
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   489
            dllFile exists ifTrue:[
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   490
"/                self verboseInfo:('loading: ', basename).
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   491
                Smalltalk showSplashMessage:('loading ', basename).
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   492
                dlls add:dllFile.
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   493
            ] ifFalse:[
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   494
                self verboseInfo:( '**** cannot resolve: ', basename).
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   495
            ].
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   496
        ].
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   497
    ].
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   498
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   499
    dlls notEmpty ifTrue:[
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   500
        ObjectFileLoader loadObjectFiles:dlls.
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   501
        Display notNil ifTrue:[
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   502
            "New view classes may have been loaded - have to update their styles"
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   503
            self verboseInfo:'update style caches of loaded dlls'.
12999
a5ab22c6470c changed: #loadRemainingClassLibraries
Stefan Vogel <sv@exept.de>
parents: 12998
diff changeset
   504
            SimpleView readStyleSheetAndUpdateAllStyleCaches.
12998
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   505
        ].
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   506
    ].
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   507
!
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   508
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   509
setupSmalltalkFromArguments:argv
11352
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   510
    "handle common command line arguments:
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   511
        --help ............... print usage and exit
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   512
        --verbose (-V) ....... be verbose during startup
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   513
        --debug .............. enable debugger & inspector
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   514
        --rcFileName ......... define a startup rc-file
11435
4b7e47a525df --allowHost option
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
   515
        --scripting portNr ... start a scripting server
4b7e47a525df --allowHost option
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
   516
        --allowHost host ..... add host to the allowed scripting hosts
11352
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   517
    "
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   518
11435
4b7e47a525df --allowHost option
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
   519
    |idx rcFilename nextArg debugging scripting allowedScriptingHosts portNr|
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   520
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   521
"/    Smalltalk beHeadless:true.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   522
"/    OperatingSystem disableSignal:(OperatingSystem sigHUP).
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   523
"/    Smalltalk infoPrinting:true.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   524
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   525
    (argv includes:'--help') ifTrue:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   526
        self usage.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   527
        AbortOperationRequest raise.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   528
    ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   529
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   530
    idx := argv indexOfAny:#('--verbose' '-V').
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   531
    idx ~~ 0 ifTrue:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   532
        argv removeAtIndex:idx.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   533
        Verbose := true.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   534
    ].
10773
98a51414b27f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10772
diff changeset
   535
    self verboseInfo:('args: ',argv asArray printString).
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   536
11352
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   537
    debugging := false.
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   538
    (self allowDebugOption) ifTrue:[
13126
8cbc00290e5b changed: #setupSmalltalkFromArguments:
Claus Gittinger <cg@exept.de>
parents: 13089
diff changeset
   539
        idx := argv indexOf:'--debug'.
11352
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   540
        idx ~~ 0 ifTrue:[
11357
0a710cf52bb4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11356
diff changeset
   541
            self verboseInfo:('debug on').
11352
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   542
            argv removeAtIndex:idx.
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   543
            debugging := true
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   544
        ].
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   545
    ].
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   546
    debugging ifTrue:[
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   547
        self setupToolsForDebug.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   548
    ] ifFalse:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   549
        self setupToolsForNoDebug.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   550
    ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   551
11352
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   552
    self suppressRCFileReading ifFalse:[
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   553
        idx := argv indexOf:'--rcFileName'.
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   554
        idx ~~ 0 ifTrue:[
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   555
            nextArg := argv at:(idx + 1) ifAbsent:nil.
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   556
            (nextArg notNil and:[ (nextArg startsWith:'-') not ]) ifTrue:[
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   557
                rcFilename := nextArg.
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   558
                argv removeAtIndex:idx+1; removeAtIndex:idx.
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   559
            ]
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   560
        ].
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   561
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   562
        rcFilename isNil ifTrue:[
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   563
            rcFilename := self startupFilename.
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   564
        ].
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   565
        rcFilename asFilename exists ifTrue:[
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   566
            self verboseInfo:('reading ',rcFilename,'...').
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   567
            rcFilename isAbsolute ifFalse:[
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   568
                rcFilename := OperatingSystem pathOfSTXExecutable asFilename directory constructString:rcFilename.
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   569
            ].
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   570
            Smalltalk secureFileIn:rcFilename
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   571
        ].
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   572
    ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   573
11352
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   574
    scripting := false.
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   575
    (self allowScriptingOption) ifTrue:[
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   576
        idx := argv indexOfAny:#('--scripting').
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   577
        idx ~~ 0 ifTrue:[
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   578
            nextArg := argv at:(idx + 1) ifAbsent:nil.
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   579
            (nextArg notNil and:[ (nextArg startsWith:'-') not ]) ifTrue:[
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   580
                portNr := nextArg asInteger.
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   581
                argv removeAtIndex:idx+1.
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   582
            ].
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   583
            argv removeAtIndex:idx.
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   584
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   585
            scripting := true
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   586
        ].
11435
4b7e47a525df --allowHost option
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
   587
4b7e47a525df --allowHost option
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
   588
        allowedScriptingHosts := OrderedCollection new.
4b7e47a525df --allowHost option
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
   589
4b7e47a525df --allowHost option
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
   590
        idx := argv indexOfAny:#('--allowHost').
4b7e47a525df --allowHost option
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
   591
        [idx ~~ 0] whileTrue:[
4b7e47a525df --allowHost option
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
   592
            nextArg := argv at:(idx + 1) ifAbsent:nil.
4b7e47a525df --allowHost option
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
   593
            nextArg isNil ifTrue:[
4b7e47a525df --allowHost option
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
   594
                self usage.
4b7e47a525df --allowHost option
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
   595
                AbortOperationRequest raise.
4b7e47a525df --allowHost option
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
   596
            ].
4b7e47a525df --allowHost option
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
   597
            allowedScriptingHosts add:nextArg.
4b7e47a525df --allowHost option
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
   598
            idx := argv indexOfAny:#('--allowHost').
4b7e47a525df --allowHost option
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
   599
        ].
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   600
    ].
11435
4b7e47a525df --allowHost option
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
   601
11352
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   602
    scripting ifTrue:[
11358
c1f741e4aa34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11357
diff changeset
   603
        self verboseInfo:('scripting on').
11352
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   604
        STXScriptingServer notNil ifTrue:[
11435
4b7e47a525df --allowHost option
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
   605
            allowedScriptingHosts do:[:eachHost | STXScriptingServer allowHost:eachHost ].
4b7e47a525df --allowHost option
Claus Gittinger <cg@exept.de>
parents: 11423
diff changeset
   606
11353
6167f1e604c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11352
diff changeset
   607
            "/ scripting on port/stdin_out/8008
6167f1e604c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11352
diff changeset
   608
            self verboseInfo:('start scripting').
6167f1e604c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11352
diff changeset
   609
            STXScriptingServer startAt:portNr
11359
587f2a2aef0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11358
diff changeset
   610
        ] ifFalse:[
587f2a2aef0a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11358
diff changeset
   611
            self verboseInfo:('missing STXScriptingServer class').
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   612
        ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   613
    ].
11352
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   614
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   615
    ^ true
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   616
13126
8cbc00290e5b changed: #setupSmalltalkFromArguments:
Claus Gittinger <cg@exept.de>
parents: 13089
diff changeset
   617
    "Modified: / 15-11-2010 / 14:17:34 / cg"
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   618
!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   619
11355
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   620
setupToolsForDebug
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   621
    Debugger := DebugView ? MiniDebugger.
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   622
    Inspector := InspectorView ? MiniInspector.
11736
095ef06bd971 show debug enabled/disabled info when Verbose is true
fm
parents: 11714
diff changeset
   623
    Verbose ifTrue:[ 'debug enabled - CTRL-C brings you into a debugger.' errorPrintCR ].
095ef06bd971 show debug enabled/disabled info when Verbose is true
fm
parents: 11714
diff changeset
   624
"/    self verboseInfo:('debug enabled - CTRL-C brings you into a debugger.').
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   625
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   626
    "Created: / 19-09-2006 / 16:40:32 / cg"
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   627
!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   628
11355
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   629
setupToolsForNoDebug
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   630
    Smalltalk isStandAloneApp ifTrue:[
11600
1d98211fc0b0 also nil private classes of NewLauncher
Claus Gittinger <cg@exept.de>
parents: 11435
diff changeset
   631
        Smalltalk at:#Debugger put:nil.
1d98211fc0b0 also nil private classes of NewLauncher
Claus Gittinger <cg@exept.de>
parents: 11435
diff changeset
   632
        Smalltalk at:#Inspector put:nil.
11714
a2210199707b Fix if no NewLauncher is present
Stefan Vogel <sv@exept.de>
parents: 11610
diff changeset
   633
        NewLauncher notNil ifTrue:[
a2210199707b Fix if no NewLauncher is present
Stefan Vogel <sv@exept.de>
parents: 11610
diff changeset
   634
            NewLauncher allPrivateClasses do:[:cls |
a2210199707b Fix if no NewLauncher is present
Stefan Vogel <sv@exept.de>
parents: 11610
diff changeset
   635
                Smalltalk at:(cls name) put:nil.
a2210199707b Fix if no NewLauncher is present
Stefan Vogel <sv@exept.de>
parents: 11610
diff changeset
   636
            ].
a2210199707b Fix if no NewLauncher is present
Stefan Vogel <sv@exept.de>
parents: 11610
diff changeset
   637
            Smalltalk at:#NewLauncher put:nil.
11600
1d98211fc0b0 also nil private classes of NewLauncher
Claus Gittinger <cg@exept.de>
parents: 11435
diff changeset
   638
        ].
11736
095ef06bd971 show debug enabled/disabled info when Verbose is true
fm
parents: 11714
diff changeset
   639
        Verbose ifTrue:[ 'debug disabled.' errorPrintCR ].
095ef06bd971 show debug enabled/disabled info when Verbose is true
fm
parents: 11714
diff changeset
   640
11355
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   641
        self redirectStandardStreams.
10773
98a51414b27f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10772
diff changeset
   642
    ].
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   643
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   644
    "Created: / 19-09-2006 / 16:40:47 / cg"
10773
98a51414b27f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10772
diff changeset
   645
    "Modified: / 31-10-2007 / 16:18:40 / cg"
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   646
!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   647
11355
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   648
start
12992
cad1bd395046 changed: #start
Claus Gittinger <cg@exept.de>
parents: 12991
diff changeset
   649
    GenericException handle:[:ex |
cad1bd395046 changed: #start
Claus Gittinger <cg@exept.de>
parents: 12991
diff changeset
   650
        self verboseInfo:('Error during startup:').
cad1bd395046 changed: #start
Claus Gittinger <cg@exept.de>
parents: 12991
diff changeset
   651
        self verboseInfo:(ex description).
12996
8662430ec3de changed: #start
Stefan Vogel <sv@exept.de>
parents: 12992
diff changeset
   652
        Verbose == true ifTrue:[ex suspendedContext fullPrintAllLevels:10].
12992
cad1bd395046 changed: #start
Claus Gittinger <cg@exept.de>
parents: 12991
diff changeset
   653
        ex reject.        
cad1bd395046 changed: #start
Claus Gittinger <cg@exept.de>
parents: 12991
diff changeset
   654
    ] do:[
12998
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   655
        |idx|
13127
60b2005943bb changed: #start
Claus Gittinger <cg@exept.de>
parents: 13126
diff changeset
   656
12998
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   657
        self verboseInfo:('starting...').
12992
cad1bd395046 changed: #start
Claus Gittinger <cg@exept.de>
parents: 12991
diff changeset
   658
        CommandLineArguments := (self additionalArgumentsFromRegistry) 
cad1bd395046 changed: #start
Claus Gittinger <cg@exept.de>
parents: 12991
diff changeset
   659
                                , Smalltalk commandLineArguments.
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   660
12992
cad1bd395046 changed: #start
Claus Gittinger <cg@exept.de>
parents: 12991
diff changeset
   661
        self verboseInfo:('args: ', CommandLineArguments asStringCollection asString).
cad1bd395046 changed: #start
Claus Gittinger <cg@exept.de>
parents: 12991
diff changeset
   662
13089
f31a89295700 changed:
Claus Gittinger <cg@exept.de>
parents: 13084
diff changeset
   663
        "--newAppInstance - do not reuse an existing application instance,
12998
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   664
         but run in a separate process"
13089
f31a89295700 changed:
Claus Gittinger <cg@exept.de>
parents: 13084
diff changeset
   665
        idx := CommandLineArguments indexOfAny:#('--newAppInstance').
12998
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   666
        idx == 0 ifTrue:[
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   667
            self shouldReuseRunningApplication ifTrue:[
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   668
                "Multiple Application support:
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   669
                 if another expecco is running, ask it to open another window for me.
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   670
                 If that is the case, the following function will not return, but instead exit."
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   671
                self checkForAndExitIfAnotherApplicationInstanceIsRunning.
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   672
            ].
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   673
        ] ifFalse:[
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   674
            CommandLineArguments removeAtIndex:idx.
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   675
        ].
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   676
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   677
        "/ Arrive here, if no other application is running.
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   678
        "/ to speedup startup, we did not load all dll's (only a subset of non-GUI dll's is present).
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   679
        "/ now, load all skipped libs from modules.stx.
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   680
        self loadRemainingClassLibraries.
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   681
12992
cad1bd395046 changed: #start
Claus Gittinger <cg@exept.de>
parents: 12991
diff changeset
   682
        Smalltalk isStandAloneApp ifTrue:[
cad1bd395046 changed: #start
Claus Gittinger <cg@exept.de>
parents: 12991
diff changeset
   683
            self loadPatches.
cad1bd395046 changed: #start
Claus Gittinger <cg@exept.de>
parents: 12991
diff changeset
   684
            self verboseInfo:('setup Smalltalk').
cad1bd395046 changed: #start
Claus Gittinger <cg@exept.de>
parents: 12991
diff changeset
   685
        ].
cad1bd395046 changed: #start
Claus Gittinger <cg@exept.de>
parents: 12991
diff changeset
   686
        self setupSmalltalkFromArguments:CommandLineArguments.
cad1bd395046 changed: #start
Claus Gittinger <cg@exept.de>
parents: 12991
diff changeset
   687
        self main
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   688
    ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   689
13127
60b2005943bb changed: #start
Claus Gittinger <cg@exept.de>
parents: 13126
diff changeset
   690
    "Modified: / 15-11-2010 / 14:19:27 / cg"
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   691
!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   692
11807
f9e3c45c53c8 Moved #startStartBlockProcess from ExpeccoStandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 11806
diff changeset
   693
startStartBlockProcess
f9e3c45c53c8 Moved #startStartBlockProcess from ExpeccoStandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 11806
diff changeset
   694
    Smalltalk startStartBlockProcess
f9e3c45c53c8 Moved #startStartBlockProcess from ExpeccoStandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 11806
diff changeset
   695
!
f9e3c45c53c8 Moved #startStartBlockProcess from ExpeccoStandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 11806
diff changeset
   696
12998
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   697
stxModulesFilename
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   698
    "answer the Filename of modules.stx"
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   699
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   700
    |file|
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   701
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   702
    file := 'modules.stx' asFilename.
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   703
    file exists ifTrue:[^ file].
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   704
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   705
    file := OperatingSystem pathOfSTXExecutable asFilename directory construct:'modules.stx'.
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   706
    file exists ifTrue:[^ file].
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   707
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   708
    self error:'cannot find: modules.stx'.
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   709
!
c967aa65e09a Move multiple app support and delayed DLL stuff to StandaloneStartup
Stefan Vogel <sv@exept.de>
parents: 12996
diff changeset
   710
11355
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   711
usage
13089
f31a89295700 changed:
Claus Gittinger <cg@exept.de>
parents: 13084
diff changeset
   712
    Stderr nextPutLine:'usage: ',self applicationName,' [options...]'.
f31a89295700 changed:
Claus Gittinger <cg@exept.de>
parents: 13084
diff changeset
   713
    Stderr nextPutLine:'  --help .................. output this message'.
f31a89295700 changed:
Claus Gittinger <cg@exept.de>
parents: 13084
diff changeset
   714
    Stderr nextPutLine:'  --verbose ............... verbose startup'.
f31a89295700 changed:
Claus Gittinger <cg@exept.de>
parents: 13084
diff changeset
   715
    Stderr nextPutLine:'  --noBanner .............. no splash screen'.
f31a89295700 changed:
Claus Gittinger <cg@exept.de>
parents: 13084
diff changeset
   716
    Stderr nextPutLine:'  --newAppInstance ........ start as its own application process (do not reuse a running instance)'.
11352
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   717
    self allowScriptingOption ifTrue:[
13089
f31a89295700 changed:
Claus Gittinger <cg@exept.de>
parents: 13084
diff changeset
   718
        Stderr nextPutLine:'  --scripting portNr ...... enable scripting via port (or stdin/stdOut, if 0)'.
11352
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   719
    ].
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   720
    self allowDebugOption ifTrue:[
13089
f31a89295700 changed:
Claus Gittinger <cg@exept.de>
parents: 13084
diff changeset
   721
        Stderr nextPutLine:'  --debug ................. enable Debugger'.
11352
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   722
    ].
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   723
    self suppressRCFileReading ifFalse:[
13089
f31a89295700 changed:
Claus Gittinger <cg@exept.de>
parents: 13084
diff changeset
   724
        Stderr nextPutLine:'  --rcFileName file ....... execute code from file on startup (default: ',self startupFilename,')'.
11352
023a07ae955c --scripting option
Claus Gittinger <cg@exept.de>
parents: 11107
diff changeset
   725
    ].
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   726
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   727
    "Created: / 19-09-2006 / 16:37:55 / cg"
13089
f31a89295700 changed:
Claus Gittinger <cg@exept.de>
parents: 13084
diff changeset
   728
    "Modified: / 06-10-2010 / 09:52:18 / cg"
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   729
! !
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   730
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   731
!StandaloneStartup class methodsFor:'startup-to be redefined'!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   732
12991
f9c0f556ea86 added: #additionalArgumentsFromRegistry
Claus Gittinger <cg@exept.de>
parents: 12988
diff changeset
   733
additionalArgumentsFromRegistry
f9c0f556ea86 added: #additionalArgumentsFromRegistry
Claus Gittinger <cg@exept.de>
parents: 12988
diff changeset
   734
    "can be redefined to fetch and return additional arguments from the registry 
f9c0f556ea86 added: #additionalArgumentsFromRegistry
Claus Gittinger <cg@exept.de>
parents: 12988
diff changeset
   735
     (or other .ini file). These are added to the beginning of the command line arguments."
f9c0f556ea86 added: #additionalArgumentsFromRegistry
Claus Gittinger <cg@exept.de>
parents: 12988
diff changeset
   736
f9c0f556ea86 added: #additionalArgumentsFromRegistry
Claus Gittinger <cg@exept.de>
parents: 12988
diff changeset
   737
    ^ #()
f9c0f556ea86 added: #additionalArgumentsFromRegistry
Claus Gittinger <cg@exept.de>
parents: 12988
diff changeset
   738
f9c0f556ea86 added: #additionalArgumentsFromRegistry
Claus Gittinger <cg@exept.de>
parents: 12988
diff changeset
   739
    "Created: / 04-08-2010 / 12:20:27 / cg"
f9c0f556ea86 added: #additionalArgumentsFromRegistry
Claus Gittinger <cg@exept.de>
parents: 12988
diff changeset
   740
!
f9c0f556ea86 added: #additionalArgumentsFromRegistry
Claus Gittinger <cg@exept.de>
parents: 12988
diff changeset
   741
11806
6508528f9499 Define #isHeadless with default value (false)
Stefan Vogel <sv@exept.de>
parents: 11764
diff changeset
   742
isHeadless
6508528f9499 Define #isHeadless with default value (false)
Stefan Vogel <sv@exept.de>
parents: 11764
diff changeset
   743
    "this is invoked early by Smalltalk>>mainStartup, to ask if I like to
6508528f9499 Define #isHeadless with default value (false)
Stefan Vogel <sv@exept.de>
parents: 11764
diff changeset
   744
     have a Display or if I am a non-GUI headless application.
6508528f9499 Define #isHeadless with default value (false)
Stefan Vogel <sv@exept.de>
parents: 11764
diff changeset
   745
6508528f9499 Define #isHeadless with default value (false)
Stefan Vogel <sv@exept.de>
parents: 11764
diff changeset
   746
     Redefine in subclass, if your application is a non-GUI application"
6508528f9499 Define #isHeadless with default value (false)
Stefan Vogel <sv@exept.de>
parents: 11764
diff changeset
   747
6508528f9499 Define #isHeadless with default value (false)
Stefan Vogel <sv@exept.de>
parents: 11764
diff changeset
   748
    ^ false
6508528f9499 Define #isHeadless with default value (false)
Stefan Vogel <sv@exept.de>
parents: 11764
diff changeset
   749
!
6508528f9499 Define #isHeadless with default value (false)
Stefan Vogel <sv@exept.de>
parents: 11764
diff changeset
   750
11355
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   751
main
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   752
    self verboseInfo:('entering main').
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   753
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   754
    self main:CommandLineArguments.
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   755
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   756
    "
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   757
     self main
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   758
     self main:#('--info') 
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   759
    "
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   760
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   761
    "Modified: / 31-10-2007 / 16:03:22 / cg"
10636
ba91c2d292f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   762
!
ba91c2d292f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   763
11355
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   764
main:argv
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   765
    self subclassResponsibility.
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   766
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   767
"/ a typical main: looks like (in a subclass):
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   768
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   769
"/    |app fileArg|
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   770
"/
2aa83c61ebd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11354
diff changeset
   771
"/    self verboseInfo:('starting application').
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   772
"/    app := <someGUIApplicationModelClass> open.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   773
"/
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   774
"/    self verboseInfo:('looking for args in ',argv).
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   775
"/    argv notEmptyOrNil ifTrue:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   776
"/        fileArg := argv last asFilename.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   777
"/        self verboseInfo:('fileArg is ',fileArg name).
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   778
"/        fileArg exists ifTrue:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   779
"/            self verboseInfo:('file exists').
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   780
"/
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   781
"/            ( #('foo' 'bar' 'baz' ) includes:fileArg suffix) ifTrue:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   782
"/                self verboseInfo:('loading').
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   783
"/
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   784
"/                Error handle:[:ex |
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   785
"/                    self verboseInfo:'error while loading'.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   786
"/                    ex suspendedContext fullPrintAll.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   787
"/                ] do:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   788
"/                    app menuLoadFromFile:fileArg
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   789
"/                ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   790
"/            ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   791
"/        ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   792
"/    ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   793
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   794
    "Created: / 19-09-2006 / 16:48:29 / cg"
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   795
! !
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   796
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   797
!StandaloneStartup class methodsFor:'documentation'!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   798
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   799
version
13127
60b2005943bb changed: #start
Claus Gittinger <cg@exept.de>
parents: 13126
diff changeset
   800
    ^ '$Header: /cvs/stx/stx/libbasic/StandaloneStartup.st,v 1.55 2010-11-15 13:19:37 cg Exp $'
12335
af9a7bc14d6a changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 11807
diff changeset
   801
!
af9a7bc14d6a changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 11807
diff changeset
   802
af9a7bc14d6a changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 11807
diff changeset
   803
version_CVS
13127
60b2005943bb changed: #start
Claus Gittinger <cg@exept.de>
parents: 13126
diff changeset
   804
    ^ '$Header: /cvs/stx/stx/libbasic/StandaloneStartup.st,v 1.55 2010-11-15 13:19:37 cg Exp $'
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   805
! !
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   806
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   807
StandaloneStartup initialize!