help with XP printing & user accounts

Dave Cragg dcragg at lacscentre.co.uk
Thu Apr 3 01:58:03 EST 2003


At 10:07 am -0700 2/4/03, Alex Rice wrote:
>On Wednesday, April 2, 2003, at 09:34  AM, Dave Cragg wrote:
>>
>>  Does your printing routine write out any files, and if so, does it
>>write them to the Program files directory or some other "out of
>>bounds" location. If so, that will be a problem. If you need to
>>write files, they should be saved somewhere in the user's area of
>>the Application and Settings folder (typically create a folder for
>>your app in the user's Application Data folder). Alternatively,
>>have the users install the app inside their area of the
>>Applications & Settings folder.
>
>Dave, thanks & yes my printing routing writes some temp files. I
>think this might be the problem. I'm debugging over the phone so I
>can't tell for sure. At first I didn't think this was the issue
>because the sysadmin said the permissions were such that the app
>could write files into Program Files folder, and the app was
>behaving as if it was writing temp files OK, for other functions.
>That it hung on printing was kind of a surprise.
>
>But right now I'm assuming that the writing to Program Files\AppName
>as a limited user account was the cause of the problem.
>
>Do you mean Documents and Settings, not Application and Settings?

Sorry, my mistake.

>Does script this look sane to you?

>put specialFolderPath(kCSIDL_APPDATA) into tAppDataPath
>if tAppDataPath = empty then
>   Err "Unknown path to \Documents and Settings\<user>\Application Data"
>end if

Does it have to run on platforms other than XP? I forget offhand if 
all older Windows versions have an Application data folder. But what 
I've done if specialFolderPath returns empty is to just use the 
application folder. This assumes that the user can write to Program 
Files, but I think it's a fairly safe assumption in such cases.


>put format("%s/MyApp", tAppDataPath) into tPath
>if there is not a folder tPath then -- create it
>   create folder tPath
>if the result <> empty then
>   Err the result
>end if

I think that specialFolderPath will return empty if the folder 
doesn't exist, so this part may be unnecessary. But don't take my 
word for it.

Cheers
Dave



More information about the use-livecode mailing list