Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


default install folder for windows game

  • You cannot reply to this topic
8 replies to this topic

#1 Norman Barrows   Crossbones+   -  Reputation: 3090

Like
0Likes
Like

Posted Yesterday, 10:13 AM

whats a good default install folder for a windows game?

 

i'm about to post beta 21 of Caveman with skinned meshes. But i noticed that in Inno setup, i'm installing to \program files(x86)\caveman.

 

i've had one user with issues caused by a corrupt UAC file and use of the program files directory.

 

Also, skyrim modding guides recommend moving steam out of the program file folder due to UAC issues, protected folders, having to run as admin, etc.

 

So installing to protected folders can cause issues.

 

So whats a good default non-protected folder to install under?

 

 

 

 


Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

 

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

 

 


Sponsor:

#2 gdunbar   Crossbones+   -  Reputation: 1357

Like
0Likes
Like

Posted Yesterday, 12:05 PM

I'm using NSIS, not InnoSetup, but I install to:

InstallDir "$LOCALAPPDATA\TotAW"

Which works out to "C:\Users\gdunbar\AppData\Local\TotAW" on Windows 7. I believe when I researched that this was "the right place" to put an application such that it could be installed and run by a non-admin user, but I don't have that research handy. Seems to work well enough.

 

Good luck!

Geoff

 



#3 Zipster   Crossbones+   -  Reputation: 1261

Like
4Likes
Like

Posted Yesterday, 12:20 PM

I've seen applications that install their static components into Program Files, such as updaters, patchers, etc., which then "install" everything else that can be modified or updated into AppData.



#4 Aardvajk   Crossbones+   -  Reputation: 9005

Like
5Likes
Like

Posted Yesterday, 12:46 PM

I believe best practice is to write things like your executable to Program Files, which you can only write to while your installer has raised access level. This protects against your exe being hijacked for example. So things that are read-only after installation go there.

Files the game needs to write to go in AppData, using the system call to identify the folder rather than hard code.

The issues with UAC are generally due to older software not following these rules and having read-write requirements on files in protected folders like Program Files.

The idea is that your installer gets raised access level but your game itself does not require it.

#5 SimonForsman   Crossbones+   -  Reputation: 6907

Like
6Likes
Like

Posted Yesterday, 01:15 PM

whats a good default install folder for a windows game?

 

i'm about to post beta 21 of Caveman with skinned meshes. But i noticed that in Inno setup, i'm installing to \program files(x86)\caveman.

 

i've had one user with issues caused by a corrupt UAC file and use of the program files directory.

 

Also, skyrim modding guides recommend moving steam out of the program file folder due to UAC issues, protected folders, having to run as admin, etc.

 

So installing to protected folders can cause issues.

 

So whats a good default non-protected folder to install under?

 

(multi user) application binaries should go into FOLDERID_ProgramFiles, application data should go into FOLDERID_ProgramData and user files (save games, settings, etc) should go into FOLDERID_LocalAppData.

 

https://msdn.microsoft.com/en-us/library/windows/desktop/bb762188(v=vs.85).aspx

https://msdn.microsoft.com/en-us/library/windows/desktop/dd378457(v=vs.85).aspx

 

if you want to support legacy versions of Windows you can use the CSIDL equivalents

 

If you want non admin users to be able to modify the binaries you should default to FOLDERID_UserProgramFiles (single user installation) Available in Win7 and later, for Vista you can fall back to FOLDERID_LocalAppData and add \Programs or something to the path (You should never ever install multi user binaries in a location where non admins are able to modify them as that compromises the systems security), even if you do single user installation you may still want to share some or all data between users (if you have several gigabytes of levels, artwork, music, etc you probably don't want each user to need their own copy even if they each have their own binaries)


Edited by SimonForsman, Yesterday, 01:24 PM.

I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

#6 SmkViper   Members   -  Reputation: 3711

Like
0Likes
Like

Posted Yesterday, 01:40 PM

Skyrim modding guides recommend moving steam because Skyrim mods need to be in the executable's folder, and since most modding tools will need to edit/copy/move these files around, the game should be in a non-protected folder.

Note that you could just as easily leave steam in program files and then set up a symbolic link to store Skyrim in a non-protected location, pointing the mod tools at said non-protected location. (Honestly, the game itself should check the documents or app data folders for mods instead of forcing the game's folder, but here we are)

In general though, Program Files is the correct location. You should not be writing anything to this folder outside of an installer or patcher (both of which should request elevation from the user). Game data that the game wants to update/modify like settings should go in the app data folder. And it's up in the air as to whether to store save games in app data or the documents folder - some like the documents folder because it's easier for the user to find for when they want to back up data or mess around with the saves. And you could argue a game's save is similar to a Word document, being a "document" the game creates at the wishes of the user.

Edited by SmkViper, Yesterday, 01:41 PM.


#7 SyncViews   Members   -  Reputation: 588

Like
-1Likes
Like

Posted Today, 06:51 AM

Well, Steam is bad, and if I was developing an operating system Id have banned them. Although they install to program files, they modify the file permissions and give "Full Control" to the local "Users" group. This means that nearly any old piece of non-trusted code can go and change stuff in their, for example replacing a games executable or DLL files with malicious versions.

 

You really want to install to program files by default, and require elevation to a trusted user for both installation and updates, and never load executable files (exe's, dll's, Java jar's, etc.) from any non-trusted location. This way no other untrusted piece of code can infect your program.

 

I suspect MS would really like to ban what Steam does and any other case of executables in generally writeable locations, but the size of that compatibility problem would cause a really big backlash. The new App's system is a lot more restrictive and would expect to see further phasing out of the legacy "desktop program" stuff.



#8 Norman Barrows   Crossbones+   -  Reputation: 3090

Like
0Likes
Like

Posted Today, 10:09 AM


(multi user) application binaries should go into FOLDERID_ProgramFiles, application data should go into FOLDERID_ProgramData and user files (save games, settings, etc) should go into FOLDERID_LocalAppData.

 

so caveman.exe goes in ProgramFiles, all the meshes, textures, models, wavs, animations etc go in ProgramData, and savegames, and stuff that gets paged from disk like container content lists and explored local map bitmasks goes in LocalAppData  (IE  C:\users\current_user\appdata\local).

 

hmm... more work, and you can't find everything in one folder. but it gets you readonly binaries, shared data (probably irrelevant for caveman), and user data under the current_user folder for ease of backup purposes (i'd assume).

 

right now i put it all in a single caveman3 folder under programfiles.  i haven't had any issues with this on my PC even though programfiles is protected. but then again, i only have one account on the PC, the admin account, which is what i use all the time. so i suppose i'm always running as admin.

 

also i haven't moved steam or skyrim, and have encountered no issues on my PC - i'm trying to muck with the skyrim install as little as possible while modding.

 

however, installing under programfiles, corrupt UAC files apparently can lead to the dreaded BEX error:

 

http://www.gamedev.net/topic/660329-whats-this-error-message-mean/

 

and fixing it its pretty ugly. cant find the link right now, but it involves un-hiding hidden folders and files and regedit and hkeys - you get the idea.  way more than you want the user to have to go through to run your game.

 

so i was thinking, you could avoid this whole UAC issue by simply installing to an unprotected folder - IE somewhere other than program files. its a simple one line change in the Inno setup script.

 

OTOH, this means you're not doing it the MS way...

 

should i not worry about users with UAC issues?

 

 

 

 


You really want to install to program files by default, and require elevation to a trusted user for both installation and updates, and never load executable files (exe's, dll's, Java jar's, etc.) from any non-trusted location. This way no other untrusted piece of code can infect your program.

 

if by trusted you mean verisign, then i'm screwed, because i can't afford to verisign right now, so its all from "Unknown Publisher".


Edited by Norman Barrows, Today, 10:16 AM.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

 

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

 

 


#9 SmkViper   Members   -  Reputation: 3711

Like
0Likes
Like

Posted Today, 12:08 PM

should i not worry about users with UAC issues?


No - in the same way that you shouldn't worry about users who have deleted bits of their operating system or are overclocking with inadequate cooling.

If their computer is so messed up that the core security feature of Windows is broken, there is nothing you can do to "fix" or account for it.

You might as well be trying to account for cosmic rays hitting the memory chip or CPU and randomly swapping bits of your program while running smile.png
 

You really want to install to program files by default, and require elevation to a trusted user for both installation and updates, and never load executable files (exe's, dll's, Java jar's, etc.) from any non-trusted location. This way no other untrusted piece of code can infect your program.

 
if by trusted you mean verisign, then i'm screwed, because i can't afford to verisign right now, so its all from "Unknown Publisher".


There are several companies that can provide code signing certificates for varying amounts of money. VeriSign isn't the only one.

But yes, it's not free, and you will have to provide some personally identifying information - otherwise everyone would just sign their viruses and then where would we be? smile.png





PARTNERS