Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Data file in APP folder

Author
Message
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 3rd Dec 2018 06:24
Hi Guys
I've been trying to get thing going, but somewhere I miss something.

I want to distibute a xxx.dat file with my APP (For windows, html5 and Android) and later Mac
Currently it's save under the default write folder on window (Havnt tried Android yet) eg c:\user\admin\local\appdata\xxxx\myfile.dat

I want this file to be in my application folder (Same folder where the media folder is, but in a data folder.
I use the datafile to retrieve text used in the program,

Any advice?
Ive tried setfolder, rawfolder... but NO luck

Thanks
Danie
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 3rd Dec 2018 06:31
When you create the file use the name; "raw:C:\folder\folder\myfile.dat"
Where that string points to where you want the file to go and what you want to name it. It must have a drive letter too
I'm not 100% sure but you might need to make all the back slashes forward slashes as well

Hope that helps
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 3rd Dec 2018 09:31 Edited at: 3rd Dec 2018 09:33
HI Blink0K
Thanks, this works, but I would like to save my DAT file in the same folder as the EXE for windows
Will that be possible

My Current folder:
c:\testtext
c:\testtext\data\myfile.dat
using raw:C:/testtext/data/myfile.dat"

If I run the exe from any other folder than c:\testtext it work.
as soon as I copy the EXE to the c:\testtext folder, it don't work




Thanks
Danie
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 3rd Dec 2018 10:18
It has to be in the media folder unless you want to set a raw path to the location of the data file
but the problem with that it wont work on other peoples machines. but if you insist on using a raw
path it might be something like raw:c:\documents and settings\username\appfoldername. but if its
installed on d it wont work if they install to a cvustom directory it also wont work

The best thing you can do is create a folder in the media folder that way your path can be data/myfile.dat

fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 3rd Dec 2018 10:58
there is this command

GetReadPath
Description
Returns the directory that contains the application executable on the current plaform that the app is running on. Note that on Android this path is inaccessible in normal use and will return an empty string.

string GetReadPath()

that will return the path of the executable and you could just append "myfile.dat" to it to set the raw path but like the documentation says it wont work with android
fubar
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 3rd Dec 2018 23:31
Thanks fubarpk

Yes, this is working fine on Windows.
Was thinking of using "GetDeviceBaseName(" to detect, windows, html5, and android and according to that
I can set the correct path, but now it only read Windows OK
All others, not working.
Need help to set the HTML5 and the android paths now

cheers
Danie



smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 4th Dec 2018 00:04
why do you need it to be in the media folder? is it because you want to distribute the file with the app and then also allow the app to edit it?
you could get the app to duplicate what it finds in the file (from the read folder) and create a new one in the write folder using that data, then further changes can be made from the new file as needed - this will help with the read/write access too.
life's one big game
spec= i5 4ghz, 16gb ram, Nvidia 1070ti gpu
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 4th Dec 2018 00:52
Quote: "Need help to set the HTML5 and the android paths now"


The help file clearly states it cant be done in android as it doesn't allow that in android
so much easier to just place in media folder
fubar
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 4th Dec 2018 11:10
smallg

Yes, I want to distribute the file with the APP, but only for Read purposes, nothing to write... so don't need write access, ONLY read
It dont have to be the media folder, any folder can do, as long as the ANdroid/Windows exe/HTML5 know where the file is stored... to retrieve/read the info from the file.


Thanks
Danie
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 4th Dec 2018 16:19
if your app doesn't need to write or edit the file i don't understand the issue then, just stick it in the media folder and job done, the app will automatically have access to read from it on all platforms using OpenToRead("filename") as the app will automatically search the media folder (if it is in a folder include that path in the filename).
life's one big game
spec= i5 4ghz, 16gb ram, Nvidia 1070ti gpu
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 11th Dec 2018 23:51
Hi smallg

Yes, you right? I was looking at the writing/editing instead of just reading.

Distribute the file with the APP in media folder works great

Cheers
Danie

Login to post a reply

Server time is: 2024-03-29 08:01:32
Your offset time is: 2024-03-29 08:01:32