I run Scratch from a USB drive (like the folks in this thread). I want the Home directory to be a sub folder in my Scracth folder on the USB stick. However hat setting in the INI file seems to require an absolute path (e.g. 'C:\PortableApps\Scratch\Projects\'), where for proper portability it should use a relative path (e.g. '..\Projects' or '%APPDATA%\Projects'). I cannot get anything other than an absolute path to work. Is there a way of doing this?
Many thanks in advance for any information provided.
Last edited by w_nightshade (2010-03-03 11:35:48)
Offline
Scratch should create an ini if there isn't one already there.
So don't even worry about the ini file, as long as you have exe, image, and plugins, you're good.
Besides, the ini file is meant more for squeak settings that there isn't too much point in messing with, so the defaults are OK.
Offline
Thanks for your reply, but you misunderstand what I am after.
If I leave out the ini (or the HOme directory setting) entirely, the default directory is created under My Documents - and I consider writing unsolicited data to anyone else's machine to be a big no-no. I want Scratch to make the default projects folder be on the flash drive itself, but this can't be done with a hard-coded drive letter, as different systems may assign my flash drive any available drive letter.
So my original question still stands - how do I get Scratch to use a relative file path instead of an absolute one?
Offline
Hmmm... You'll probably have to edit the source code to do this.
However, windows environment variables may help - such as using %USERPROFILE%\Desktop to write to the user's desktop.
Offline
I was deeply afraid of this. I am not competent to touch source code. I tried using the %APPDATA% environment variable (which should work) but it does not.
Am I stuck?
Offline
w_nightshade wrote:
I was deeply afraid of this. I am not competent to touch source code. I tried using the %APPDATA% environment variable (which should work) but it does not.
Am I stuck?
Did you try %CD% yet?
Offline
I tried that, and I got an error, which led me to the debugger and this bit of code:
setPathName: t1
(t1 isEmpty
or: [t1 first = $\
or: [t1 size >= 2
and: [t1 second = $: and: [t1 first isLetter]]]])
ifTrue: [^ super setPathName: t1].
self error: 'Fully qualified path expected'Looks like I am stuck. Thanks for your help anyway. *sigh*
Offline
w_nightshade wrote:
I tried that, and I got an error, which led me to the debugger and this bit of code:
Code:
setPathName: t1 (t1 isEmpty or: [t1 first = $\ or: [t1 size >= 2 and: [t1 second = $: and: [t1 first isLetter]]]]) ifTrue: [^ super setPathName: t1]. self error: 'Fully qualified path expected'Looks like I am stuck. Thanks for your help anyway. *sigh*
Part of this code should have been highlighted - Please specify which part so we can help you better.
Offline
If I set the following line in the INI file:
Home=%CD%\WinScratch
Then I get the following screen:
If I debug, the second line in that window displays the code linked above.
Offline