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.

DarkBASIC Professional Discussion / Best place to stash files

Author
Message
heartbone
23
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 31st Oct 2003 19:22
If your app runs from CD only and you need to keep data on the hard drive.

WINDIR$ is <ROOT>:\Windows
and that isn't a cool place.
<ROOT>:\ does not seem to be very good either.
Can I use <ROOT>:\Program Files\MyFolder safely?

The more you see, the more you know.
The more you know, the more you see.
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 31st Oct 2003 19:26
One idea is to encrypt the data into the EXE file itself (You can do this in VB).

Say you have a file on the HD, called lets say d3d.exe, and when your game opens calls this VB exe which then return the bit of information. When your game wants to modify the data, it deletes d3d.exe and calls another program which recompiled d3d.exe with the lastest info.

"The trouble with the French is that they have no word for 'entreprenuer'" - Pres. George W Bush
heartbone
23
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 31st Oct 2003 19:40
These are user configuration files and high score files and user avatars and saved games and such. They need access to the data.

The more you see, the more you know.
The more you know, the more you see.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 31st Oct 2003 19:45 Edited at: 31st Oct 2003 19:45
The 'official' place to store application specific data is

C:\Documents and Settings\<username>\Application Data

Shared data would go into 'All Users' ... but this isn't available on all windows OS's

I can't really see any problem with creating a folder in Program Files though - other software does it.
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 31st Oct 2003 21:13
almost no where is secure on windows, even hidden files aren't secure.

the best option?



that way the user has to actually be know howto look for it to find it


To Survive You Must Evolve... This Time Van Will Not Escape His Fate!
heartbone
23
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 1st Nov 2003 00:33 Edited at: 1st Nov 2003 00:35
Actually I want the user to know exactly where the folder is.
And on many systems the Windows folder has this 'do you really want to mess with this' panel, so I'd like to stay away from there as well.

-----------
The more I think about it I'm leaning towards <ROOT>:\Program Files\MyFolder for all versions of Windows, it this possible? How about WinME and Win2000?

The more you see, the more you know.
The more you know, the more you see.
Genesis Rage
22
Years of Service
User Offline
Joined: 5th Oct 2003
Location:
Posted: 1st Nov 2003 00:47 Edited at: 1st Nov 2003 00:49
the <root> command in DBP i believe works with all windows systems... dont think there is any restrictions with it...

as for <ROOT>rogram FilesMyFolder working on ME and 2k... it will work... EVERY Windows OS that i have worked on, 3.11 for Workgroups, 95, 98, 98SE, 2k Pro, 2k Server, ME, XP Home, XP Pro, Longhorn (pre-production codename), and even Pocket PC have that folder! so i think that it would be okay to send files there

-edit-
that and about 90% of games and applications you get have that as the default folder

==Main Computer==
Athlon XP 3000+, 1024mb, Radeon 9800 Pro 128mb 8xAGP, XP Pro
heartbone
23
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 1st Nov 2003 00:49
Thank you very much Genesis Rage. That'll keep it simple.

The more you see, the more you know.
The more you know, the more you see.
OSX Using Happy Dude
22
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 1st Nov 2003 00:49
Personally My Folder should only be used for saved games, and any modifiable/changed/updated etc game data should be kept in the directory that the game is installed in.


Avatar & Logo by Indi. Insert witty comment here...
Genesis Rage
22
Years of Service
User Offline
Joined: 5th Oct 2003
Location:
Posted: 1st Nov 2003 00:54
i was assuming that 'MyFolder' was the name of program, not the actual name he would be using

==Main Computer==
Athlon XP 3000+, 1024mb, Radeon 9800 Pro 128mb 8xAGP, XP Pro
heartbone
23
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 1st Nov 2003 00:57
You assumed correctly.

The more you see, the more you know.
The more you know, the more you see.
the_winch
23
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 1st Nov 2003 00:59
You might want to get the name of program files from the regisry or some other method. Assuming it will be called program files will work for 99% of the time but I think non-english versions of windows name some files in the local language and you can change the name\location.
Genesis Rage
22
Years of Service
User Offline
Joined: 5th Oct 2003
Location:
Posted: 1st Nov 2003 01:02
good point... also i believe in XP you can change the location of the 'Program Files' folder... but i dont think many people mess with it, if it is possible

==Main Computer==
Athlon XP 3000+, 1024mb, Radeon 9800 Pro 128mb 8xAGP, XP Pro
heartbone
23
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 1st Nov 2003 01:14
Good points. For those users, I'll have to put it somewhere else I guess. Getting more complicated. Can you read strings from the registry now?

The more you see, the more you know.
The more you know, the more you see.
Toothpick
23
Years of Service
User Offline
Joined: 9th Feb 2003
Location:
Posted: 1st Nov 2003 01:24
Well every computer will have a c: drive, create a folder there and store the data in it.


"Can you read strings from the registry now?"

yes

n3kdir$= get registry$("SOFTWARE\Papyrus\NASCAR Racing 2003 Season", "Directory")
Genesis Rage
22
Years of Service
User Offline
Joined: 5th Oct 2003
Location:
Posted: 1st Nov 2003 01:35
not EVERY computer has a C: drive... if someone know how to change settings you can change it to anything... one of my systems has no C: drive, but a (censored) drive... (it runs my email server so i dont want to give out the drive number, makes it harder to hack)

==Main Computer==
Athlon XP 3000+, 1024mb, Radeon 9800 Pro 128mb 8xAGP, XP Pro
Toothpick
23
Years of Service
User Offline
Joined: 9th Feb 2003
Location:
Posted: 1st Nov 2003 01:42
ok fair enough.

use the "PERFORM CHECKLIST FOR DRIVES"/"CHECKLIST STRING$
" commands

maybe?
heartbone
23
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 1st Nov 2003 01:46 Edited at: 1st Nov 2003 01:48
How about Left$(Windir$(),1)+":\Program Files\Whatever"?

The more you see, the more you know.
The more you know, the more you see.
Genesis Rage
22
Years of Service
User Offline
Joined: 5th Oct 2003
Location:
Posted: 1st Nov 2003 01:46
it is possible to get certain information and have the installation directory PERFECT on every computer system... but why... many games and software out there use "ROOT:\program files\whatever" even if the folder doesnt exist... my opinion is to just have it that, and be done with it

==Main Computer==
Athlon XP 3000+, 1024mb, Radeon 9800 Pro 128mb 8xAGP, XP Pro
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Nov 2003 03:44
You could get the program files folder location from the registry ... but it seems to get garbled for me



Anyone else get this problem?
empty
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 1st Nov 2003 04:07
There's not even that entry in my registry...

I awoke in a fever. The bedclothes were all soaked in sweat.
She said "You've been having a nightmare and it's not over yet"
the_winch
23
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 1st Nov 2003 04:08
That key doesn't appear to even exist in win98.

Why not use an installer to install the data files. It will take care of finding the program files directory and have an uninstall option so the user can get rid of the installed files easerly.
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 1st Nov 2003 13:02
You could do get dir$() at the beginning of your program to get the directory your program EXE is located

"The trouble with the French is that they have no word for 'entreprenuer'" - Pres. George W Bush
empty
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 1st Nov 2003 13:24
Heartbone's first post:
"If your app runs from CD only and you need to keep data on the hard drive."

I'm afraid get dir$() won't help in that case.

I awoke in a fever. The bedclothes were all soaked in sweat.
She said "You've been having a nightmare and it's not over yet"
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 1st Nov 2003 16:29
Oh, I just notcied lots of other posts which were referring to a program files folder and I assumed it was to be installed

"The trouble with the French is that they have no word for 'entreprenuer'" - Pres. George W Bush

Login to post a reply

Server time is: 2026-07-26 08:30:45
Your offset time is: 2026-07-26 08:30:45