-
1. Re: How to find Root directory?
sinious Jan 8, 2013 2:59 PM (in response to sivacse24rep)To be respectable to the users machine it's very common for an application to make a directory in the users Documents folder for the application while storing that users files in there. Adobe does this, for example. That could be an ideal route that shouldn't give you any permission issues. (File.documentsDirectory)
-
2. Re: How to find Root directory?
sivacse24rep Jan 9, 2013 12:59 AM (in response to sinious)thanks for the replay. But when i spit the files, i have Security Sandbox Violation error (http://forums.adobe.com/message/4979534#4979534) thats the reason i want to have both the files on same path? how to overcome the issue?
or is there any possible that by default my air package can install on c:\test\ insted of c:\program files\test?
-
3. Re: How to find Root directory?
sinious Jan 9, 2013 7:58 AM (in response to sivacse24rep)Sounds like your issues go beyond AIR, such as perhaps a SWF you're loading with some sandbox settings set to network rather than local filesystem. Even at that, an AIR app isn't in a traditional sandbox like a SWF is. After the user permits it to run it has the power and permission to do whatever the user who ran it can. If you can create a folder, so can AIR. If you can delete a folder, so can AIR. I think your problem lies somewhere in between, like installing as administrator but running as a normal user without setting proper permissions. If an administrator owns the install folder and a regular user tries to edit it, it will fail, similar to what you see.
c:\ is just bad symantics. There are just as many and sometimes even more permission obstacles on c:\ than c:\program files (x86). There isn't anything special about the program files folder. Nor should you have any issue at all writing to the users documents directory. That's the point of the path in the first place. A safe place to write anything the current user should want access to.
You may want to specify any SWFs loaded via a loader with a context with these issues. Take a look at the code in this link where the context is set. The loaded content is loaded either into its own context, a child context or into the main applications context (giving full rights). You may want to load the SWF into the applications current context to be sure it has proper permissions rather than sandboxing it.
Pay special attention to the table/chart below the code. You should try setting context.applicationDomain = application.currentDomain; before loading your SWF. (Note: don't just paste that code in there without reading the link, it requires more code).



