New topic: 

Windows GetFolderItem Path?

<http://forums.realsoftware.com/viewtopic.php?t=46489>

         Page 1 of 1
   [ 8 posts ]                 Previous topic | Next topic          Author  
Message        Stuart J Sykes          Post subject: Windows GetFolderItem 
Path?Posted: Tue Jan 08, 2013 2:53 pm                         
Joined: Fri Oct 26, 2012 6:24 am
Posts: 36                I run Real Basic Pro on a MAC and am producing a 
Windows version of my app
Iv'e got a database file (data.rsd) which is in my project and stored in apps 
resource folder and all works fine.

I want to add the database file (data.rsd) to the My App Libs folder that is 
created for a windows distribution
I'm suprised that the file is not automatically added the My App Libs folder 
during build as it is part of the project?

What is the GetFolderItem path to this folder on Windows?
Im using:
  Db = new REALSQLDatabase
  Db.DatabaseFile = GetFolderItem("data.rsd")

PS It works fine on windows currently with the database file at the side of the 
exe file, but I do need it in the Libs folder.   
                             Top                jakuno          Post subject: 
Re: Windows GetFolderItem Path?Posted: Tue Jan 08, 2013 4:26 pm                 
        
Joined: Fri Aug 31, 2012 3:56 pm
Posts: 57                try: 
Db.DatabaseFile = GetFolderItem("").child("My App Libs 
folder").child("data.rsd")   
                             Top                Stuart J Sykes          Post 
subject: Re: Windows GetFolderItem Path?Posted: Tue Jan 08, 2013 5:11 pm        
                 
Joined: Fri Oct 26, 2012 6:24 am
Posts: 36                Nice try jacuko - Windows doesn't like it though   
                             Top                charonn0          Post subject: 
Re: Windows GetFolderItem Path?Posted: Tue Jan 08, 2013 5:12 pm                 
                
Joined: Mon Apr 02, 2007 2:08 am
Posts: 1065
Location: San Francisco, CA, USA                Note that if your app is 
installed in the Program Files directory you will not be able to write to the 
database file unless the app is running with full administrator rights. If the 
database file is being included in the Mac build's bundle then I believe it is 
compiled into the Windows exe file as a resource, so must be written out to 
disk before accessing it as a folderitem.      
_________________
Boredom Software  
                             Top                Stuart J Sykes          Post 
subject: Re: Windows GetFolderItem Path?Posted: Tue Jan 08, 2013 5:27 pm        
                 
Joined: Fri Oct 26, 2012 6:24 am
Posts: 36                There must be some way to find the path to the My Apps 
Libs folder - after all the exe uses the path to access distributed dll files 
inside it.
Maybe the answer is to put all the files into the My Apps Libs folder - then 
zip it up for distribution
Then tell the user to run the app from the produced folder - and not to delete 
the data.rsd file as this contains database data   
                             Top                charonn0          Post subject: 
Re: Windows GetFolderItem Path?Posted: Tue Jan 08, 2013 6:32 pm                 
                
Joined: Mon Apr 02, 2007 2:08 am
Posts: 1065
Location: San Francisco, CA, USA                The canonical way is to use 
App.ExecutableFile.Parent to get a FolderItem to the EXE's directory. So, 
App.ExecutableFile.Parent.Child("My App Libs")      
_________________
Boredom Software  
                             Top                timhare          Post subject: 
Re: Windows GetFolderItem Path?Posted: Tue Jan 08, 2013 8:01 pm                 
        
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 11951
Location: Portland, OR  USA                You should *not* put the database in 
the Libs folder.  Either put it next to the executable, or better, put it in 
SharedApplicationData.   
                             Top                simulanics          Post 
subject: Re: Windows GetFolderItem Path?Posted: Tue Jan 08, 2013 9:42 pm        
                         
Joined: Sun Aug 12, 2007 10:10 am
Posts: 952
Location: Boiling Springs, SC                If it's cross-platform...use one 
of the SpecialFolder options

http://docs.realsoftware.com/index.php/SpecialFolder

that are available for Mac & Windows (maybe even linux)

Tim just mentioned one of the specialfolder paths in the post above.      
_________________
Matthew A. Combatti
Real Studio 2012 r1.2
Visit Real Studio Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8 Beta
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS
~All REAL Compatible~  
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 8 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to