@gamedevs: Writeable install directories

@gamedevs: Writeable install directories

Resources to get you going on your new project, or to help you over some emergent problems during your development cycle.

Moderator: Moderators

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14587
Joined: 17 Nov 2005, 02:43

@gamedevs: Writeable install directories

Post by Forboding Angel » 25 Jun 2011, 06:33

Ok, most of us are aware, UAC is a big fat pain in the fucking dick, especially when it comes to custom installers. Many times we want to use spring in portable mode, but can't because spring likes to prostitute itself all over your harddrive...

Batch logic is here to save the day... First an advertisement for batch logic:
Having problems with bugs? Bandage them with all new patented "Batch Logic"! Yes folks indeed you won't ever believe how you managed without it. The moment you bandage your bugs with "Batch Logic" you will be calmed by a sense of self worth and well being! Pick up your copy of Patented "Batch Logic" today!

Disclaimer: Logic sold separately. Do not attempt to operate machinery while under the influence of "Batch Logic". Side effects may include but are not limited to, irritable bowell syndrome, unexplained fits of rage, the overwhelming urge to slap your mother in law, strange sexual urges, erectile dysfunction, oily anal discharge. Please use "Batch Logic" responsibly!
Ok, now that that is out of the way, here are the instructions.

Put this code in a text file, and name it, grantaccess.bat (make sure that extensions in windows explorer are displayed so the file isn't actually named grantaccess.bat.txt)

Code: Select all

ICACLS "%cd%" /grant Everyone:F /T
Now download bat to exe (attached) (Only use version 1.5! v1.6 gets detected by AV as a false positive and is really irritating).
Bat_To_Exe_Converter15.7z
(390.43 KiB) Downloaded 46 times
Compile your batch file into an exe (visibility hidden) requiring admin access (this will invoke a UAC prompt when it is run).

In your installer, add this file to the spring directory. In your installer, once all of the files have been extracted, set your installer to run this file before the installer finishes.

VIOLA! Your install directory is now fully read/write accessible inside program files!

This is how steam, desura, and impulse do it (although their way is a lot more elegant (the process is different but the result is identical), but whatever).
Last edited by Forboding Angel on 26 Apr 2012, 23:44, edited 1 time in total.
0 x

User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: @gamedevs: Writeable install directories

Post by knorke » 25 Jun 2011, 06:56

wont work on win xp. (ICACLS is cacls there)

how does this stop unitsync, archive mover, lobbies, spring.exe from "going outside" the install directory and ie looking for/saving stuff in "my documents"?
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14587
Joined: 17 Nov 2005, 02:43

Re: @gamedevs: Writeable install directories

Post by Forboding Angel » 25 Jun 2011, 07:01

Because in your installer you put spring in portable mode (isolation mode once .83 is released).

The same command works for CACLS, also, on xp it doesn't matter if it doesn't work, because XP doesn't have UAC, silly :-)

Code: Select all

CACLS "%cd%" /grant Everyone:F /T
Works fine, just CACLS is depreciated in favor of ICACLS which has a lot more features.
0 x

User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: @gamedevs: Writeable install directories

Post by knorke » 25 Jun 2011, 07:09

wasn't really clear this was for 0.83.
should isolation mode really work i will just save myself all the hassle and zip the whole spring/game folder. then players just need to
Image
unzip and tada.

if win xp has no uac then why is there CACLS?
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14587
Joined: 17 Nov 2005, 02:43

Re: @gamedevs: Writeable install directories

Post by Forboding Angel » 25 Jun 2011, 07:23

Network shares, and xp had ACL's of some sort for group policies, just they aren't really worth much.

You can use this with current spring, just understand that unitsync will scan all the shit in my docs as well. In .83 you can put unitsync in isolation mode where it will stay in it's own folder.

It doesn't hurt to use this in .82, just existing spring users will have their maps and mods in mydocs indexed and added to the generated archivecachev7.lua

Edit: you should use an installer for the process I listed above, as well as the fact that you can do some awesome springlobby and springsettings customizations.

Edit2: Also, your gif needs moar nipples.
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14587
Joined: 17 Nov 2005, 02:43

Re: @gamedevs: Writeable install directories

Post by Forboding Angel » 18 Dec 2011, 22:24

Please sticky this or put it in the resources section.
0 x

User avatar
AF
AI Developer
Posts: 20669
Joined: 14 Sep 2004, 11:32

Re: @gamedevs: Writeable install directories

Post by AF » 19 Dec 2011, 13:59

tbh I'd rather see a method of specifying the folders to look in and write to from a specific spring install manually under windows, e.g. telling a spring install to look in the evoRTS folder in my docs and the evoRTS folder in program files, allowing for fully independent game installs that aren't merely portable/isolated builds hemmed into program files etc.

Something like folders.cfg/folders.lua in the same directory as spring ( can windows users really be trusted to use command line parameters? )

Right now if I were to package up a game, I'd end up inheriting a lot of stuff from other games, which could detract from the experience ( non Kernel Panic maps showing in the maplist for a kernel panic install? )

Having to compromise my machines security for a halfbaked solution isn't a fix.
0 x

User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: @gamedevs: Writeable install directories

Post by knorke » 19 Dec 2011, 17:09

Having to compromise my machines security for a halfbaked solution isn't a fix.
Kind of agree with that.
I think if I found out an installer did something like that I would be a bit upset?
imo it is not a good solution (also see previous post, does not work on xp) but yea..
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14587
Joined: 17 Nov 2005, 02:43

Re: @gamedevs: Writeable install directories

Post by Forboding Angel » 28 Dec 2011, 10:25

Steam/impulse/desura/etc does this. Also it does not compromise your machine's security. It sets one folder inside program files to be writeable. That is not going to compromise your machine any more than your user folder compromises your machine's security. Stop with the FUD.

Moreover, you the user must supply admin permission for it to do it's work.

That command cannot be run from the command line unless cmd is started with admin permissions. Bat files cannot be run with admin, so the only way to utilize the command is the A: have a program ask for admin and pass along the command, or B: compile the bat into an exe that requires admin.
0 x

User avatar
AF
AI Developer
Posts: 20669
Joined: 14 Sep 2004, 11:32

Re: @gamedevs: Writeable install directories

Post by AF » 29 Dec 2011, 03:16

So you'd rather send the user into configuration of security settings and throw up big red alerts? Than have a spring engine install in program files/evorts/ with a file in there saying "don't look in my games/spring/, look in my games/evorts/ instead!!", that requires no user intervention at all?

I mention this because there's nothing stopping someone passing around a lua widget that would write out a string to a file that ended in .exe and just happened to contain executable code, that otherwise wouldn't be able to exist in program files land.

( Not to mention that it's perfectly possible to install spring and not need to write to the program files folder, since everything goes in ~/My Games/Spring anyway as Microsoft advised ).


Also, what I suggested is far more flexible and allows for far more variations of engine configuration, many of which directly benefit you and the kinds of things you're trying to do.

What your doing is bandaging over a bandage. I'm not suggesting your bandage bandage is incorrect. I'm suggesting we use XYZ to fix the original issue, removing the need for both bandages
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14587
Joined: 17 Nov 2005, 02:43

Re: @gamedevs: Writeable install directories

Post by Forboding Angel » 29 Dec 2011, 13:42

AF Isolation mode exists for a reason. If spring's file system wasn't shit we wouldn't have to resort to such measures, but as it is, there is only one way to have a perfectly clean install that doesn't interfere with anything else and that is isolation mode.

Isolation mode requires write access it it's own folder.

Also, hey why don't we pull a google, or a licho and just install to appdata, because that's a real fucking great idea too.

Or hey, lets just do it spring style, and shit all over the harddrive!

Licho wrote:There is no point limiting game devs.
Game devs have to be reliable.
If they not engine cannot stop them from doing bad things anyway.
SL or ZKL or engine update could format your disk. You have to trust devs, if you trust those.
^^ Quoted for epic truths


You're being all prissy and drama queen over nothing. Stop it. It's fucking irritating.

Edit:
AF wrote: I mention this because there's nothing stopping someone passing around a lua widget that would write out a string to a file that ended in .exe and just happened to contain executable code, that otherwise wouldn't be able to exist in program files land.
So fucking what? Explain to me how that is more dangerous than the same file sitting in ~/downloads/?

Moreover, evo does not execute anything in the local widgets folder, only what is in the game.

I'll be sure to add that to next evo version. In fact, I'll have it wipe it's own folder, and then your computer will be...

Oh wait, it'll be just fucking fine because all the file will be able to destroy is the evo install.

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

It isn't a bandaid. It's the solution that everyone uses (including commercial companies, granted they do it more gracefully).

People dislike games being installed to their user folder, and in fact, it's fucking idiotic to do so. What about other users on the same machine?

Perhaps you need to read this forum again, because a long time ago, before I knew that this method was possible, I did exactly that, install to my games/spring, and what did I get? Nothing but bitching. And they were 100% right to do so. Just because MacroShit tells you to do something a certain way, doesn't mean that that is a great frigging idea.
0 x

User avatar
AF
AI Developer
Posts: 20669
Joined: 14 Sep 2004, 11:32

Re: @gamedevs: Writeable install directories

Post by AF » 29 Dec 2011, 16:59

Your completely missing the point Forb:
AF Isolation mode exists for a reason. If spring's file system wasn't shit we wouldn't have to resort to such measures,
I just suggested the fix.
but as it is, there is only one way to have a perfectly clean install that doesn't interfere with anything else and that is isolation mode.
But I suggested a fix that makes isolation mode unnecessary?
Isolation mode requires write access it it's own folder.

Also, hey why don't we pull a google, or a licho and just install to appdata, because that's a real fucking great idea too.
Just because Licho would want their config file to say appdata doesn't mean you do either
Or hey, lets just do it spring style, and shit all over the harddrive!
You mean following guidelines and having 1 single writable folder on most windows systems under My Games/Spring? Like Skyrim? Or Supcom? Or GSB? What about having patches like 99% of games out there?


So again Foreboding, reread, why are you advocating a bandage for a bandages bandage for the problem in order to eliminate a cure?

Also keep in mind that the user may not have the required permissions to run your batch script, why deprive numerous people with no administrator access the ability to play your game because of your personal preference and opinion on your own filesystem?
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14587
Joined: 17 Nov 2005, 02:43

Re: @gamedevs: Writeable install directories

Post by Forboding Angel » 30 Dec 2011, 02:03

AF, ZK does't put config files in appdata, it installs the entire program in appdata! Google chrome does the same thing and that is my only beef with chrome.

You are missing the point tho af. Configs and settings files need to be kept separate between games. That means that zk has it's own, gundam has it's own and evo has it's own.

Maps also need to be separate. This is pretty much non-negotiable.


I have an assignment for you:

You have 3 games that you need to install.
ZK which also has it's own lobby
Gundam which uses a modified SL
Evo which uses a modified SL

Gundam has a special conf that it uses for springlobby
Evo has a special conf that it uses for springlobby and springsettings.
Evo and Gundam SLs only see Evo and Gundam battles, respectively.
ZK uses rapid built into the lobby for updating.
Evo uses rapid that comes with the engine for updating
Gundam uses sd7 (I think he actually uses rapid now, but this is a hypothetical situation)

Evo uses most of the (but not all) Gundam maps + Evo maps
Gundam uses only Gundam Maps
ZK is more or less map agnostic

How would you do it? You are not allowed to use anything beyond batch files (compiled batch is ok), so no grandiose programming schemes.

These installs should be available in multi user on xp/vista/7/8.

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

AF your biggest issue, and the reason I get so pissed at you is that you don't understand the internals because you have never dealt with installing around multiple projects, so you come barging in proposing crap that just doesn't work for a myriad of obvious reasons and personally, It makes me very angry when I have to repeat myself 50 different times all over this forum to developers who should already know the problem inside and out.
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14587
Joined: 17 Nov 2005, 02:43

Re: @gamedevs: Writeable install directories

Post by Forboding Angel » 30 Dec 2011, 02:34

AF wrote:tbh I'd rather see a method of specifying the folders to look in and write to from a specific spring install manually under windows, e.g. telling a spring install to look in the evoRTS folder in my docs and the evoRTS folder in program files, allowing for fully independent game installs that aren't merely portable/isolated builds hemmed into program files etc.

Something like folders.cfg/folders.lua in the same directory as spring ( can windows users really be trusted to use command line parameters? )

Right now if I were to package up a game, I'd end up inheriting a lot of stuff from other games, which could detract from the experience ( non Kernel Panic maps showing in the maplist for a kernel panic install? )

I do agree, this solution is quite perfect. But I wouldn't hold my breath waiting for it to happen...

The problem with this solution is that ok you control the engine, but what about the lobby? It would have to abide by the same cfg, and until they do, it's useless.
0 x

User avatar
AF
AI Developer
Posts: 20669
Joined: 14 Sep 2004, 11:32

Re: @gamedevs: Writeable install directories

Post by AF » 30 Dec 2011, 07:48

the lobby grabs its content from unitsync, which uses the same library as the engine for the VFS
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14587
Joined: 17 Nov 2005, 02:43

Re: @gamedevs: Writeable install directories

Post by Forboding Angel » 30 Dec 2011, 09:27

Yes, but what tells the lobby where to store it's configs, and springsettings? Those run on different rules and each lobby is different.
0 x

User avatar
AF
AI Developer
Posts: 20669
Joined: 14 Sep 2004, 11:32

Re: @gamedevs: Writeable install directories

Post by AF » 30 Dec 2011, 19:09

That's up to each lobby developer to decide and is not relevant here since it is a completely different project to the engine, one that even isolation mode has no relevance to.
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14587
Joined: 17 Nov 2005, 02:43

Re: @gamedevs: Writeable install directories

Post by Forboding Angel » 31 Dec 2011, 00:51

It's absolutely relevant! It affects whether the game can even be packaged and distributed or not!

How can you possibly come in here and say that something so important isn't relevant?!?!
0 x

User avatar
AF
AI Developer
Posts: 20669
Joined: 14 Sep 2004, 11:32

Re: @gamedevs: Writeable install directories

Post by AF » 31 Dec 2011, 22:28

Because a lobby project != an engine project. Lobbies are not a component of the engine, they are projects in their own right that are commonly found alongside the engine ( and can exist without it ). They are not the same problem, they are two problems.

As such it is not an engine issue where lobbies concerned, because the engine is not the lobby. You will have to appeal to satirik or Licho etc.
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14587
Joined: 17 Nov 2005, 02:43

Re: @gamedevs: Writeable install directories

Post by Forboding Angel » 01 Jan 2012, 11:48

What the fuck does that have to do with packaging a game?

Talk about coming out of left field...
0 x

Post Reply

Return to “Game Development Tutorials & Resources”