PDA

View Full Version : Moving out of "Documents and Settings"?



Terje
2008-01-19, 10:13
I just yesterday used some time and "upgraded" from 6.5 to 7.0 and are mostly happy with the outcome. However, the moving of prefs and DB to "Documents and Settings" is really a bad thing for me so I wonder how I can move it back?

BTW! I didn't mean the thumbs down icon, edited the post, but it still shows. I mistook it for a questionmark :o)

Terje
2008-01-22, 06:54
No way around this?

kdf
2008-01-22, 09:01
c:\program files\squeezecenter\slim.exe --help

consider using the --prefsdir and --cachedir options for the command line (edit the shortcut) or service (you should be able to edit the args in the services control panel).

I can't recall if the db goes in the cache or not, because I use an existing mysql server. The move was to be more in line with current windows file placement, especially since Vista seems to be less forgiving about it.

-kdf

Terje
2008-01-22, 09:28
c:\program files\squeezecenter\slim.exe --help

consider using the --prefsdir and --cachedir options for the command line (edit the shortcut) or service (you should be able to edit the args in the services control panel).


Thanks, I'll check into this. If it works, it's okay for me.

mherger
2008-01-22, 10:18
> c:\program files\squeezecenter\slim.exe --help

Make this squeezecenter.exe.

BTW: why is the new location a problem for you? It's imho what MS would
expect us to do.

Michael

kdf
2008-01-22, 10:25
>> c:\program files\squeezecenter\slim.exe --help
>
> Make this squeezecenter.exe.

sorry. I keep forgetting which names are changed and which aren't. The
whole path tends to type from muscle-memory now :)
-kdf

Terje
2008-01-22, 10:40
> c:\program files\squeezecenter\slim.exe --help

Make this squeezecenter.exe.

BTW: why is the new location a problem for you? It's imho what MS would
expect us to do.

I tried this with sqeezecenter.exe, but couldn't get it to work. When I use the services.msc I have a field "Parameters:", but whatever I write there is not saved. So I went ahead and edited the ImagePath in registry for the squeezesvc directly, but that didn't work either. Before I restarted the service I moved all the directories to the new location and also edited any references I found in those files to match the new location.

As for the move of location I guess that's fine for most users as it would make it easier to migrate settings when reinstalling or such. For me this is running as a service on a server and in that scenario a DB has nothing to do in D&S, the cache I guess shouldn't be there either if it is just that, a cache? As for the prefs they really should reside in Registry if it was up to M$, but I totally agree in the open multi platform file based approach. The reason for me to have it with the installation is that I replicate server based service (as SC) and I can start up the service on one of many servers.

Anyway, I'm happy as long as I can move it back in some way, if that means editing registry for the service, some files or more that's fine for me.

Daryle Tilroe
2008-03-09, 15:20
> c:\program files\squeezecenter\slim.exe --help

Make this squeezecenter.exe.

BTW: why is the new location a problem for you? It's imho what MS would
expect us to do.

Michael

Sorry for the thread necromancy but as a recent upgrader from Slimserver to Squeezecenter I too have been puzzled about this change. This was the closest thread I could find. Unless I am very much missing something this new location now leaves all the prefs, cache, and logs open to being blown away by any old user. As a "server" this is not really the way to go. I also had set the service back to system one.

y360
2008-03-10, 00:58
I think that the change is essentially required by Vista.
Running under UAC (User Account Control) programs should no longer change files under Program Files folder

Daryle Tilroe
2008-03-10, 01:07
I think that the change is essentially required by Vista.
Running under UAC (User Account Control) programs can no longer change files under Program Files folder

That's sort of the point: they shouldn't be. Neither can people logged into my properly setup XP PC as users. If you are "properly" running Squeezecenter as a System Service it should not have its config files somewhere where anyone logged in can bork them up. I think it's fine that the new Squeezecenter can be run as an insecure app for Joe sixpack (if his botnet PC has enough CPU cycles left ;-) ). However, I always liked Slimserver because it, by default , ran as a proper, and secure, service. It is disappoiting SqueezeCenter seems to be moving away from that paradigm; on Windows at least. Ahh well, if I understand correctly I can just launch the service with a few flags and have it look back in the protected Program Files locations.

mherger
2008-03-10, 01:16
> I think that the change is essentially required by Vista.

Correct. And as many users want to run SC as a server/service in the background, without knowing the issues this brings along, we had to find an acceptable trade-off. Server admins who care about security of their service's data usually know enough about services and how to configure a Windows system to do so.

--

Michael

mherger
2008-03-10, 01:19
> That's sort of the point: they shouldn't be. Neither can people logged
> into my properly setup XP PC as users. If you are "properly" running
> Squeezecenter as a System Service it should not have its config files
> somewhere where anyone logged in can bork them up. I think it's fine
> that the new Squeezecenter can be run as an insecure app for Joe
> sixpack (if his botnet PC has enough CPU cycles left ;-) ).

As I mentioned in my previous posting we had to find a trade-off. If we put the data in a protected place, support (or these forums) would be overwhelmed by users calling why they're loosing their configuration when switching from service to app mode (and vice-versa).

If you care about SC's data then it should be easy enough for you to get the permissions right or configure the service to use different folders.

> It is disappoiting SqueezeCenter seems to be moving
> away from that paradigm; on Windows at least.

Feel free to add the prefsdir argument to your service's configuration.

--

Michael

JJZolx
2008-03-10, 02:30
I tried this with sqeezecenter.exe, but couldn't get it to work. When I use the services.msc I have a field "Parameters:", but whatever I write there is not saved. So I went ahead and edited the ImagePath in registry for the squeezesvc directly, but that didn't work either.

Tonight I ran the SC7 installer and then set SC to run as a service. I also can't get the service to reccognize the --prefsdir option when entered in the registry in the ImagePath key. Historically, I've run into a lot of problems getting command line options recognized by Slim/Squeeze/Server/Center when run as a service. The --logsdir option seems to work, but the --cachdir option also fails. Strangely, I get different results when running the Perl code, so I have no idea where/why/how this is failing. It's very inconsistent.

Terje
2008-03-10, 09:38
> It is disappoiting SqueezeCenter seems to be moving
> away from that paradigm; on Windows at least.[/color]

Feel free to add the prefsdir argument to your service's configuration.

As I started this thread I only got as far as moving everything but prefs and logs to a secure location. I've not been able to get SC to accept the arguments, I cannot add them using the services applet, and when I add them directly in registry it doesn't seem to work as it should either.

I'm running my SC on a dedicated 2003 R2 under a user restricted to only the SC relevant directories.

If someone has been able to get the prefs and logs out of D&S as well, please speak up.

mherger
2008-03-10, 13:46
> accept the arguments, I cannot add them using the services applet, and
> when I add them directly in registry it doesn't seem to work as it
> should either.

I'll have to test this.

> If someone has been able to get the prefs and logs out of D&S as well,
> please speak up.

If you really care about protecting the files, why don't you just restrict
access to the squeezecenter folder as long as the prefsdir parameter
doesn't stick? Not the cleanest solution, but should work anyway.

Michael

JJZolx
2008-03-10, 13:58
> when I add them directly in registry it doesn't seem to work as it
> should either.

I'll have to test this.

Yeah, I can't get all the folder options to work either. They work when running the EXE from the command line and when running the Perl code as a service.

But running the EXE as a Windows service, only the --logdir option seems to work, while --prefsdir and --cachedir do not. The cache folder can be relocated by editing the prefs file, but I haven't found a workaround for prefs.

Terje
2008-03-10, 14:07
If you really care about protecting the files, why don't you just restrict
access to the squeezecenter folder as long as the prefsdir parameter
doesn't stick? Not the cleanest solution, but should work anyway.

Sure, that works for me, but my other thing is that the SC directory is part of a DFS replicated software area which in turn means that everything is online replicated to other servers in case the one running SC fails. While it is possible to do that with D&S or parts of, that is really a messy solution. All I need is a working solutions to move everything as I like. I don't mind having to edit this from the default installations, as you say, the new implementation makes sense for most users.

JJZolx
2008-03-10, 14:27
Here's a workaround. Basically, create a batch file to run SC7 with the necessary command line options. Then modify the registry entry for the SqueezeCenter service to use srvany.exe to run the batch file as a service.

My batch file looks like:


@echo off & setlocal

set ipaddr=192.168.9.2
set rootdir=D:\slim\dot2
set prefsdir=%rootdir%\prefs
set cachedir=%rootdir%\cache
set logdir=%rootdir%\logs

"C:\Program Files\SqueezeCenter\server\squeezecenter.exe" --playeraddr %ipaddr% --cliaddr %ipaddr% --streamaddr %ipaddr% --httpaddr %ipaddr% --prefsdir=%prefsdir% --cachedir %cachedir% --logdir %logdir%

Download srvany.exe, included in the Windows 2003/XP Resource Kit (http://www.microsoft.com/downloads/details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en). (After installing the Resource Kit, you can delete everything except srvany.exe if you like).

Change the ImagePath in the registry to point to srvany.exe. On my system:


"C:\Program Files\Windows Resource Kits\Tools\srvany.exe"

Then create a new registry key called 'Parameters' and in that key a string called 'Application'. Set the value of Application to the full path of your batch file, enclosing it in double quotes if it contains any spaces.

radish
2008-03-10, 15:56
I might be missing something obvious, but why not just run as a dedicated user? If you have a "sq" user for example, then the cache, prefs, etc will be in c:\d&s\sq. Now if you have your server setup properly that dir is protected and no-one except the sq user can write to it. If you need to replicate that folder around the place either remote mount d&s or use a remote/local profile setup.

mherger
2008-03-10, 23:44
> I might be missing something obvious, but why not just run as a
> dedicated user? If you have a "sq" user for example, then the cache,
> prefs, etc will be in c:\d&s\sq.

No, it's not. We decided to put it in the "All Users" folder as users tend
to switch between service and app mode and don't want to lose their
settings.

Michael

radish
2008-03-11, 07:10
> I might be missing something obvious, but why not just run as a
> dedicated user? If you have a "sq" user for example, then the cache,
> prefs, etc will be in c:\d&s\sq.

No, it's not. We decided to put it in the "All Users" folder as users tend
to switch between service and app mode and don't want to lose their
settings.

Michael

That would be the obvious thing I was missing :) Thanks for the clarification.

Terje
2008-03-11, 09:32
Here's a workaround. Basically, create a batch file to run SC7 with the necessary command line options. Then modify the registry entry for the SqueezeCenter service to use srvany.exe to run the batch file as a service.

Yes, this would work. Why didn't I think about that, I've used srvany.exe for lots of other things.

Anyway, I hope SD resolves this so it can be done in a more "correct" way.

Terje
2008-03-11, 09:37
No, it's not. We decided to put it in the "All Users" folder as users tend
to switch between service and app mode and don't want to lose their
settings.

Which is much better than some companies which put their applications data into the the part of a users profile which does roam and the amount of data is huge. The idea to put the data in its current location is the right one, it just should be somewhat easier to select something else.

mherger
2008-03-12, 01:38
> Anyway, I hope SD resolves this so it can be done in a more "correct"
> way.

I opened a bug report:
http://bugs.slimdevices.com/show_bug.cgi?id=7491

Feel free to add any additional information which might help us track this
down. Thanks!

Michael

mherger
2008-03-12, 01:39
> Which is much better than some companies which put their applications
> data into the the part of a users profile which does roam and the
> amount of data is huge.

We could still do better by moving the Cache folder to the Local Settings
folder. But then I assume SC is rarely used in environments with roaming
profiles...

Michael

Terje
2008-03-15, 06:17
We could still do better by moving the Cache folder to the Local Settings
folder. But then I assume SC is rarely used in environments with roaming
profiles...

Well, yes and no. Since you are using All Users, that is not roaming anyway and moving puttings things in a normal users D&S will only make things worse for the common user and give you support headaches as I think you already wrote about yourself. Current implementation is fine, just make it easier/possible to move it in a sensible matter.