StandaloneStartup.st
author fm
Tue, 05 Aug 2008 09:55:12 +0200
changeset 11106 740c42559ef7
parent 11105 4deedf531f75
child 11107 2c1b779bc57a
permissions -rw-r--r--
changed: #isAnotherApplicationInstanceRunning
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, 
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    and redefine the #main method there.
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
"
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
! !
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
!StandaloneStartup class methodsFor:'initialization'!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
initialize
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
    "/ Verbose := true.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
    Verbose := false.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
! !
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
!StandaloneStartup class methodsFor:'helpers'!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
redirectStandardStreams
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
    Stdout := Stderr.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
    Transcript := Stderr.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
verboseInfo:msg
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
    Verbose == true ifFalse:[^ self].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
    Transcript 
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
        show:('%1 [info]: ' bindWith:(self applicationName));
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
        showCR:msg
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
    "Modified: / 19-09-2006 / 16:30:27 / cg"
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
! !
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
    94
!StandaloneStartup class methodsFor:'multiple applications support'!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
    95
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
    96
applicationRegistryPath
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
    97
    "the key under which this application stores its process ID in the registry
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
    98
     as a collection of path-components.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
    99
     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
   100
     in HKEY_CURRENT_USER\Software\foo\bar\baz\CurrentID.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   101
     (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
   102
     Used to detect if another instance of this application is already running."
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   103
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   104
    self subclassResponsibility
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   105
!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   106
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   107
applicationUUID
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   108
    "answer an application-specific unique uuid.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   109
     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
   110
     if another instance of this application is already running.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   111
     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
   112
    
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   113
    self subclassResponsibility
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   114
!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   115
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   116
checkForAndExitIfAnotherApplicationInstanceIsRunning
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   117
    "if another instance of this application is running,
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   118
     send it an openFile command for my file-argument, and exit.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   119
     (i.e. to let the already running application open up another window)."
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   120
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   121
    |shouldExit|
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   122
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   123
    self isAnotherApplicationInstanceRunning ifTrue:[
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   124
        shouldExit := self processStartupOfASecondInstance.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   125
        shouldExit ifTrue:[
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   126
            self releaseApplicationMutex.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   127
            Smalltalk isStandAloneApp ifTrue:[
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   128
                Smalltalk exit.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   129
            ]
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   130
        ].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   131
    ].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   132
! !
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   133
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   134
!StandaloneStartup class methodsFor:'multiple applications support-helpers'!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   135
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   136
applicationRegistryEntry
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   137
    "retrieve the registry entry in which (if present), any currently running application
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   138
     has left its process ID"
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   139
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   140
    |path relPathName applicationEntry softwareEntry|
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   141
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   142
    path := self applicationRegistryPath.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   143
    relPathName := path asStringWith:$\.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   144
    applicationEntry := Win32OperatingSystem registryEntry key:'HKEY_CURRENT_USER\Software\',relPathName.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   145
    applicationEntry isNil ifTrue:[
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   146
        softwareEntry := Win32OperatingSystem registryEntry key:'HKEY_CURRENT_USER\Software'.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   147
        softwareEntry isNil ifTrue:[
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   148
            Transcript showCR: 'Failed to get Software entry in registry'.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   149
            ^ nil.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   150
        ].
11103
aae220bd7157 changed: #applicationRegistryEntry
fm
parents: 11102
diff changeset
   151
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   152
        path do:[:subKey |
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   153
            |subEntry|
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   154
11103
aae220bd7157 changed: #applicationRegistryEntry
fm
parents: 11102
diff changeset
   155
            subEntry := softwareEntry createSubKeyNamed:subKey.
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   156
            subEntry isNil ifTrue:[
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   157
                Transcript showCR: 'Failed to create ',subKey,' entry in registry'.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   158
                ^ nil.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   159
            ].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   160
            softwareEntry := subEntry.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   161
        ].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   162
        applicationEntry := softwareEntry.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   163
    ].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   164
    ^ applicationEntry
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   165
!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   166
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   167
currentIDKeyInRegistry
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   168
    ^ 'CurrentID'
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   169
!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   170
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   171
getCurrentIDFromRegistry
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   172
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   173
    |applicationEntry|
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   174
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   175
    applicationEntry := self applicationRegistryEntry.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   176
    applicationEntry isNil ifTrue:[^ nil.].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   177
    ^ applicationEntry valueNamed: self currentIDKeyInRegistry
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   178
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   179
    "
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   180
     |hWnd externalAddress|
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   181
     hWnd := DapasXStartup getCurrentIDFromRegistry.   
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   182
     hWnd isEmptyOrNil ifTrue:[^ self halt.].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   183
     hWnd := hWnd asInteger.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   184
     externalAddress := ExternalAddress newAddress: hWnd.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   185
     Display raiseWindow:externalAddress.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   186
     Display setForegroundWindow:externalAddress
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   187
    "
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   188
!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   189
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   190
getIDOfRunningApplicationFromRegistryEntry
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   191
    |applicationEntry|
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   192
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   193
    applicationEntry := self applicationRegistryEntry.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   194
    applicationEntry isNil ifTrue:[^ nil.].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   195
    ^ applicationEntry valueNamed: self currentIDKeyInRegistry
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   196
!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   197
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   198
isAnotherApplicationInstanceRunning
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   199
    "answer true, if another instance of mzself is currently running.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   200
     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
   201
    
11106
740c42559ef7 changed: #isAnotherApplicationInstanceRunning
fm
parents: 11105
diff changeset
   202
    | lastErrorCode alreadyExists handleAndLastErrorCode |
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   203
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   204
    OperatingSystem isMSDOSlike ifTrue:[
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   205
        handleAndLastErrorCode := OperatingSystem createMutexNamed: (self applicationUUID printString).
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   206
        MutexHandle := handleAndLastErrorCode first.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   207
        lastErrorCode := handleAndLastErrorCode second.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   208
        "/ self assert: lastErrorCode == 0.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   209
        alreadyExists := 
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   210
            MutexHandle isNil 
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   211
            or:[lastErrorCode == 183 "ERROR_ALREADY_EXISTS"
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   212
            or:[lastErrorCode == 5 "ERROR_ACCESS_DENIED"]].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   213
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   214
        alreadyExists ifFalse:[OperatingSystem waitForSingleObject: MutexHandle].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   215
        ^ alreadyExists
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   216
    ].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   217
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   218
    ^ false.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   219
!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   220
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   221
processStartupOfASecondInstance
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   222
    "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
   223
     If I can get the currentID (i.e. windowID) of the first one and there is a command line argument with a file, 
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   224
     send a message to the main window of the already running application, o ask it for another window.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   225
     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
   226
     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
   227
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   228
    |currentIDStringFromRegistry currentIDFromRegistry fileArg commands aWindowId|
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   229
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   230
    commands := Smalltalk commandLineArguments.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   231
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   232
    currentIDStringFromRegistry := self getCurrentIDFromRegistry.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   233
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   234
    "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
   235
     we should wait in case of starting the first instance of the application 
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   236
     with a multiple selection of files."
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   237
    (currentIDStringFromRegistry isEmptyOrNil and:[commands notEmptyOrNil]) ifTrue:[
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   238
        Delay waitForSeconds: 2.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   239
    ].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   240
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   241
    currentIDStringFromRegistry := self getCurrentIDFromRegistry.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   242
    currentIDStringFromRegistry isEmptyOrNil ifTrue:[
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   243
        ^ (Dialog confirm: ('Continue opening a new instance of %1 or exit?' bindWith:self applicationName)
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   244
                    title: ('%1 is already open!!' bindWith:self applicationName)
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   245
                 yesLabel: 'Continue' 
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   246
                  noLabel: 'Exit') not.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   247
    ].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   248
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   249
    currentIDFromRegistry := Integer readFrom:currentIDStringFromRegistry.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   250
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   251
    "/ bring the other application to the foreground
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   252
    aWindowId := ExternalAddress newAddress: currentIDFromRegistry.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   253
    Display setForegroundWindow: aWindowId.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   254
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   255
    "Autostart for associated extension"
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   256
    commands notEmpty ifTrue:[
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   257
        fileArg := commands last asFilename.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   258
        fileArg exists ifTrue:[
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   259
            self sendOpenPathCommand:(fileArg pathName) toWindowId: aWindowId.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   260
        ].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   261
    ].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   262
    ^ true
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   263
!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   264
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   265
releaseApplicationMutex
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   266
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   267
    OperatingSystem isMSDOSlike ifTrue:[
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   268
        MutexHandle notNil ifTrue:[
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   269
            OperatingSystem releaseMutex: MutexHandle.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   270
            OperatingSystem primCloseHandle: MutexHandle.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   271
        ].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   272
    ].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   273
!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   274
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   275
sendCommand:message toWindowId:aWindowId
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   276
    "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
   277
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   278
    Display 
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   279
        sendCopyDataString: message 
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   280
        toWindowId: aWindowId.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   281
!
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   282
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   283
sendOpenPathCommand:pathName toWindowId:aWindowId
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   284
    "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
   285
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   286
    self sendCommand:('openPath:', pathName) toWindowId:aWindowId.
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
writeCurrentIDIntoRegistry: currentID
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   290
11104
d1a963670d67 changed: #writeCurrentIDIntoRegistry:
fm
parents: 11103
diff changeset
   291
    |applicationEntry currentIDEntry|
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   292
11104
d1a963670d67 changed: #writeCurrentIDIntoRegistry:
fm
parents: 11103
diff changeset
   293
    applicationEntry := self applicationRegistryEntry.
d1a963670d67 changed: #writeCurrentIDIntoRegistry:
fm
parents: 11103
diff changeset
   294
    applicationEntry isNil ifTrue:[^ false.].
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   295
11104
d1a963670d67 changed: #writeCurrentIDIntoRegistry:
fm
parents: 11103
diff changeset
   296
    currentIDEntry := applicationEntry createSubKeyNamed:(self currentIDKeyInRegistry).
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   297
    currentIDEntry isNil ifTrue:[
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   298
        Transcript showCR: 'Failed to create CurrentID entry in registry'.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   299
        ^ false.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   300
    ].
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   301
11104
d1a963670d67 changed: #writeCurrentIDIntoRegistry:
fm
parents: 11103
diff changeset
   302
    ^ applicationEntry valueNamed:(self currentIDKeyInRegistry) put:(currentID printString).
11102
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   303
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   304
    "
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   305
     | currentID returnedCurrentID |
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   306
     currentID := 999.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   307
     DapasXStartup writeCurrentIDIntoRegistry: currentID.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   308
     returnedCurrentID := DapasXStartup getCurrentIDFromRegistry.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   309
     self assert: currentID = returnedCurrentID asNumber.
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   310
    "
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   311
! !
fece26c79af5 refactored
Claus Gittinger <cg@exept.de>
parents: 11056
diff changeset
   312
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
!StandaloneStartup class methodsFor:'queries'!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
applicationName
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
    "used in verbose messages - can be redefined in subclasses"
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
    |nm|
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   319
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
    nm := self nameWithoutPrefix.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
    (nm endsWith:'Startup') ifTrue:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
        ^ nm copyWithoutLast:('Startup' size).
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323
    ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   324
    (nm endsWith:'Start') ifTrue:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   325
        ^ nm copyWithoutLast:('Start' size).
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   326
    ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   327
    ^ nm
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   328
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   329
    "Created: / 19-09-2006 / 16:26:44 / cg"
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   330
!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   331
10040
59d0c20b139f protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9944
diff changeset
   332
isBrowserStartable
59d0c20b139f protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9944
diff changeset
   333
    "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
   334
59d0c20b139f protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9944
diff changeset
   335
    ^ false
59d0c20b139f protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9944
diff changeset
   336
59d0c20b139f protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9944
diff changeset
   337
    "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
   338
!
59d0c20b139f protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9944
diff changeset
   339
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   340
startupFilename
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   341
    "used in verbose messages - can be redefined in subclasses"
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   342
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   343
    ^ self applicationName asLowercase,'Start.rc'
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   344
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   345
    "
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   346
     ExpeccoStartup startupFilename
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   347
    "
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   348
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   349
    "Created: / 19-09-2006 / 16:38:28 / cg"
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   350
! !
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   351
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   352
!StandaloneStartup class methodsFor:'startup'!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   353
11055
e600e19e2e7f loadPatch extracted to be redefinable.
Claus Gittinger <cg@exept.de>
parents: 10956
diff changeset
   354
loadPatch:fileName
11056
e2c4a6e948b6 loadPatch extracted to be redefinable.
Claus Gittinger <cg@exept.de>
parents: 11055
diff changeset
   355
    self verboseInfo:('loading patch: ',fileName baseName).
11055
e600e19e2e7f loadPatch extracted to be redefinable.
Claus Gittinger <cg@exept.de>
parents: 10956
diff changeset
   356
    Smalltalk fileIn:fileName pathName.
e600e19e2e7f loadPatch extracted to be redefinable.
Claus Gittinger <cg@exept.de>
parents: 10956
diff changeset
   357
!
e600e19e2e7f loadPatch extracted to be redefinable.
Claus Gittinger <cg@exept.de>
parents: 10956
diff changeset
   358
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   359
loadPatches
10934
970557a121e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10886
diff changeset
   360
    |patchesDir|
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   361
10934
970557a121e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10886
diff changeset
   362
    patchesDir := OperatingSystem pathOfSTXExecutable asFilename directory construct:'patches'.
970557a121e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10886
diff changeset
   363
    (patchesDir exists and:[patchesDir isDirectory]) ifTrue:[
970557a121e7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10886
diff changeset
   364
        patchesDir directoryContents sort do:[:eachFile |
11055
e600e19e2e7f loadPatch extracted to be redefinable.
Claus Gittinger <cg@exept.de>
parents: 10956
diff changeset
   365
            self loadPatch:(patchesDir construct:eachFile).
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   366
        ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   367
    ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   368
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   369
    "Modified: / 19-09-2006 / 16:30:58 / cg"
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   370
!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   371
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   372
setupSmalltalkFromArguments:argv
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   373
    |idx rcFilename nextArg|
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   374
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   375
"/    Smalltalk beHeadless:true.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   376
"/    OperatingSystem disableSignal:(OperatingSystem sigHUP).
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   377
"/    Smalltalk infoPrinting:true.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   378
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   379
    (argv includes:'--help') ifTrue:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   380
        self usage.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   381
        AbortOperationRequest raise.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   382
    ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   383
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   384
    idx := argv indexOfAny:#('--verbose' '-V').
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   385
    idx ~~ 0 ifTrue:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   386
        argv removeAtIndex:idx.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   387
        Verbose := true.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   388
    ].
10773
98a51414b27f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10772
diff changeset
   389
    self verboseInfo:('args: ',argv asArray printString).
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   390
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   391
    idx := argv indexOfAny:#('--debug').
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   392
    idx ~~ 0 ifTrue:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   393
        argv removeAtIndex:idx.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   394
        self setupToolsForDebug.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   395
    ] ifFalse:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   396
        self setupToolsForNoDebug.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   397
    ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   398
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   399
    idx := argv indexOf:'--rcFileName'.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   400
    idx ~~ 0 ifTrue:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   401
        nextArg := argv at:(idx + 1) ifAbsent:nil.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   402
        (nextArg notNil and:[ (nextArg startsWith:'-') not ]) ifTrue:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   403
            rcFilename := nextArg.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   404
            argv removeAtIndex:idx+1; removeAtIndex:idx.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   405
        ]
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   406
    ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   407
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   408
    rcFilename isNil ifTrue:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   409
        rcFilename := self startupFilename.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   410
    ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   411
    rcFilename asFilename exists ifTrue:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   412
        self verboseInfo:('reading ',rcFilename,'...').
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   413
        rcFilename isAbsolute ifFalse:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   414
            rcFilename := OperatingSystem pathOfSTXExecutable asFilename directory constructString:rcFilename.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   415
        ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   416
        Smalltalk secureFileIn:rcFilename
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   417
    ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   418
    ^ true
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   419
10773
98a51414b27f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10772
diff changeset
   420
    "Modified: / 31-10-2007 / 16:05:59 / cg"
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   421
!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   422
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   423
setupToolsForDebug
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   424
    Debugger := DebugView ? MiniDebugger.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   425
    Inspector := InspectorView ? MiniInspector.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   426
    self verboseInfo:('debug enabled - CTRL-C brings you into a debugger.').
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   427
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   428
    "Created: / 19-09-2006 / 16:40:32 / cg"
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   429
!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   430
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   431
setupToolsForNoDebug
10773
98a51414b27f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10772
diff changeset
   432
    Smalltalk isStandAloneApp ifTrue:[
98a51414b27f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10772
diff changeset
   433
        Debugger := nil.
98a51414b27f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10772
diff changeset
   434
        Inspector := nil.
98a51414b27f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10772
diff changeset
   435
        NewLauncher := nil.
98a51414b27f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10772
diff changeset
   436
        self redirectStandardStreams.
98a51414b27f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10772
diff changeset
   437
    ].
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   438
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   439
    "Created: / 19-09-2006 / 16:40:47 / cg"
10773
98a51414b27f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10772
diff changeset
   440
    "Modified: / 31-10-2007 / 16:18:40 / cg"
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   441
!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   442
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   443
start
10772
13bb80f40496 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10636
diff changeset
   444
    CommandLineArguments := Smalltalk commandLineArguments.
13bb80f40496 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10636
diff changeset
   445
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   446
    self verboseInfo:('starting...').
10956
ab4f2618182f changed #main
fm
parents: 10934
diff changeset
   447
    self verboseInfo:('args: ', CommandLineArguments asStringCollection asString).
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   448
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   449
    Smalltalk isStandAloneApp ifTrue:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   450
        self loadPatches.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   451
        self verboseInfo:('setup Smalltalk').
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   452
    ].
10772
13bb80f40496 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10636
diff changeset
   453
    self setupSmalltalkFromArguments:CommandLineArguments.
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   454
    self main
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   455
10772
13bb80f40496 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10636
diff changeset
   456
    "Modified: / 31-10-2007 / 16:03:44 / cg"
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   457
!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   458
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   459
usage
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   460
    Stderr nextPutLine:'usage:'.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   461
    Stderr nextPutLine:'  ',self applicationName,' [options...]'.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   462
    Stderr nextPutLine:'    options:'.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   463
    Stderr nextPutLine:'          --help .................. output this message'.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   464
    Stderr nextPutLine:'          --verbose ............... verbose startup'.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   465
    Stderr nextPutLine:'          --debug ................. enable Debugger'.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   466
    Stderr nextPutLine:'          --rcFileName file ....... execute code from file on startup (default: ',self startupFilename,')'.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   467
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   468
    "Created: / 19-09-2006 / 16:37:55 / cg"
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   469
! !
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   470
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   471
!StandaloneStartup class methodsFor:'startup-to be redefined'!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   472
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   473
main
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   474
    self verboseInfo:('entering main').
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   475
10772
13bb80f40496 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10636
diff changeset
   476
    self main:CommandLineArguments.
10636
ba91c2d292f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   477
ba91c2d292f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   478
    "
ba91c2d292f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   479
     self main
ba91c2d292f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   480
     self main:#('--info') 
ba91c2d292f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   481
    "
ba91c2d292f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   482
10772
13bb80f40496 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10636
diff changeset
   483
    "Modified: / 31-10-2007 / 16:03:22 / cg"
10636
ba91c2d292f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   484
!
ba91c2d292f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   485
ba91c2d292f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   486
main:argv
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   487
    self subclassResponsibility.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   488
10636
ba91c2d292f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   489
"/ a typical main: looks like (in a subclass):
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   490
10636
ba91c2d292f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   491
"/    |app fileArg|
ba91c2d292f3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10040
diff changeset
   492
"/
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   493
"/    self verboseInfo:('starting application').
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   494
"/    app := <someGUIApplicationModelClass> open.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   495
"/
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   496
"/    self verboseInfo:('looking for args in ',argv).
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   497
"/    argv notEmptyOrNil ifTrue:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   498
"/        fileArg := argv last asFilename.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   499
"/        self verboseInfo:('fileArg is ',fileArg name).
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   500
"/        fileArg exists ifTrue:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   501
"/            self verboseInfo:('file exists').
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   502
"/
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   503
"/            ( #('foo' 'bar' 'baz' ) includes:fileArg suffix) ifTrue:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   504
"/                self verboseInfo:('loading').
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   505
"/
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   506
"/                Error handle:[:ex |
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   507
"/                    self verboseInfo:'error while loading'.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   508
"/                    ex suspendedContext fullPrintAll.
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   509
"/                ] do:[
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   510
"/                    app menuLoadFromFile:fileArg
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   511
"/                ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   512
"/            ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   513
"/        ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   514
"/    ].
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   515
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   516
    "Created: / 19-09-2006 / 16:48:29 / cg"
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   517
! !
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   518
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   519
!StandaloneStartup class methodsFor:'documentation'!
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   520
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   521
version
11106
740c42559ef7 changed: #isAnotherApplicationInstanceRunning
fm
parents: 11105
diff changeset
   522
    ^ '$Header: /cvs/stx/stx/libbasic/StandaloneStartup.st,v 1.15 2008-08-05 07:55:12 fm Exp $'
9944
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   523
! !
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   524
aa3d787443ef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   525
StandaloneStartup initialize!