Bug 4954 - Music & Playlist directories do not take at install.
: Music & Playlist directories do not take at install.
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Windows Installer
: 6.5.2
: PC Windows XP
: P2 major (vote)
: ---
Assigned To: Blackketter Dean
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-05-01 16:23 UTC by Spies Steven
Modified: 2009-09-08 09:17 UTC (History)
4 users (show)

See Also:
Category: ---


Attachments
possible fix (501 bytes, patch)
2007-05-03 11:44 UTC, KDF
Details | Diff
more complete (1.65 KB, patch)
2007-05-03 22:58 UTC, KDF
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Spies Steven 2007-05-01 16:23:03 UTC
To reproduce install the nightly SlimServer.
While installing note the directories chosen for Music & Playlist directories.
Mine defaulted to: C:\Documents and Settings\Administrator\My Documents\My Music
for both Music and Playlists.
Once installed launch SlimServer and navigate to Home / Server Settings / Basic Settings
Notice how Music Folder and Playlist Folder did not take.
My Music Folder was blank and Playlists Folder was C:\Program Files\SlimServer\server\Playlists

SlimServer Version: 6.5.2 - 11874 - Windows XP - EN - cp1252
Perl Version: 5.8.8 MSWin32-x86-multi-thread
MySQL Version: 5.0.22-community-nt
Comment 1 Spies Steven 2007-05-03 09:54:09 UTC
Chris, this one concerns me a great deal. Who should it be assigned to?
Comment 2 Chris Owens 2007-05-03 09:57:14 UTC
Possibly Dean?  He's been working on other installer issues.
Comment 3 KDF 2007-05-03 10:57:51 UTC
I may be able to help in parallel...

It looks like the server code is trying to find the music folder setting from the registry at:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders

Do you have a My Music folder at that location?  If not, are you able to locate the Shell Folders registry entry that DOES have the value you set in the installer?  

Playlist folder seems to never check the registry, so that's an obvious cause :)
Comment 4 KDF 2007-05-03 11:22:53 UTC
ack..I really don't understand windows programming.  I've misread it again.  It looks like the installer is supposed to be writing out to the prefs file and the server has nothing to do with the handover.  I now see where it is supposed to write so I'll see what I can find out.  I won't have any way to test possible changes, however.
Comment 5 KDF 2007-05-03 11:44:48 UTC
Created attachment 1929 [details]
possible fix

It looked like the string written out to the prefs file isn't in the current yaml format.  I can't exactly confirm becuase the server starts up too quickly to catch the pref file before the server overwrites with defaults.  However, altering the format to match the yaml style text may solve the problem.
Comment 6 KDF 2007-05-03 13:08:59 UTC
The other possible thing here is that teh pref file is being created by the starting of slimtray and slimserver before teh installed gets to the "ssDone" point.  I can't find any docs that specifically state when is how that event gets triggered, but it seems that there is a "ssPostInstall" step that looks to be before "ssDone", so in addition to my previous patch, it might be wise to change line 297 to:

if CurStep = ssPostInstall then begin
Comment 7 Chris Owens 2007-05-03 13:16:33 UTC
It looks like the patch KDF suggests is to the windows installer script, which QA is not set up to build at the moment.  We can try to tool up to be able to do that, or KDF could check in his changes and the nightly will have them (at the risk, if they don't work, of a broken nightly tomorrow for windows users).
Comment 8 KDF 2007-05-03 13:24:54 UTC
well, I can commit this evening and someone could trigger the windows build machine to have a go then, OR I could commit and check it when I wake up.  If the build failed, I can revert and then someone can trigger a rebuild once they get into the office?
Comment 9 Adrian Smith 2007-05-03 14:34:12 UTC
I think the server should read and convert the old format into YAML on the first startup.  YAML will need the saved file to start with the correct string "----".  I think we need this for 7.0, but for 6.5 the old format should be ok.

I think This is more likely to be due to location of the prefs file.  I've had to move this on Vista and Dean has had to put something in the installer for that.

I'm waiting to see Dean's updated installer - is this in the code (didn't see a checkin?)
Comment 10 KDF 2007-05-03 16:33:13 UTC
I don't think it's the location.  I've been installing on XP with defaults to test.  What gets me is that the slimserver.pref file is created in full before the installer program is ended.  From what little I could find on the InnoSetup docs, isDone is just about the very last thing before the setup window closes, which doesn't even happen unless you click Finish.  Of course, without tools, I can't confirm the exact timing.
 
YAML would be the full and proper choice, and easily created for the patch.  I've not seen any of the old versions do anything with existing prefs.  From the code, it should just skip asking for playlist and music folders if a pref file is already found.
Comment 11 Adrian Smith 2007-05-03 16:46:24 UTC
one for Dean.  We do need the installer to do this before any prefs file existts as we don't want it to overwrite existing prefs.
Comment 12 KDF 2007-05-03 22:58:47 UTC
Created attachment 1935 [details]
more complete

This version outputs in the simple YAML format, and does the prefs bit in the step before isDone so before slim.exe is started and thus before the default prefs file gets written. at least that's what I can gather from the scarce docs.
Comment 13 Adrian Smith 2007-05-04 11:25:15 UTC
Dean was working on an update to the installer to save the language too - it would be good to see these combined.  Looks like we are waiting for Dean...
Comment 14 Spies Steven 2007-05-09 09:37:29 UTC
This is improved in the nightly. However it does not seem to matter what directories I choose during the install. It will come up C:\Documents and Settings\Administrator\My Documents\My Music for both after the install is complete. This is better then being blank however.
Comment 15 Spies Steven 2007-05-09 09:41:55 UTC
Adding Ross
Comment 16 Adrian Smith 2007-05-09 10:32:00 UTC
Steven - is this with a complete uninstall between them to ensure the slimserver.pref file is removed?

At present we only write what is entered to the installer if there is no pref file.  It would be better to suppress this option if a pref file exists, but I think that is an enhancement for the future unless Dean has a quick way of doing it.
Comment 17 KDF 2007-05-09 10:35:06 UTC
There is a section of code that did look like it skipped the folder entry dialogs if the prefsfile existed.  Is that gone now?
Comment 18 Adrian Smith 2007-05-09 10:37:03 UTC
I don't think it is there - but I've not looked at that bit in detail - I can try to add it back as these seems to be the desired operation.
Comment 19 Spies Steven 2007-05-09 10:50:24 UTC
(In reply to comment #16)
> Steven - is this with a complete uninstall between them to ensure the
> slimserver.pref file is removed?

Yes, complete uninstall and deletion of the SlimServer folder.
Comment 20 KDF 2007-05-09 10:51:01 UTC
My first exposure to iss files was with this bug so I may be reading it wrong.  I thought this bit of code was to skip the folder input pages.  I guess it's not working currently:

			// Insert a custom wizard page between two non custom pages
			if  (BackClicked or FileExists(PrefsFile)) then
				curSubPage:=2
			else
				curSubPage:=0;
Comment 21 Squeezebox QA Team email alias 2007-05-15 12:04:15 UTC
This no longer seems to be happening.  If there's a change number, we can mark this as fixed.
Comment 22 Adrian Smith 2007-05-15 12:08:58 UTC
change 11956 for 6.5
Comment 23 Ross Levine 2007-05-15 12:40:56 UTC
Thanks Triode!
Comment 24 Ross Levine 2007-05-16 13:24:40 UTC
Dan in support is still reporting this issue. 
Comment 25 Adrian Smith 2007-05-16 14:06:18 UTC
Ross - can we narrow this down - can you confirm this is for an install after a full uninstall?  What happens to the language, is the one set carried over to the server.  Do you see this on XP but not on Vista?
Comment 26 Chris Owens 2007-05-16 14:23:35 UTC
Also happens when installing on a clean image that's never had slimserver installed before.
Comment 27 Chris Owens 2007-05-16 14:45:40 UTC
I was asked if the install-time language setting is propagated to the server, correctly, and it is.  That is, if I select Spanish at install time, Slimserver launches with Spanish preselected after install.
Comment 28 Ross Levine 2007-05-16 17:00:58 UTC
Fixed again in change 12033, thanks Dean and Triode!
Comment 29 Chris Owens 2007-05-22 12:10:23 UTC
Fixed in 6.5.2, which is now released and available for download at http://www.slimdevices.com/su_downloads.html

If you're still experiencing this bug, please re-open it!