-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b5ab44
commit cc569ec
Showing
10 changed files
with
160 additions
and
14 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
source/AbtShellProgramStarterApp/AbtShellProgramStarter.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
" | ||
I start commands launched from the shell/command of my host OS. | ||
" | ||
Class { | ||
#name : 'AbtShellProgramStarter', | ||
#superclass : 'AbtProgramStarter', | ||
#instVars : [ | ||
'currentDirectory', | ||
'stdoutPath' | ||
], | ||
#pools : [ | ||
'CfsConstants' | ||
], | ||
#category : 'AbtShellProgramStarterApp' | ||
} | ||
|
||
{ #category : 'accessing' } | ||
AbtShellProgramStarter >> currentDirectory [ | ||
^currentDirectory | ||
] | ||
|
||
{ #category : 'accessing' } | ||
AbtShellProgramStarter >> currentDirectory: aStringOrNil [ | ||
currentDirectory := aStringOrNil | ||
] | ||
|
||
{ #category : 'accessing' } | ||
AbtShellProgramStarter >> stdoutPath [ | ||
^stdoutPath | ||
] | ||
|
||
{ #category : 'accessing' } | ||
AbtShellProgramStarter >> stdoutPath: anObject [ | ||
stdoutPath := anObject | ||
] |
5 changes: 5 additions & 0 deletions
5
source/AbtShellProgramStarterApp/AbtShellProgramStarterApp.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Class { | ||
#name : 'AbtShellProgramStarterApp', | ||
#superclass : 'Application', | ||
#category : 'AbtShellProgramStarterApp' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Package { | ||
#name : 'AbtShellProgramStarterApp', | ||
#vaPrerequisites : ['AbtRunProgramStarterApp'], | ||
#vaSubApplications : [ | ||
{ | ||
#condition : '\'WIN32s\' = (System image subsystemType: \'OS\')', | ||
#subapps : [ | ||
'AbtShellProgramStarterWinPlatformSubApp' | ||
] | ||
} | ||
] | ||
} |
47 changes: 47 additions & 0 deletions
47
source/AbtShellProgramStarterWinPlatformSubApp/AbtShellProgramStarter.extension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
Extension { | ||
#name : 'AbtShellProgramStarter' | ||
} | ||
|
||
{ #category : '*AbtShellProgramStarterWinPlatformSubApp', | ||
#vaCategories : ['AbtRun-API'] } | ||
AbtShellProgramStarter >> startProgram [ | ||
"Start the receiver's program. If the program cannot be started, | ||
answer false." | ||
|
||
| input cmdLine rc startUpInfo processInformation | | ||
|
||
(self programName == nil or: [self programName = '']) ifTrue: [^false]. | ||
cmdLine := 'cmd /c ', self programName. | ||
((input := self programInput) == nil or: [input = '']) ifFalse: [ | ||
cmdLine := cmdLine , ' ' , input. | ||
self stdoutPath isEmptyOrNil ifFalse: [ | ||
cmdLine := cmdLine, ' > ', self stdoutPath | ||
] | ||
]. | ||
|
||
(startUpInfo := OSStartupinfo new) | ||
dwFlags: StartfUseshowwindow; | ||
wShowWindow: SwHide. | ||
|
||
rc := | ||
OS | ||
createProcess: nil | ||
lpszCommandLine: cmdLine | ||
lpsaProcess: Null | ||
lpsaThread: Null | ||
fInheritHandles: false | ||
fdwCreate: CreateNoWindow | ||
lpvEnvironment: Null | ||
lpszCurDir: self currentDirectory | ||
lpsiStartInfo: startUpInfo | ||
lppiProcInfo: (processInformation := OSProcessInformation new). | ||
|
||
self lastError: ( | ||
rc | ||
ifTrue: [ | ||
processInformation hProcess closeHandle. | ||
processInformation hThread closeHandle. | ||
0] | ||
ifFalse: [OS getLastError]). | ||
^rc | ||
] |
5 changes: 5 additions & 0 deletions
5
.../AbtShellProgramStarterWinPlatformSubApp/AbtShellProgramStarterWinPlatformSubApp.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Class { | ||
#name : 'AbtShellProgramStarterWinPlatformSubApp', | ||
#superclass : 'SubApplication', | ||
#category : 'AbtShellProgramStarterWinPlatformSubApp' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Package { | ||
#name : 'AbtShellProgramStarterWinPlatformSubApp', | ||
#vaParent : 'AbtShellProgramStarterApp' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters