Bugzilla – Bug 17848
LMS service does NOT install on Windows 7
Last modified: 2019-01-25 12:11:15 UTC
using win7 64bit. i was last on 7.5.5 r32431 and waited all this time to upgrade, as i think its smart to do, to let bugs get stamped out. as said above, i finally got that ver to run as service, after much unwarranted effort on my part, yet it remained flaky. so today i finally decide to try LMS, (7.7.2 r33761) mainly for its upnp/dlna features. the install seems to go fine, and i removed all the AV prior. yet STILL this problem persists! i don't see anything in the services that seems to be LMS related.... whats the service called now? i go into LMS control panel, and even though i did not delete or uninstall 7.5.5 program/prefs (i installed over the top of it as we are told is safe to do), ONCE AGAIN server does not know i want it run as a service, or even at login!!!! so i pick "run as service" and click apply, yet nothing happens! as above, i thought maybe multiple times would do the trick, but no... and it wouldn't totally shock me if eventually it decides to work, (i hold little hope for that however) but so far it isn't and its just so random and frustrating! and once again, as i've mentioned before, it is WRONG to have an apply button that doesn't subdue after clicking it and applying any changes! this is not SOP in the windows world, and it just comes off as unprofessional and amatuer. the main beef is you can't tell in situations like this, if anything happened, ie. there is no acknowledgement from the computer to the user that apply was even pressed. when will this madness stop??? FIX THIS so the service is: 1. installed 2. responds 3. control panel subdues "apply" unless changes are not yet applied, and/or after they are! i am not alone with this issue: http://forums.slimdevices.com/showthread.php?t=87284 http://forums.slimdevices.com/showthread.php?t=92325
a workaround is here: http://forums.slimdevices.com/showthread.php?t=91385 however, that does not explain: 1. how anyone is supposed to know that? 2. the bad behavior of the apply button and so i think something need to be done so as to not needlessly and pointless frustrate users going forward!
The bug is that squeezesvc.exe does not run as admin as required. Sometimes SqueezeTray.exe is launched as admin, notably after installation, which can then launch squeezeboxcp.exe and therefore squeezesvc.exe as admin. Some users also manually launch squeezeboxcp.exe with admin rights to work around the issue. squeezesvc.exe must always be launched as admin. As a user you can do this in file properties, compatibility, run as admin. squeezesvc.exe should be changed to request admin rights. As a side issue SqueezeTray.exe should not be running as admin, even after installation.
See: http://forums.slimdevices.com/showthread.php?t=87819 For mherger's replies regarding the issue and some additional reproduction info.
> The bug is that squeezesvc.exe does not run as admin as required. > > Sometimes SqueezeTray.exe is launched as admin, notably after installation, > which can then launch squeezeboxcp.exe and therefore squeezesvc.exe as admin. I must investigate why this fails. We did make it run as admin by default on Vista, but maybe W7 changed this again.
wow, one of MY bugs getting attn??? ;) Brett, what you are saying isn't the whole story. the service wasn't even LISTED in the list of services. the only way i got it installed and listed, was by running slimtray in admin mode, then saying start with machine. it wasn't that the service wasn't in admin mode, it was that the service did not exist to configure at all! given that there will be a windows 8, it would be wise to put a help link at that pref in slimtray explaining this, in case it happens again. and slimtray needs to be changed to properly subdue the apply button as necessary.
Ok, it seems Windows 7 silenced some of those warning/logon requests. Don't ask me just yet how this is supposed to work if an executable is flagged to always run as administrator, but Windows wouldn't ask for the administrator account any more... from http://technet.microsoft.com/en-us/magazine/ff431742.aspx: "Keep in mind that if you are using a standard account and prompting is disabled, the application will fail to run." See also http://msdn.microsoft.com/en-us/library/bb756929.aspx. It seems we can no longer force an executable into admin mode in Windows 7. We might need to add some code to verify success or failure of the process.
== Auto-comment from SVN commit #33876 to the slim repo by mherger == == http://svn.slimdevices.com/slim?view=revision&revision=33876 == Bug: 17848 Description: we need to check the Windows version more precisely. Only Vista allows to automatically run as admin (asking for credentials). On Windows 7 we must show a hint about the need to run the control panel as an admin user instead.
Mike/Bratt - could you please test r33876 or later to see whether you get that hint telling you to run the CP as an admin user?
ok, so i installed that ver to a virgin laptop running win7 64. the user IS an admin user. that isn't the problem. the problem is that it doesn't matter if the user is an admin or not, the slim tray app must be run in "admin mode" regardless. so the msg u have is wrong. it IS an admin user. also, the msg is hard to see, put it IN the box with the startup options. took me a while to find it and i was looking for it! and you need to explicitly tell people to "Quit slim tray, then right click the shortcut for it, then click "Run as Administrator" no one who doesn't know about this issue will understand anything from your currently opaque and frankly misleading msg. (i do like that the msg goes away once in admin mode tho)
== Auto-comment from SVN commit #33880 to the slim repo by mherger == == http://svn.slimdevices.com/slim?view=revision&revision=33880 == Fixed Bug: 17848 Description: improve messaging in case user doesn't have admin privileges. Make the message more visible and explicit.
ok, so you changed it to this: "You don't have privileges to install or start/stop the Logitech Media Server background service. Please start this tool as an administrator from the Windows Start Menu using the context menu." thats def better, but its still confusing. i would change it to this: "You don't have privileges to install or start/stop the Logitech Media Server background service. Please start LMS control panel from the Windows Start Menu, via the right click context menu, and click "Run as Administrator." at that point, i think you have done everything you can to explain things. not trying to be a pain in your butt, just trying to make things as good as possible for afflicted users going forward, and save you support calls/posts.
== Auto-comment from SVN commit #33882 to the slim repo by mherger == == http://svn.slimdevices.com/slim?view=revision&revision=33882 == Fixed Bug: 17848 Description: better instructions to get the control panel started as an admin. Thanks MrSinatra.
Other apps use ShellExecute() with verb "runas" to force admin request. This seems to work 100% of the time for all other apps. Documented here: http://msdn.microsoft.com/en-us/library/bb756922.aspx BOOL RunAsAdmin( HWND hWnd, LPTSTR lpFile, LPTSTR lpParameters ) { SHELLEXECUTEINFO sei; ZeroMemory ( &sei, sizeof(sei) ); sei.cbSize = sizeof(SHELLEXECUTEINFOW); sei.hwnd = hWnd; sei.fMask = SEE_MASK_FLAG_DDEWAIT | SEE_MASK_FLAG_NO_UI; sei.lpVerb = _TEXT("runas"); sei.lpFile = lpFile; sei.lpParameters = lpParameters; sei.nShow = SW_SHOWNORMAL; if ( ! ShellExecuteEx ( &sei ) ) { printf( "Error: ShellExecuteEx failed 0x%x\n", GetLastError() ); return FALSE; } return TRUE; }
Apparently in Perl this is equal: Win32::FileOp::ShellExecute( runas => 'SqueezeSvr.exe' ) http://search.cpan.org/~jenda/Win32-FileOp-0.14.1/FileOp.pm
Actually let me link more current stuff. http://search.cpan.org/~jenda/Win32-FileOp-0.16.00-withoutworldwriteables/FileOp.pm
Unfortunately this doesn't solve the issue that Windows 7 does not always ask for a privileged account if your user isn't already part of the administrators group. See comment #6.
maybe i'm not following you guys, but my exp has been that it does not matter if your user is an admin or not. either way, u have to right click and say "run as admin" to get slim tray to work to run/install the service which otherwise isn't there and won't run/install. once the service is installed however, u don't need to do that going forward. seems to be necessary only one time to get the service installed.
I can not think of a better way to put this: The main issue isn't with truly limited user accounts. Perhaps the pretty text warning about admin is their only hope. Your problem here is with stock standard Windows 7 installs. Windows 7 defaults to adding Administrator users running under UAC. Those users dont put in username or passwords for admin privs, they simply click yes or no. If you did some stats on the users im almost certain you'll find something like: 99% - Administrator user account running under UAC (Windows default) 1%- Limited user account You need to fix the problem that is effecting basically all of your Windows userbase, which is that LMS doesnt trip UAC to prompt for admin privs, LMS just silently fails. Many many many other apps handle UAC prompts by making use of "runas". This does work and will make this issue actually resolved. I assure you the problem is Admin users under UAC and the problem will be solved with the suggested fix.
As I said in the forum thread: I did implement the way you suggested and it failed exactly the same way. See my link. MS changed this, and they tell us you can't rely on the UAC dialog popping up.
It works fine for all the other apps. Eg Firefox, mpc-hc, Mezzmo and well the list is as long as my arm.
Do not confuse non-administrator users(not common for home users) and will be effected by no UAC prompts versus administrator users under UAC(very common for home users) where runas is proven and documented to pop UAC prompt.
I just tested this on Windows 7 Ultimate 64bit with a tiny test app compiled with VS 2010. My user account is administrator under UAC(default for Windows), app is run normally(under my account but with no admin privileges). I can launch foobar200.exe as admin or without with the following code: ShellExecute(NULL, TEXT("runas"), TEXT("foobar2000.exe"), NULL, NULL, SW_SHOW); Prompts for admin before launching app. ShellExecute(NULL, NULL), TEXT("foobar2000.exe"), NULL, NULL, SW_SHOW); Launches app without admin. If this fails for you, you are doing something wrong, it works, it is documented, it works for every other developer, it is proven.
Brett, are you saying that what you would do, is get server via Perl to instruct windows to ALWAYS run slimtray in the 'right click context menu way' of "Run as Admin" ? Michael doesn't seem to think thats possible, yet you insist it is. perhaps you could provide a patch for Michael to try, since i don't get the feeling he's going to work on this more? i do think if possible your solution is better, since i agree with your 99% statement. however, do you see any drawbacks to ALWAYS running slimtray in "run as admin" mode by admins? it only needs to be once to install the service, but the Q is when will people want to install the service if u aren't going to run as admin all the time?
I'll have to give this another try. I think we've not always been talking about the same thing, and my test setup might be different from what you describe.
Mike, the issue isnt that slimtray.exe runs as admin, the issue is squeezesvc.exe needs to run as admin. slimtray.exe launches squeezesvc.exe to install/uninstall the Windows service, it uses this "helper" app because it will be extremely common that slimtray.exe is not running as admin and cant install/uninstall a service itself. If slimtray.exe is running as admin it will launch squeezesvc.exe as admin, that is a side effect and not the solution either. It is totally undesired to have apps running with admin privs that dont require it, it just makes for security issues. The more correct user fix is to right click squeezesvc.exe and tick to always run it as admin. That way when slimtray.exe launches squeezesvc.exe Windows will ask for admin permission for running squeezesvc.exe The real fix is for slimtray.exe to give Windows a hint that when it is launching squeezesvc.exe that it will require admin. This will fix the common case where Windows users are administrator users controlled by UAC and its yes/no prompts for admin privs per process. It is kinda like Linux's su but where UAC recognizes the admin requirement and asks the users a simple yes/no question to grant admin rights. What my fix wont help is if a user is not an administrator at all and is in fact a limited users. This is extremely uncommon outside of the business world. Squeezebox is a home product mainly purchased for home users running on their home desktop Windows, most all the users are administrators.
PS after this is fixed I go back to my note earlier: "As a side issue SqueezeTray.exe should not be running as admin, even after installation." slimtray.exe or whatever we call it this week should never run as admin. This is happening because the installer has been elevated to administrator rights and if the installer launches squeezetray/slimtray.exe it also inherits the admin rights. This is much more complex to fix than the problem we are currently tackling in this bug however. I would need to go hunting through Firefox code to check how they resolved this issue. That issue should be fixed for security reasons and also so the experience to the user is consistent. Currently slimtray.exe behaves different between first launch to all subsequent launches. A quick and nasty fix would be to not launch slimtray.exe from the installer at all and leave it to users to launch it. PPS for the sake of mentioning the installer triggers UAC prompt for admin due to Windows heuristics. I believe these heuristic patterns changed from Vista to 7 which is why Vista picked up squeezesvc.exe as needing admin but Windows 7 does not. Eg It was luck that Windows Vista picked the admin requirement for squeezesvc.exe previously and simply bad luck Windows 7 does not. This issue of not requesting admin rights for squeezesvc.exe always existed in Logitech Squeezebox code.