Prevent stuff from being written to My Documents
Moderator: Moderators
Prevent stuff from being written to My Documents
How do you disable programs from writing stuff to the My Documents folder? I've tried to denying the SYSTEM user from having write permission to that folder (not whole My Documents, but My Documents/My Games/Spring), but it can still write there. Do you know any good tricks for how to achieve this?
Do I have to also disable all Administrator users from write access to that directory? I don't care if it renders the Spring directory there orphan or whatever, I just want to stop it being written to.
I'm using win7.
Do I have to also disable all Administrator users from write access to that directory? I don't care if it renders the Spring directory there orphan or whatever, I just want to stop it being written to.
I'm using win7.
Re: Prevent stuff from being written to My Documents
You have to set access rights for the user which is used to run the program. Very likely you will get crashes, etc when doing so. I suggest to either configure the programs or set a symlink.
Re: Prevent stuff from being written to My Documents
Thank you, that was the solution. I post it for reference in case anyone else encounters this issue with some spring malware. Go to "My Documents" and right-click on "My Games", choose open command window here. Type the following:
That will send everything that wants to write something to the Spring folder, or try to create it, to an electronic black hole. You now have control of your computer again.mklink /D Spring NUL
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: Prevent stuff from being written to My Documents
http://www.techsupportalert.com/content ... -drive.htm
If you honestly think that "control of your computer" has anything to do with where your mydocs folder is then you are mad.
If you honestly think that "control of your computer" has anything to do with where your mydocs folder is then you are mad.
Re: Prevent stuff from being written to My Documents
Yes, it is my decision what I want to be saved in a folder, or what things I want to be saved in My Documents (which I think is for documents) and what I want in other places. If a program doesn't respect that then I don't have control over it. I just posted one way to achieve this.
Note: if you use linux you should use /dev/null instead
Note: if you use linux you should use /dev/null instead
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: Prevent stuff from being written to My Documents
Also, independent of the fact that Windows offers you choice of where to put your personal folders (if you had bothered to look for it), Spring itself has "isolation mode" http://springrts.com/phpbb/viewtopic.ph ... 44#p538808.
Re: Prevent stuff from being written to My Documents
This has nothing to do with windows: I obviously know about how to relocate folders on windows and the problems with them as well (it's not recommended on a setup that you must use for productive work, only for testing, because it breaks programs such as windows migration wizard).
Documents are typically different than games, and that's why I have chosen to locate My Documents on a hard drive that's optimised for speed and not for storage. Games are more close to video and media files in my opinion, I don't want to keep them under My Documents. I keep them on another hard drive. Anyway, whatever reason I have to put things where I want is none of the business of Spring, or other people. I simply want to decide myself where to put my files.
I know about isolation and portable mode. Atm I think I'm running portable mode with the write-dir defined by env-variables as well as springsettings Datadir. But all spring programs do not respect that.
Documents are typically different than games, and that's why I have chosen to locate My Documents on a hard drive that's optimised for speed and not for storage. Games are more close to video and media files in my opinion, I don't want to keep them under My Documents. I keep them on another hard drive. Anyway, whatever reason I have to put things where I want is none of the business of Spring, or other people. I simply want to decide myself where to put my files.
I know about isolation and portable mode. Atm I think I'm running portable mode with the write-dir defined by env-variables as well as springsettings Datadir. But all spring programs do not respect that.
Re: Prevent stuff from being written to My Documents
Ah, but I can't put spring in isolation mode then because I have many locations from where I need it to read files. I need it to read files from the install directory (C:/Spring), data-dir (U:/data/spring), as well as a gitbub folder, one folder for each widget/gadget).
It currently works really well in portable mode, except fro some programs that insist to use My Documents anyway.
It currently works really well in portable mode, except fro some programs that insist to use My Documents anyway.
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: Prevent stuff from being written to My Documents
Wrong, Microsoft recommends it (although I'm not advocating this as as a general principle for "things you should do"). http://windows.microsoft.com/en-gb/wind ... =windows-7.to relocate folders on windows and the problems with them as well (it's not recommended on a setup that you must use for productive work...
Also wrong since (as you'd know if you'd bothered to read it) (1) it's an easily reversible operation and (2) moreover, migration wizard allows you to migrate any non-system files you like from/to anywhere you like.it breaks programs such as windows migration wizard
Also wrong since Windows gives you the option to create your own libaries.Documents are typically different than games... blah blah ... to decide myself where to put my files.
Re: Prevent stuff from being written to My Documents
Not possible for "My Games", only for the whole "My Documents". The location tab is not available for "My Games".Silentwings wrote:Wrong, Microsoft recommends it (although I'm not advocating this as as a general principle for "things you should do"). http://windows.microsoft.com/en-gb/wind ... =windows-7.
Also, seems it's not just spring that has issues with redirected folders:
http://steamcommunity.com/app/232750/di ... 679013000/
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: Prevent stuff from being written to My Documents
Windows gives you the option to create your own libraries.
-
- Posts: 843
- Joined: 13 Aug 2007, 13:19
Re: Prevent stuff from being written to My Documents
Both SpringLobby(packed with Spring) and Spring itself write outside of the installation directory. So this description is not correct.Portable Mode
An all-in-one-folder setup, which allows to run Spring without installation. To do so all relevant files (binaries & basecontent) must be in a single folder, esp. spring(.exe), libunitsync.so/unitsync.dll and springsettings.cfg. Spring will then use the all-in-one-folder for writing and won’t do so anywhere else on the system, but it may open other files & directories for reading.
How do I apply this? Should there be an option in the lobby to put -s behind spring.exe?Isolation Mode
Not to confuse with Portable Mode, this mode disables all automatic Data Dir scanning and limit reading & writing to a single folder. This is very usefull when games want to run separate from other Spring games.
Re: Prevent stuff from being written to My Documents
It works for me for most stuff. Let's say you have the following:
A - spring install directory
B - Spring Data directory (this you want writeable)
C - Additional read directory(ies)
Install spring to A. Put a springsettings.cfg in same dir with following parameter: SpringData = B
In B, you then have your main springsettings.cfg, which can have many SpringData values, like SpringData = C;D;...;Z. I'm not sure if you need to, but I also have the environment variable SPRING_WRITEDIR = B.
Now, if you install a new spring version in directory A2, all you need to copy to it is the springsettings.cfg with path to B, and your own uikeys.txt file. All rest can be kept in B (like your own widgets, maps, etc).
If a program, after all these steps taken, still writes in My Documents: I don't know how you can say it is following your control? I consider it malware. God knows what else it will do.
A - spring install directory
B - Spring Data directory (this you want writeable)
C - Additional read directory(ies)
Install spring to A. Put a springsettings.cfg in same dir with following parameter: SpringData = B
In B, you then have your main springsettings.cfg, which can have many SpringData values, like SpringData = C;D;...;Z. I'm not sure if you need to, but I also have the environment variable SPRING_WRITEDIR = B.
Now, if you install a new spring version in directory A2, all you need to copy to it is the springsettings.cfg with path to B, and your own uikeys.txt file. All rest can be kept in B (like your own widgets, maps, etc).
If a program, after all these steps taken, still writes in My Documents: I don't know how you can say it is following your control? I consider it malware. God knows what else it will do.
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: Prevent stuff from being written to My Documents
If Spring itself really does so in portable mode then obviously you should make a mantis with details.Portable mode... Spring itself writes outside of the installation directory
-
- Posts: 843
- Joined: 13 Aug 2007, 13:19
Re: Prevent stuff from being written to My Documents
Apparently it already has been. Solution is some manual fix. Anyway, devs know and should (could?) act upon it (by either removing portable from download page or making it actually portable by default).Silentwings wrote:If Spring itself really does so in portable mode then obviously you should make a mantis with details.Portable mode... Spring itself writes outside of the installation directory
Also, I'm not gonna set up a VM with clean install to provide examples.
Re: Prevent stuff from being written to My Documents
i know users don't care what is causing it but to understand you have to distinguish between the programs that write to "My Documents": mostly lobbies and engine.
to make it really portable you have to configure both of them, if you only configure the engine most lobbies will ignore it and vice versa. springlobby for example should have a config setting for all paths since v0.189 but it can be only configured by editing the config file atm, help->system info should show all relevant paths, if some path is outside where it should be, fix the config setting.
springlobby currently also doesn't set SpringData dir automaticly, this could be done but atm i guess it would cause many trouble as some users already configured paths on their own.
still "easiest" fix is to create a symlink my games\spring -> dir you want to have it as it works with all lobbies and engines.
to make it really portable you have to configure both of them, if you only configure the engine most lobbies will ignore it and vice versa. springlobby for example should have a config setting for all paths since v0.189 but it can be only configured by editing the config file atm, help->system info should show all relevant paths, if some path is outside where it should be, fix the config setting.
springlobby currently also doesn't set SpringData dir automaticly, this could be done but atm i guess it would cause many trouble as some users already configured paths on their own.
still "easiest" fix is to create a symlink my games\spring -> dir you want to have it as it works with all lobbies and engines.
Re: Prevent stuff from being written to My Documents
Why can't they both use an agreed way to listen to where the user wants the stuff installed? Why not check for that env.variable for instance.abma wrote:i know users don't care what is causing it but to understand you have to distinguish between the programs that write to "My Documents": mostly lobbies and engine.
Please don't do this. The SpringData dir should be used to listen to what the user wants, not telling him what the lobby wants. I already stopped using weblobby because of this, because each time I use it I have to go back and reconfigure my SpringData dir variable to read from multiple places.abma wrote: springlobby currently also doesn't set SpringData dir automaticly, this could be done but atm i guess it would cause many trouble as some users already configured paths on their own.
Re: Prevent stuff from being written to My Documents
lobbies have to work without a spring installed. they have to decide where to place stuff, so they have to say to spring, where to write its stuff as well. it can't work the other way arround.Jools wrote:Please don't do this. The SpringData dir should be used to listen to what the user wants, not telling him what the lobby wants. I already stopped using weblobby because of this, because each time I use it I have to go back and reconfigure my SpringData dir variable to read from multiple places.
also using an env var is fail to set a dir imo. it doesn't allow to prepackage stuff/preconfigure it, it has to be a config setting. if lobby for example would set an env var, the var wouldn't be set if spring is run directly, without the env-var set -> fail.
Re: Prevent stuff from being written to My Documents
Ok, but there are so many lobbies and only one engine. I understand those points, but why not check for the presence of an optional env.var/springData setting, and if it doesn't exist, go with default.