Saving data in List Magic tables

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Saving data in List Magic tables

charles61
I have a standalone consisting of a splash stack and an app stack. I have set up a script that the user can insert some information into two tables - one for students and one for adults. These tables are on two different cards in my app stack.

I have been testing my standalone on Windows XP where it was installed in the AllUsersAppData directory using an installer program.  I tried the following script for the card that has the student list:

on closeCard
   Save "School Report" as "\Documents and Settings\All Users\Application Data"
end closeCard

But this does not save the data in the two tables!  Any suggestions would be greatly appreciated!
Reply | Threaded
Open this post in threaded view
|

Re: Saving data in List Magic tables

Richard Gaskin
charles61 wrote:

> I have a standalone consisting of a splash stack and an app stack. I have set
> up a script that the user can insert some information into two tables - one
> for students and one for adults. These tables are on two different cards in
> my app stack.
>
> I have been testing my standalone on Windows XP where it was installed in
> the AllUsersAppData directory using an installer program.  I tried the
> following script for the card that has the student list:
>
> on closeCard
>    Save "School Report" as "\Documents and Settings\All Users\Application
> Data"
> end closeCard
>
> But this does not save the data in the two tables!  Any suggestions would be
> greatly appreciated!

When the unexpected happens, it's time for error-checking.   One of the
challenges of crafting apps is that when you're being diligent only
about half your code will actually do what your app does, and the other
half will be all the stuff you add to account for when things go wrong. :)

In Rev, most error conditions are reported in "the result" immediately
after a command fails, and for I/O and other system-related tasks you
may find an additional OS-supplied error code using the sysError function.

So to better understand what's happening there you may try adding that
to your script.

Also, by hard-wiring your paths they won't work on international systems
where the spelling may differ, and may not survive changes to the OS if
MS changes the names of those folders in a future version.

The solution for that is Rev's specialFolderPath function.  Rev provides
a variety of constants you can pass to that function to get the path,
and pretty much all OS constants provided by the OS vendor can be used
as well -- Ken Ray's put together this comprehensive list:
<http://sonsothunder.com/devres/revolution/tips/file010.htm>

While Rev doesn't include a built-in constant for that, looking at Ken's
list you can use the OS constant instead, which is "35".

If you want that to be cross-platform you can use Ken's list to get the
Application Support constant for OS X, but for now here's your code
modified with specialFolderPath and including the error check which will
hopefully help diagnose the issue.

A ha!  As I was rewriting your code I noticed that you're specifying
only the folder and not the file name, so effectively you're asking Rev
to try to turn the stack into a folder, which of course it can't do.
The fix for that is included in this revision:

on closeCard
    Save "School Report" as (specialFolderPath(35)&"/School Report.rev")
    if the result is not empty then
       answer error "An error occurred while saving the report: "&cr&\
          the result & "("& sysError() &")"
     end if
end closeCard

Note that the ".rev" extension can be changed to anything else you feel
might be appropriate for your app. Rev opens stacks based on their
internal stucture, and a standalone is not required to use the .rev file
name extension to work with stack files, allowing you to define your own
document types.

If you want to use a custom file name extension you may want to check
<http://filext.com/> to see if another program may be using it.  That's
not a comprehensive list (Microsoft doesn't maintain such an index), but
it'll at least help avoid some of the more obvious conflicts.

--
  Richard Gaskin
  Fourth World
  Rev training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com
  revJournal blog: http://revjournal.com/blog.irv
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Saving data in List Magic tables

Klaus on-rev
In reply to this post by charles61
Hi Charles,

additionally to Richard's answer, plese see my coments below your code.

> I have a standalone consisting of a splash stack and an app stack. I have set
> up a script that the user can insert some information into two tables - one
> for students and one for adults. These tables are on two different cards in
> my app stack.
>
> I have been testing my standalone on Windows XP where it was installed in
> the AllUsersAppData directory using an installer program.  I tried the
> following script for the card that has the student list:
>
> on closeCard
>   Save "School Report" as "\Documents and Settings\All Users\Application
> Data"
> end closeCard

1. You only provide the STRING "School report" to the SAVE command!
Probably you mean "save STACK "School report..."?

2. You only provided the target FOLDER and no filename!
Hint: specialfolderpath(35) will give you that folder on all win versions!
...
save STACK "School report" as (specialfolderpath(35) & "/" & "School report.rev"
## Richards debug code here...
...

Hope that helps.

> But this does not save the data in the two tables!  Any suggestions would be
> greatly appreciated!

Best

Klaus

--
Klaus Major
http://www.major-k.de
[hidden email]

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Saving data in List Magic tables

charles61
In reply to this post by Richard Gaskin
Richard,

Thanks for pointing out my mistake and how to correct it! I was using Rev's Dictionary examples. And I agree with your comments about crafting an app! 

Regarding the .Rev extension, I had used the extension of .dat for a previous app, which consisted of only 8 cards. This was to make it harder for someone to try to open the app. The .dat extension worked great.  But I was not successfully in using the .dat extension with my current project, which consists of 71 cards plus 18 customized dialogs. I got standalone errors in the exec recognizing the app stack.

Thanks so much!!

Charles Szasz
[hidden email]




On Aug 5, 2010, at 10:35 AM, Richard Gaskin [via Runtime Revolution] wrote:

charles61 wrote:

> I have a standalone consisting of a splash stack and an app stack. I have set
> up a script that the user can insert some information into two tables - one
> for students and one for adults. These tables are on two different cards in
> my app stack.
>
> I have been testing my standalone on Windows XP where it was installed in
> the AllUsersAppData directory using an installer program.  I tried the
> following script for the card that has the student list:
>
> on closeCard
>    Save "School Report" as "\Documents and Settings\All Users\Application
> Data"
> end closeCard
>
> But this does not save the data in the two tables!  Any suggestions would be
> greatly appreciated!
When the unexpected happens, it's time for error-checking.   One of the
challenges of crafting apps is that when you're being diligent only
about half your code will actually do what your app does, and the other
half will be all the stuff you add to account for when things go wrong. :)

In Rev, most error conditions are reported in "the result" immediately
after a command fails, and for I/O and other system-related tasks you
may find an additional OS-supplied error code using the sysError function.

So to better understand what's happening there you may try adding that
to your script.

Also, by hard-wiring your paths they won't work on international systems
where the spelling may differ, and may not survive changes to the OS if
MS changes the names of those folders in a future version.

The solution for that is Rev's specialFolderPath function.  Rev provides
a variety of constants you can pass to that function to get the path,
and pretty much all OS constants provided by the OS vendor can be used
as well -- Ken Ray's put together this comprehensive list:
<http://sonsothunder.com/devres/revolution/tips/file010.htm>

While Rev doesn't include a built-in constant for that, looking at Ken's
list you can use the OS constant instead, which is "35".

If you want that to be cross-platform you can use Ken's list to get the
Application Support constant for OS X, but for now here's your code
modified with specialFolderPath and including the error check which will
hopefully help diagnose the issue.

A ha!  As I was rewriting your code I noticed that you're specifying
only the folder and not the file name, so effectively you're asking Rev
to try to turn the stack into a folder, which of course it can't do.
The fix for that is included in this revision:

on closeCard
    Save "School Report" as (specialFolderPath(35)&"/School Report.rev")
    if the result is not empty then
       answer error "An error occurred while saving the report: "&cr&\
          the result & "("& sysError() &")"
     end if
end closeCard

Note that the ".rev" extension can be changed to anything else you feel
might be appropriate for your app. Rev opens stacks based on their
internal stucture, and a standalone is not required to use the .rev file
name extension to work with stack files, allowing you to define your own
document types.

If you want to use a custom file name extension you may want to check
<http://filext.com/> to see if another program may be using it.  That's
not a comprehensive list (Microsoft doesn't maintain such an index), but
it'll at least help avoid some of the more obvious conflicts.

--
  Richard Gaskin
  Fourth World
  Rev training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com
  revJournal blog: http://revjournal.com/blog.irv
_______________________________________________
use-revolution mailing list
<a href="x-msg://21/user/SendEmail.jtp?type=node&amp;node=2314948&amp;i=0" target="_top" rel="nofollow">[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution





Reply | Threaded
Open this post in threaded view
|

Re: Saving data in List Magic tables

charles61
In reply to this post by Klaus on-rev
Klaus,

I appreciate your comments along with Richard's. Thanks so much!

Charles Szasz
[hidden email]




On Aug 5, 2010, at 10:47 AM, Klaus on-rev [via Runtime Revolution] wrote:

Hi Charles,

additionally to Richard's answer, plese see my coments below your code.

> I have a standalone consisting of a splash stack and an app stack. I have set
> up a script that the user can insert some information into two tables - one
> for students and one for adults. These tables are on two different cards in
> my app stack.
>
> I have been testing my standalone on Windows XP where it was installed in
> the AllUsersAppData directory using an installer program.  I tried the
> following script for the card that has the student list:
>
> on closeCard
>   Save "School Report" as "\Documents and Settings\All Users\Application
> Data"
> end closeCard
1. You only provide the STRING "School report" to the SAVE command!
Probably you mean "save STACK "School report..."?

2. You only provided the target FOLDER and no filename!
Hint: specialfolderpath(35) will give you that folder on all win versions!
...
save STACK "School report" as (specialfolderpath(35) & "/" & "School report.rev"
## Richards debug code here...
...

Hope that helps.

> But this does not save the data in the two tables!  Any suggestions would be
> greatly appreciated!

Best

Klaus

--
Klaus Major
http://www.major-k.de
<a href="x-msg://24/user/SendEmail.jtp?type=node&amp;node=2314959&amp;i=0" target="_top" rel="nofollow">[hidden email]

_______________________________________________
use-revolution mailing list
<a href="x-msg://24/user/SendEmail.jtp?type=node&amp;node=2314959&amp;i=1" target="_top" rel="nofollow">[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution





Reply | Threaded
Open this post in threaded view
|

Re: Saving data in List Magic tables

Richard Gaskin
In reply to this post by charles61
charles61 wrote:

 > Regarding the .Rev extension, I had used the extension of .dat for
 > a previous app, which consisted of only 8 cards. This was to make
 > it harder for someone to try to open the app. The .dat extension
 > worked great.  But I was not successfully in using the .dat extension
 > with my current project, which consists of 71 cards plus 18
 > customized dialogs. I got standalone errors in the exec recognizing
 > the app stack.

FWIW I use ".dat" often and it seems to work as well as any other file
name extension.

If the standalone has trouble opening the file there must be something
else at play beyond the file name.

--
  Richard Gaskin
  Fourth World
  Rev training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com
  revJournal blog: http://revjournal.com/blog.irv
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Saving data in List Magic tables

charles61
Richard,

I check the standalones setting and found for the Mac, .rev is being used. I will uncheck that and try using .dat again.

Thanks!

Charles Szasz
[hidden email]




On Aug 5, 2010, at 11:00 AM, Richard Gaskin [via Runtime Revolution] wrote:

charles61 wrote:

 > Regarding the .Rev extension, I had used the extension of .dat for
 > a previous app, which consisted of only 8 cards. This was to make
 > it harder for someone to try to open the app. The .dat extension
 > worked great.  But I was not successfully in using the .dat extension
 > with my current project, which consists of 71 cards plus 18
 > customized dialogs. I got standalone errors in the exec recognizing
 > the app stack.

FWIW I use ".dat" often and it seems to work as well as any other file
name extension.

If the standalone has trouble opening the file there must be something
else at play beyond the file name.

--
  Richard Gaskin
  Fourth World
  Rev training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com
  revJournal blog: http://revjournal.com/blog.irv
_______________________________________________
use-revolution mailing list
<a href="x-msg://30/user/SendEmail.jtp?type=node&amp;node=2314981&amp;i=0" target="_top" rel="nofollow">[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution





Reply | Threaded
Open this post in threaded view
|

Re: Saving data in List Magic tables

charles61
In reply to this post by Richard Gaskin
Richard,

What is the best location for an app to be installed on OSX?

Charles Szasz
[hidden email]




On Aug 5, 2010, at 10:35 AM, Richard Gaskin [via Runtime Revolution] wrote:

charles61 wrote:

> I have a standalone consisting of a splash stack and an app stack. I have set
> up a script that the user can insert some information into two tables - one
> for students and one for adults. These tables are on two different cards in
> my app stack.
>
> I have been testing my standalone on Windows XP where it was installed in
> the AllUsersAppData directory using an installer program.  I tried the
> following script for the card that has the student list:
>
> on closeCard
>    Save "School Report" as "\Documents and Settings\All Users\Application
> Data"
> end closeCard
>
> But this does not save the data in the two tables!  Any suggestions would be
> greatly appreciated!
When the unexpected happens, it's time for error-checking.   One of the
challenges of crafting apps is that when you're being diligent only
about half your code will actually do what your app does, and the other
half will be all the stuff you add to account for when things go wrong. :)

In Rev, most error conditions are reported in "the result" immediately
after a command fails, and for I/O and other system-related tasks you
may find an additional OS-supplied error code using the sysError function.

So to better understand what's happening there you may try adding that
to your script.

Also, by hard-wiring your paths they won't work on international systems
where the spelling may differ, and may not survive changes to the OS if
MS changes the names of those folders in a future version.

The solution for that is Rev's specialFolderPath function.  Rev provides
a variety of constants you can pass to that function to get the path,
and pretty much all OS constants provided by the OS vendor can be used
as well -- Ken Ray's put together this comprehensive list:
<http://sonsothunder.com/devres/revolution/tips/file010.htm>

While Rev doesn't include a built-in constant for that, looking at Ken's
list you can use the OS constant instead, which is "35".

If you want that to be cross-platform you can use Ken's list to get the
Application Support constant for OS X, but for now here's your code
modified with specialFolderPath and including the error check which will
hopefully help diagnose the issue.

A ha!  As I was rewriting your code I noticed that you're specifying
only the folder and not the file name, so effectively you're asking Rev
to try to turn the stack into a folder, which of course it can't do.
The fix for that is included in this revision:

on closeCard
    Save "School Report" as (specialFolderPath(35)&"/School Report.rev")
    if the result is not empty then
       answer error "An error occurred while saving the report: "&cr&\
          the result & "("& sysError() &")"
     end if
end closeCard

Note that the ".rev" extension can be changed to anything else you feel
might be appropriate for your app. Rev opens stacks based on their
internal stucture, and a standalone is not required to use the .rev file
name extension to work with stack files, allowing you to define your own
document types.

If you want to use a custom file name extension you may want to check
<http://filext.com/> to see if another program may be using it.  That's
not a comprehensive list (Microsoft doesn't maintain such an index), but
it'll at least help avoid some of the more obvious conflicts.

--
  Richard Gaskin
  Fourth World
  Rev training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com
  revJournal blog: http://revjournal.com/blog.irv
_______________________________________________
use-revolution mailing list
<a href="x-msg://60/user/SendEmail.jtp?type=node&amp;node=2314948&amp;i=0" target="_top" rel="nofollow">[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution





Reply | Threaded
Open this post in threaded view
|

Re: Saving data in List Magic tables

Klaus on-rev
Hi Charles,

> Richard,
>
> What is the best location for an app to be installed on OSX?

The "Application" folder. Get it with:
specialfolderpath("apps")

> Charles Szasz
> [hidden email]
>

Best

Klaus

--
Klaus Major
http://www.major-k.de
[hidden email]

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Saving data in List Magic tables

charles61
In reply to this post by Richard Gaskin
Richard,

After going to Key Ray's site, I found "asup" as code for Application Support constant for OS X. Is this the best place to put your app when you install it on an user's OS X computer? 

Charles Szasz
[hidden email]




On Aug 5, 2010, at 10:35 AM, Richard Gaskin [via Runtime Revolution] wrote:

charles61 wrote:

> I have a standalone consisting of a splash stack and an app stack. I have set
> up a script that the user can insert some information into two tables - one
> for students and one for adults. These tables are on two different cards in
> my app stack.
>
> I have been testing my standalone on Windows XP where it was installed in
> the AllUsersAppData directory using an installer program.  I tried the
> following script for the card that has the student list:
>
> on closeCard
>    Save "School Report" as "\Documents and Settings\All Users\Application
> Data"
> end closeCard
>
> But this does not save the data in the two tables!  Any suggestions would be
> greatly appreciated!
When the unexpected happens, it's time for error-checking.   One of the
challenges of crafting apps is that when you're being diligent only
about half your code will actually do what your app does, and the other
half will be all the stuff you add to account for when things go wrong. :)

In Rev, most error conditions are reported in "the result" immediately
after a command fails, and for I/O and other system-related tasks you
may find an additional OS-supplied error code using the sysError function.

So to better understand what's happening there you may try adding that
to your script.

Also, by hard-wiring your paths they won't work on international systems
where the spelling may differ, and may not survive changes to the OS if
MS changes the names of those folders in a future version.

The solution for that is Rev's specialFolderPath function.  Rev provides
a variety of constants you can pass to that function to get the path,
and pretty much all OS constants provided by the OS vendor can be used
as well -- Ken Ray's put together this comprehensive list:
<http://sonsothunder.com/devres/revolution/tips/file010.htm>

While Rev doesn't include a built-in constant for that, looking at Ken's
list you can use the OS constant instead, which is "35".

If you want that to be cross-platform you can use Ken's list to get the
Application Support constant for OS X, but for now here's your code
modified with specialFolderPath and including the error check which will
hopefully help diagnose the issue.

A ha!  As I was rewriting your code I noticed that you're specifying
only the folder and not the file name, so effectively you're asking Rev
to try to turn the stack into a folder, which of course it can't do.
The fix for that is included in this revision:

on closeCard
    Save "School Report" as (specialFolderPath(35)&"/School Report.rev")
    if the result is not empty then
       answer error "An error occurred while saving the report: "&cr&\
          the result & "("& sysError() &")"
     end if
end closeCard

Note that the ".rev" extension can be changed to anything else you feel
might be appropriate for your app. Rev opens stacks based on their
internal stucture, and a standalone is not required to use the .rev file
name extension to work with stack files, allowing you to define your own
document types.

If you want to use a custom file name extension you may want to check
<http://filext.com/> to see if another program may be using it.  That's
not a comprehensive list (Microsoft doesn't maintain such an index), but
it'll at least help avoid some of the more obvious conflicts.

--
  Richard Gaskin
  Fourth World
  Rev training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com
  revJournal blog: http://revjournal.com/blog.irv
_______________________________________________
use-revolution mailing list
<a href="x-msg://66/user/SendEmail.jtp?type=node&amp;node=2314948&amp;i=0" target="_top" rel="nofollow">[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution





Reply | Threaded
Open this post in threaded view
|

Re: Saving data in List Magic tables

Richard Gaskin
In reply to this post by charles61
charles61 wrote:

 > After going to Key Ray's site, I found "asup" as code for Application
 > Support constant for OS X. Is this the best place to put your app
 > when you install it on an user's OS X computer?

Now you've gone an opened up a can of worms, Charles! :)

This question touches on a few issues, but let's handle the small one first:

If you want to save DATA (not the app, we'll get to that in a moment) to
the Application Data folder, you need to decide which one.  There's a
system-wide one in the System folder, and a user-specific one in the
user's Library folder.

The system-wide one can be useful for data which will be used by all
users on that machine:

   get specialFolderPath("asup")

There is no special constant for the user's App Support folder, but you
can get it by concatenating the user folder with the App Support folder:

   get specialFolderPath("home")& specialFolderPath("asup")


But that's for data only.  And Apple gets somewhat specific about
*which* data should go there - see this overview of "Where to put
application files":
<http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPFileSystem/Articles/WhereToPutFiles.html>

In short, they suggest using the Preferences folder for prefs data, and
Application Support for "any type of file that supports the application
but is not required for the application to run."

As for the application itself, it should go into the Applications folder
on OS X and Program Files on Windows.  But remember that modern versions
of both OS X and Windows can restrict access to those folders for
non-admin accounts.

For Windows, any installer builder you use will allow an option for the
user to elevate privileges to a level appropriate for installation, or
if you're rolling your own you can use the option for setting User
Access Control in Rev's Standalone Builder.

On OS X, it's common to deliver apps in a DMG image file, so they user
will be able to put it wherever they have permissions to do so.

Once the app is installed, if the user doesn't have admin permissions
the app may not be able to write to its own folder. So for things like
your Reports stack, I would consider using Application Support on OS X
and Application Data on Windows.

--
  Richard Gaskin
  Fourth World
  Rev training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com
  revJournal blog: http://revjournal.com/blog.irv
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Saving data in List Magic tables

Peter Haworth-2
In reply to this post by charles61
Probably worth mentioning that, as pointed out to me by the good folks  
on this list, it's NOT a good idea to put any of your application's  
data files in the Applications folder if you plan on writing to them.  
Unless the Mac user is an administrator, he/she won't have write  
access to the Applications folder. I ended up creating a folder in the  
user's Documents folder to hold my data files (sqlite db, etc).  And  
also a folder in the user's Library/Preferences folder to hold that  
user's preferences information.

Pete Haworth

On Aug 5, 2010, at 9:24 AM, [hidden email]  
wrote:

> Message: 24
> Date: Thu, 5 Aug 2010 17:27:12 +0200
> From: Klaus on-rev <[hidden email]>
> Subject: Re: Saving data in List Magic tables
> To: How to use Revolution <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=us-ascii
>
> Hi Charles,
>
>> Richard,
>>
>> What is the best location for an app to be installed on OSX?
>
> The "Application" folder. Get it with:
> specialfolderpath("apps")
>
>> Charles Szasz
>> [hidden email]
>>
>
> Best
>
> Klaus

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Saving data in List Magic tables

charles61
In reply to this post by Richard Gaskin
Richard,

I am sorry to open this can of worms!  The apps I made in the past were ones that did only computations where no data was saved. And, recently I learned about creating, saving and reading Prefs!  

My current app is the only one that has LM tables where information have to be saved for these tables within the app itself. Otherwise, data files created by my app are saved as data files in documents. So, I will go ahead and use Application Support to put my app.

Charles Szasz
[hidden email]




On Aug 5, 2010, at 12:45 PM, Richard Gaskin [via Runtime Revolution] wrote:

charles61 wrote:

 > After going to Key Ray's site, I found "asup" as code for Application
 > Support constant for OS X. Is this the best place to put your app
 > when you install it on an user's OS X computer?

Now you've gone an opened up a can of worms, Charles! :)

This question touches on a few issues, but let's handle the small one first:

If you want to save DATA (not the app, we'll get to that in a moment) to
the Application Data folder, you need to decide which one.  There's a
system-wide one in the System folder, and a user-specific one in the
user's Library folder.

The system-wide one can be useful for data which will be used by all
users on that machine:

   get specialFolderPath("asup")

There is no special constant for the user's App Support folder, but you
can get it by concatenating the user folder with the App Support folder:

   get specialFolderPath("home")& specialFolderPath("asup")


But that's for data only.  And Apple gets somewhat specific about
*which* data should go there - see this overview of "Where to put
application files":
<http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPFileSystem/Articles/WhereToPutFiles.html>

In short, they suggest using the Preferences folder for prefs data, and
Application Support for "any type of file that supports the application
but is not required for the application to run."

As for the application itself, it should go into the Applications folder
on OS X and Program Files on Windows.  But remember that modern versions
of both OS X and Windows can restrict access to those folders for
non-admin accounts.

For Windows, any installer builder you use will allow an option for the
user to elevate privileges to a level appropriate for installation, or
if you're rolling your own you can use the option for setting User
Access Control in Rev's Standalone Builder.

On OS X, it's common to deliver apps in a DMG image file, so they user
will be able to put it wherever they have permissions to do so.

Once the app is installed, if the user doesn't have admin permissions
the app may not be able to write to its own folder. So for things like
your Reports stack, I would consider using Application Support on OS X
and Application Data on Windows.

--
  Richard Gaskin
  Fourth World
  Rev training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com
  revJournal blog: http://revjournal.com/blog.irv
_______________________________________________
use-revolution mailing list
<a href="x-msg://74/user/SendEmail.jtp?type=node&amp;node=2315129&amp;i=0" target="_top" rel="nofollow">[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution