cbc, your answer was helpful. I now have FFI loaded with the Win32
extensions. I tried the example you provided but it failed; there is no
nShowCmd: ".
see if I can get it to work for me.
Post by Chris CunninghamThe correct way to load FFI is to load it from SqueakMap, update, in the
mid left panel bring up the menu and unselect "New safely-available
packages", and then install head. Answer yes to installling something not
compatible with your current system (it is, just the map package hasn't
been changed to say it is compatible).
Once this is finished, FFI will be loaded.
At this point, you still need to load the Win32 extentions. Open the
Monticello Browser, click in the repository panel on the right, choosing "
http://source.squeak.org/FFI". Open this repostiory. In this
repository, choose the "FFI-Win32" package. Pick the latest package
(currently FFI-Win32-nice.12.mcz) and load it.
At this point Ron's example should work. This will definitely work in a
5.2 image.
Now, Ron's example will either run the program will no results, or will
error out if it can't run, I believe. Try it out first and see if it works
for you.
If it doesn't, then maybe my exmaple (the is just an extension of what Ron
scanScript := ByteString streamContents: [:bs|
bs nextPutAll: 'my.exe > output.txt'); cr; lf.
bs nextPutAll: 'del '; nextPutAll: (fn := 'Scan', serverName, '.bat').
].
file := FileStream newFileNamed: fn.
[file nextPutAll: scanScript] ensure: [file close].
Win32Shell new shellExecute: fn. "execute runs without opening the
program window..."
dir := FileDirectory default.
[dir fileExists: fn] whileTrue: [(Delay forSeconds: 1) wait].
file := FileStream oldFileNamed: 'output.txt'.
raw := file contentsOfEntireFile. "closes file"
dir deleteFileNamed: outFn.
"Do something with raw - the results of the program my.exe"
Of course, this should all just work with ProcessWrapper, but I switched
away from that a few years ago - I don't remember why. Maybe I wanted lots
of concurrent programs running at once.
-cbc
Post by John-Reed MaffeoRon,
Thanks for the suggestion, however it did not work for me on a 5.2 image
or a 4.1 image that I downloaded so I could test in the version you
are using.
I verified that I have the shell.dll file, but I don't see FFI or
Win32Shell in either image.
I can't find any useful documentation about Win32Shell.
Web searches indicate that I might want to try loading Alien so I will
give that a try and see what happens.
jrm
Post by Ron TeitelbaumHi JRM,
Not sure how it's done today but on my 4.1 system, we do the following.
result := Win32Shell new shellOpen: 'my.exe'.
It uses FFI and shell32.dll
All the best,
Ron Teitelbaum
Post by John-Reed MaffeoI have an application running on Mac which I am trying to port to run
on Windows.
PipeableOSProcess fails on an know issue.
Is Process Wrapper a viable option? It requires adding
SmartSyntaxInterpreterPlugin, and ProcessWrapperPlugin.dll.
All I want to do is run an .exe and capture the output.
Any suggestions?
- jrm
_______________________________________________
Beginners mailing list
http://lists.squeakfoundation.org/mailman/listinfo/beginners
_______________________________________________
Beginners mailing list
http://lists.squeakfoundation.org/mailman/listinfo/beginners
_______________________________________________
Beginners mailing list
http://lists.squeakfoundation.org/mailman/listinfo/beginners
_______________________________________________
Beginners mailing list
http://lists.squeakfoundation.org/mailman/listinfo/beginners