[squeak-dev] Startup scripts on Windows - how?

Frank Shearar frank.shearar at gmail.com
Fri Mar 22 14:20:01 UTC 2013


I'm scratched my itch for the moment, making my build tools
"relativise" the path to the script. I think it's still a bug that I
can't refer to a script via a full path, and raised
http://bugs.squeak.org/view.php?id=7732.

frank

On 22 March 2013 13:17, Frank Shearar <frank.shearar at gmail.com> wrote:
> OK, I think I know what's going on.
>
> I have a directory C:\Users\frank\squeak-ci. In that I run rake,
> kicking off a build. That runs the following shell command -
> C:/Users/frank/squeak-ci/target/Squeak-4.10.2-2612-src-32/Squeak4.10.2-2612.exe
>  "C:/Users/frank/squeak-ci/target/TrunkImage.image"
> C:/Users/frank/squeak-ci/update-image.st - from within
> C:\Users\frank\squeak-ci\target, a dumping ground for various build
> artifacts.
>
> If I instead use ../update-image.st as the startup script, everything
> works correctly. So a full path to the script fails, while a relative
> path works.
>
> frank
>
> On 22 March 2013 12:59, Bob Arning <arning315 at comcast.net> wrote:
>> seems like URL is only one option...
>>
>>             scriptName isEmpty ifFalse:[
>>                 "figure out if script name is a URL by itself"
>>                 isUrl := (scriptName asLowercase beginsWith:'http://') or:[
>>                         (scriptName asLowercase beginsWith:'file://') or:[
>>                         (scriptName asLowercase beginsWith:'ftp://')]].
>>                 isUrl ifFalse:[ | encodedPath pathTokens |
>>                     "Allow for ../dir/scriptName arguments"
>>                     pathTokens := scriptName splitBy: FileDirectory slash.
>>                     pathTokens := pathTokens collect: [:s | s
>> encodeForHTTP].
>>                     encodedPath := pathTokens reduce: [:acc :each | acc ,
>> FileDirectory slash , each].
>>                     scriptName := (FileDirectory default uri
>>                         resolveRelativeURI: encodedPath) asString]].
>>         ]. ]
>>
>> did you try a plain old file path?
>>
>> On 3/22/13 7:53 AM, Frank Shearar wrote:
>>
>> On a Linux machine, you can run a script from the command line thusly:
>> my/path/to/vm/squeak MyImage.image path/to/my/script.st. On Windows,
>> the analogous operation fails because (I think) CodeLoader doesn't
>> know how to handle file URIs like
>> 'file:///C%3A/Users/frank/squeak-ci/target/update-image.st'.
>>
>> Is this a known problem? How else can I run a startup script on
>> Windows? (Surely I'm not the only person in the world who wants to do
>> this?)
>>
>> frank


More information about the Squeak-dev mailing list