@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: 14673
Joined: 17 Nov 2005, 02:43

@gamedevs: Writeable install directories

Post by Forboding Angel »

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 61 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.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: @gamedevs: Writeable install directories

Post by knorke »

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"?
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: @gamedevs: Writeable install directories

Post by Forboding Angel »

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.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: @gamedevs: Writeable install directories

Post by knorke »

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?
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: @gamedevs: Writeable install directories

Post by Forboding Angel »

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.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: @gamedevs: Writeable install directories

Post by Forboding Angel »

Please sticky this or put it in the resources section.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: @gamedevs: Writeable install directories

Post by AF »

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.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: @gamedevs: Writeable install directories

Post by knorke »

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..
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: @gamedevs: Writeable install directories

Post by Forboding Angel »

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.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: @gamedevs: Writeable install directories

Post by AF »

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
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: @gamedevs: Writeable install directories

Post by Forboding Angel »

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.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: @gamedevs: Writeable install directories

Post by AF »

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?
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: @gamedevs: Writeable install directories

Post by Forboding Angel »

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.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: @gamedevs: Writeable install directories

Post by Forboding Angel »

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.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: @gamedevs: Writeable install directories

Post by AF »

the lobby grabs its content from unitsync, which uses the same library as the engine for the VFS
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: @gamedevs: Writeable install directories

Post by Forboding Angel »

Yes, but what tells the lobby where to store it's configs, and springsettings? Those run on different rules and each lobby is different.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: @gamedevs: Writeable install directories

Post by AF »

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.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: @gamedevs: Writeable install directories

Post by Forboding Angel »

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?!?!
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: @gamedevs: Writeable install directories

Post by AF »

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.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: @gamedevs: Writeable install directories

Post by Forboding Angel »

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

Talk about coming out of left field...
Post Reply

Return to “Game Development Tutorials & Resources”