Get OS path test

Discuss bugs or technical issues relating to TU2 or the TU2 demo only.
User avatar
ADMIN
Site Admin
Posts: 672
Joined: Sat Jun 02, 2007 8:02 pm
Contact:

Get OS path test

Postby ADMIN » Tue May 17, 2016 2:28 am

I need to ensure TU2 is saving its files to an appropriate spot.
Many games save to the user/documents folder or user/appdata

But things are further complicated by older OS's (e.g. XP and Vista) having different locations again.

Can I ask users to test out the small programme below?
It uses a custom DLL to get the current the OS path.
Very interested in the results from those with older OS'es such as WinXP and Vista.

http://madjack.fileburst.com/get_os_path_test.rar
'I only have one rule. Everyone codes, no-one quits. You don't finish your game, I'll shoot you myself.' http://www.tankuniversal.com
User avatar
Phantaminium
Posts: 240
Joined: Sat Feb 20, 2010 6:04 pm
Contact:

Re: Get OS path test

Postby Phantaminium » Tue May 17, 2016 5:13 am

AppData: C:\Users\Nick\AppData\Local
My Docs: C:\Users\Nick\Documents

Press any key to exit.



Windows Vista

I'm a ScatmanImage
User avatar
Admiral Z
Posts: 181
Joined: Tue May 08, 2012 7:40 am
Location: Rebel hub #69

Re: Get OS path test

Postby Admiral Z » Tue May 17, 2016 1:29 pm

AppData: C:\Users\SupremeAdmiralZ\AppData\Local
My Docs: C:\Users\SupremeAdmiralZ\Documents

Press any key to exit.

---------------------------------

That's what I got on my machine running Windows Vista.
Admiral Z has spoken. So let it be written, So let it be done.
User avatar
ADMIN
Site Admin
Posts: 672
Joined: Sat Jun 02, 2007 8:02 pm
Contact:

Re: Get OS path test

Postby ADMIN » Tue May 17, 2016 3:05 pm

So which do you guys prefer? Documents or appdata for game data?
'I only have one rule. Everyone codes, no-one quits. You don't finish your game, I'll shoot you myself.' http://www.tankuniversal.com
User avatar
Admiral Z
Posts: 181
Joined: Tue May 08, 2012 7:40 am
Location: Rebel hub #69

Re: Get OS path test

Postby Admiral Z » Tue May 17, 2016 3:48 pm

Well I never use my Documents folder and I'm used to doing %appdata% in the start menu (because of Minecraft) so Appdata would be my choice... I have a feeling that I'm in the minority though. :P
Admiral Z has spoken. So let it be written, So let it be done.
User avatar
Max Powerz
Posts: 44
Joined: Sat Apr 04, 2015 11:23 pm

Re: Get OS path test

Postby Max Powerz » Tue May 17, 2016 5:57 pm

I'm with AdmiralZ
%Appdata% is more professional, it's where most newer titles are storing all their volatile data like save states and other files that are modified during runtime.

Also it's great that you want to support older OS's but keep in mind that Microsoft has stopped supporting them and is literally trying to force everybody onto windows 10,
Within the next 1-2 years Microsoft will have forced almost everyone onto their newest OS regardless of whether they want it or not.
User avatar
Phantaminium
Posts: 240
Joined: Sat Feb 20, 2010 6:04 pm
Contact:

Re: Get OS path test

Postby Phantaminium » Wed May 18, 2016 12:19 am

I'll regrettably be going of my own will when I make a new computer. I want that DirectX 12...

I'm a ScatmanImage
bondsc
Posts: 55
Joined: Thu Mar 05, 2015 4:34 am
Location: England

Re: Get OS path test

Postby bondsc » Sat Jun 04, 2016 4:01 am

On Windows 10 x64 build 1511:
AppData: c:\users\simon\AppData\Local (same as %LOCALAPPDATA%)
MyDocs: c:\users\simon\Documents
(and I can confirm that both of these locations are valid)

On XP SP3 x86:
AppData: c:\documents and settings\simon\local settings\application data
MyDocs: c:\documents and settings\simon\My Documents
(and I can confirm that both of these locations are valid)


I would prefer "AppData" to "MyDocs" as most applications (that I use in an Enterprise environment) store their non-persistent data in this location and I hate apps which store settings under documents - a location I believe should just hold documents that I write and not settings.

In my opinion, there are two locations you should consider:

1) %APPDATA%
This maps to "%USERPROFILE%\AppData\Roaming" on Vista and later (e.g. "c:\users\simon\AppData\Roaming")
This maps to "%USERPROFILE%\Application Data" on XP and 2000 (e.g. "c:\users\simon\Application Data")
It exists on ALL Operating Systems and is easily referenced (i.e. just an environment variable to expand - no need for a DLL)
This location is typically reserved for settings which you'd want to persist as you roam between different computers e.g. saved dictionaries, Signatures (in in email program), toolbar settings, saved games, templates etc

2) %LOCALAPPDATA% (what you are referring to as AppData in your test tool)
This maps to "%USERPROFILE%\AppData\Local" on Vista and later (e.g. "c:\users\simon\AppData\Local")
This maps to "%USERPROFILE%\Local Settings\Application Data" on XP and 2000 (e.g. "c:\users\simon\Local Settings\Application Data")
It exists on ALL Operating Systems and isn't so easily referenced (since the environment variable %LOCALAPPDATA% doesn't exist on XP and 2000)
In my programs I tend to read the registry value "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Settings\Local AppData:REG_SZ" to find its location. I know for certain that this registry value exists on every OS from 2000 to Win10 (as I use it a LOT on programs which run on various customer systems)
This location is typically reserved for scratch data, settings which you wouldn't expect to roam between different computers and typically settings which you can afford to lose (e.g. a cache or temporary files or something very computer specific such as a license or a debug log)


Personally I'd prefer %APPDATA% to your use of "AppData" (which is really %LOCALAPPDATA%). But I'd prefer your "AppData" to "MyDocs".

(sorry, long answer, been drinking coffee)

Return to “Technical issues and bugs”

Who is online

Users browsing this forum: Defefriedy, emoajiodeuko, gemEldes and 1 guest