|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Nov 27, 2006 11:01 pm
Anyone know how programs are *supposed* to install? |
OK, I might as well post this because it was something I was supposed to work on today before my power supply problems, so maybe someone else has a link or explaination that will help me save time.
I'm trying to change the installer so that you can specify where you want your CMUD "data files" (MUD sessions) stored.
As background for people who were not involved in this previous discussion, the problem with the current method of putting everything within the CMUD install directory is that if the user installs to the default "Program Files" and then tries to run CMUD as a regular (non-admin) user, they don't have write access to Program Files/CMUD, so they can't save their sessions, ini files, etc.
The "correct" way of doing this (well, the "Microsoft" way) is to put the EXE files in "Program Files/CMUD" and then put the data files, preferences, etc, somewhere in the "Documents and Settings/Username..." directory. In particular, most games that are adding compatibility for Vista are putting preferences into "My Documents/My Games/NameOfGame".
So, the CMUD installer should make "My Documents/My Games/MUDs" the default location for your user datafiles (sessions, packages, etc).
OK, no problem...I've already done most of the work for this. The problem is that when you are running the installer, you are running as Admin (so that the copy protection gets installed correctly and so you have write access to Program Files). So the "My Documents" folder points to the documents for the *admin* user, not the user who will eventually run CMUD.
But I've never seen any program ask for the username to install for. I only see it ask "Install for all users" vs "Install for current user". So if I ask this same question and they select "Install for all users", then what am I supposed to do? Seems silly to automatically create the "My Documents/My Games/MUDs" for each and every user. And while I see a "All Users" area in "Documents and Settings", I don't want to use the Application Data directories because they are evil hidden directories that would cause people to think they have lost their session data.
One idea I had was to just set a registry entry in the installer and then wait until the actual user runs CMUD for the first time. When it runs the first time, it can check the individual user's My Documents folder and if the My Games/MUDs directory doesn't exist, then it could be created and the default files could be copied from some "default" area within the Program Files installation.
But it seems like there must be a description somewhere of how all of this is *supposed* to work. I want it to be Vista compatible, but still work for Windows XP users.
I'm going to go ahead with doing the test when CMUD runs the first time, but feel free to post any information you have on this if this isn't what I should be doing. |
|
|
|
slicertool Magician
Joined: 09 Oct 2003 Posts: 459 Location: USA
|
Posted: Mon Nov 27, 2006 11:08 pm |
Install for all users I believe puts the application registry settings for local machine instead of current user. When a user runs CMud for the first time, CMud should (this is just the ramblings of a geek and not advice that should be taken without consulting a sane person) check if that user has any mud files created... if not, then it creates the directory for them in their my documents folder. Otherwise, if a user has never run CMud, they should never have any folder in my documents for muds.
The short version is.... the 'for all users' is, I believe, a question regarding the location of the registry values... local machine for all users and current user for, well, the current user.
All of the stuff I do is current user only, so I'm not sure.
Edit: Oh, and Install for all users puts the icons in the programs folder for All Users instead of current user too. |
|
|
|
bortaS Magician
Joined: 10 Oct 2000 Posts: 320 Location: Springville, UT
|
|
_________________ bortaS
~~ Crusty Klingon Programmer ~~ |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Tue Nov 28, 2006 6:11 am |
Slicertools suggestion is a solid one. It's actually exactly what I would have reccomended (although I'm not exactly qualified as sane either.)
|
|
_________________ Asati di tempari! |
|
|
|
The Raven Magician
Joined: 13 Oct 2000 Posts: 463
|
Posted: Tue Nov 28, 2006 5:48 pm |
Second what slicertool said. CMUD should not create any data directories until it is run for the first time... they should not be created on installation. If CMUD is installed for 'all users' the registry entries (for stuff like 'am I registered') go into Local Machine... but since you use INI files rather than registry entries, then the difference would be where you put the INI file I guess... in /Windows, or in some user-writable area.
The first time CMUD is run for a particular user, CMUD should check the CurrentUser section of the registry for the proper location of the data files... if no entry is there, it should ask the user if they have existing zMUD or CMUD data files they want to use... if they say no, then point the data directory to the Documents & Settings/User/etc default. If they say yes, ask them where those data files are: If the directory they choose is read-only, COPY any CMUD files from the given location to their Documents & Settings. If the directory they choose is writable, then use that as the data directory.
Raven |
|
|
|
ecourt Apprentice
Joined: 29 Dec 2000 Posts: 146 Location: USA
|
Posted: Wed Nov 29, 2006 5:33 pm |
ok -- I'm, not sure if you are after a 'method' or a where should this be saved.
this info should be stored in
hkey_current_USER/software/zuggsoft/zmud
as others said, if this key does not exist, then you should run through a -- where do you want to install your data files screen.
this way each user can specify a different directory for their zmud files, AND zmud only has to call one key.
I think all I did was echo what was above, but hope it helped |
|
|
|
Rainchild Wizard
Joined: 10 Oct 2000 Posts: 1551 Location: Australia
|
Posted: Wed Nov 29, 2006 9:15 pm |
I think the rule of thumb is to create the datafiles on first run of the application -- like when you start up MS Office as a new user it says "Preparing to run MS Office" or some such, and initializes a bunch of stuff for your new user.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Nov 29, 2006 10:19 pm |
OK, I've got it working like this now.
When installing, it now has some radio buttons to specify the datafile location:
1) My Documents\My Games\MUDs
2) Same folder as program files
3) Other
and next to Other is a directory selection box. The only problem with the way NSIS works (and this custom form uses their InstallOptions plugin), is that when you select a directory from the selection box, the "Other" radio button is not selected. There doesn't seem to be any hook for the DirRequest control to do this. So, the way the installer works is that it first checks the contents of the Other directory field and if it has a value, then that overrides the radio button. Otherwise if the radio button is (1) then is saves "%DOCUMENTS" in the registry, and if (2) is selected it saves "%EXEPATH" to the registry.
During installation, the various default installer session files are saved to a subfolder called InstallData.
When CMUD runs, it checks this DataDir entry in the registry. If it is %DOCUMENTS, then it is replaced with the current My Documents\My Games\MUDs path based upon the currently running user. If it is %EXEPATH then it is replaced with the path of the current cmud.exe executeable.
Next, it looks in that DataDir folder for the cmudstartup.ini file. If this file is missing then CMUD copies all of the files from the InstallData subfolder of the installer into the actual DataDir folder. Then the normal startup routine runs, which downloads the cmudstartup.ini file, etc.
When the files from InstallData are copied, it does not overwrite any existing files with the same name. So if someone deletes the cmudstartup.ini file, then it doesn't cause any damage or errors.
So I think this all works properly now. It doesn't install any session files until you run CMUD the first time, and it only needs the one additional DataDir registry entry to indicate how CMUD was installed. The quirk with the "Other" radio button not selected automatically is a pretty minor issue.
What this does *not* do is allow each user to specify their own custom location. I need to think more about whether or not I want to allow this. You *can* set your own HKEY_CURRENT_USER/Software/Zuggsoft/CMUD/DataDir key to override the global HKEY_LOCAL_MACHINE key if you want to change the data path for a particular user, but I don't really want to prompt for it because most users should not be changing the path that the Admin choose for the installation. |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Thu Nov 30, 2006 5:35 am |
Could you do a check to see if the user has write rights to the location they chose and give an error if they do not? Or make the limitation that their files must actually exist somewhere inside their documents/user folder. That way if an Administrator wants to delete their user for example it removes any changes the user made through setting up their cMud files.
|
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Nov 30, 2006 7:50 am |
I'm not really sure what you are asking. You must install CMUD as Admin, and Admin will have rights to install anywhere. It's up to the Admin to choose a datafiles location that users have access to. The user doesn't get a choice. As I said, you can set a registry key on a per-user basis if you dont want the session files stored in their My Documents/My Games/Muds area, but that's still up to the Admin to set that registry key.
I'm not going to get really fancy with this. It just isn't worth the time and effort. |
|
|
|
Vitae Enchanter
Joined: 17 Jun 2005 Posts: 673 Location: New York
|
Posted: Thu Nov 30, 2006 3:41 pm |
so, for those of us that use winxp pro with out the whole nonsense of Admin/user (such as i) won't have the option to just NOT have settings in the cmud dir & mud subfolders as it is in zmud? Confused about this.
|
|
|
|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Thu Nov 30, 2006 4:16 pm |
The difference for you is that now you will be able to choose where your settings are instead of being more or less forced into having them in the same location as the program EXE.
|
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Thu Nov 30, 2006 5:07 pm |
Quote: |
so, for those of us that use winxp pro with out the whole nonsense of Admin/user |
You're not using it without the nonsense of Admin/user - it's probably that you're just an admin user anyway.
Zugg doesn't mean you'll have to use the user 'Administrator' just any user with administrative rights, which will include the standard XP Home/Pro user where on first install it asks for your name and then makes you a user with that name.
You'll be able to have them inside My Docs\Games or keep them inside Program Files\CMUD |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Nov 30, 2006 6:17 pm |
Vitae: Did you read my post above? Option (2) is the same as how CMUD/zMUD have worked in the past. So select that option when you install and it will all work the way it always has with the session files stored in the same location as the EXE file.
|
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Thu Nov 30, 2006 7:39 pm |
I'll try again. Could you make it so that An administrator, not nessisarily the one who first installed the program, gets a button that changes this key for their own user? Instead of us having to hunt down this key in the registry to change it?
And, I think Vitae means he wants to do what I used to do with Zmud. I would just browse to the folder I wanted to save my mud session folders in and place them there irregardless of where Zmud thought it wanted its data files. This would be a folder outside of the cMud program folder altogether. When I tried this with cMud I got errors and crashes. Apon reporting it you told me that cMud just doesn't work that way so I stopped doing it.
Yes Zmud would come back with an error when I pointed it outside of the program folder but it would afterwards let me do what I wanted. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu Nov 30, 2006 9:02 pm |
It seems that you're allowed to do that, Arminas - that's what the "other" option's for.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Nov 30, 2006 11:52 pm |
Fang is correct...that's what option (3) is for. But you only get to change it via the interactive prompt during the installer. If you want to change it later, either run the installer again, or track down the registry key.
So Arminas, the answer is that you can do this, but No, you would still have to hunt down the registry key. Like I said, I'm not going to spend hours upon hours trying to accomodate every obscure installation method that people might want that is only going to be used by a handful of people. I've got much more important stuff to be fixing right now. Add it to the wish-list for some future version. |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Fri Dec 01, 2006 12:04 am |
That's cool. My question is answered. I would much rather other things be fixed. Just tossing ideas and questions in the wind.
|
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Fri Dec 01, 2006 11:18 am |
Zugg, just to make you aware now that Vista's out
I installed it on my laptop today, and a few folder names have changed
'Documents and Settings' is now 'Users'
The 'My' prefix has been dropped on most things
Everything is no longer inside Documents. There is Documents, Pictures etc at the same level.
See screenshot
On the up side, Vista does look pretty, and when you get it free from work then who cares whether it's value for money or not ;) |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Dec 01, 2006 6:16 pm |
We have a free upgrade coupon from Dell for Chiara's laptop, so that will be my Vista test system here. But did it officially get released to the public? I didn't think it was being released until January?
I knew about them dropping the "My" prefix. CMUD doesn't actually hard code this. It uses a system API called SHGetSpecialFolderLocation with an argument of "5" for the My Documents folder. So as long as this API routines the path to the new "Documents" directory, then I should be fine.
I'm not sure why they moved Pictures, etc outside of Documents. That seems to reverse the purpose of My Documents in the first place (keeping all User data in one place). I wish Microsoft would actually decide what they are trying to do and stick with it. Geez...unix has had this problem solved for decades, I don't know why Microsoft keeps struggling with it.
In any case, I don't know what you are able to do on your work system, but I'd be interesting in knowing if games are still getting installed into "Document/My Gamnes". I know that Civilization IV puts settings into My Games. The "My Games/MUDs" part *is* currently hard coded when install option (2) is selected, so that might make a difference.
Within the new "Users" area, is there still the same "Application Data", "Local Settings", etc? And are these folders still hidden by default?
In any case, I probably won't do anything specific for Vista for the first public release. I plan to wait until after the holidays, then install Vista on Chiara's laptop and then start playing with it and see how it works. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri Dec 01, 2006 6:18 pm |
It was always intended to be available to companies this month I think. Remember reading that somewhere. It's still not available to the public until the new year.
EDIT: I'm told it's RC1 that's available to companies now, anyway. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Dec 01, 2006 6:34 pm |
Ah, OK, that makes sense. It's probably companies with MSDN subscriptions or support contracts. Well, I won't be getting it until it's released to the public, so you can hold off on any Vista problems till then.
My sympathies to anyone working as a IT support tech who has to spend their holiday doing Vista migration for their company. |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Fri Dec 01, 2006 6:48 pm |
The proper version has been released to companies and those with MSDN subscriptions. RC1 is long gone, RC2 passed too. We're onto the official final releases.
Seems like more has changed than I first mentioned
There's an AppData folder now, within it is a 'Roaming' and 'Local' folder, where the old 'Application Data' and 'Local Settings' point to. Something called a Junction, I guess it's a type of shortcut
Looks like they've removed the spaces from the directory names, and tried to shorten them where possible. Probably a good thing
Anyway, rather than me explaining, I've attached a full view of folders with the attributes shown and a directory listing in cmd prompt
Code: |
Directory of C:\Users\Duncan
01/12/2006 17:01 <DIR> .
01/12/2006 17:01 <DIR> ..
01/12/2006 10:59 <DIR> AppData
01/12/2006 10:59 <JUNCTION> Application Data [C:\Users\Duncan\AppData\Roaming]
01/12/2006 10:59 <DIR> Contacts
01/12/2006 10:59 <JUNCTION> Cookies [C:\Users\Duncan\AppData\Roaming\Microsoft\Windows\Cookies]
01/12/2006 17:56 <DIR> Desktop
01/12/2006 17:43 <DIR> Documents
01/12/2006 17:46 <DIR> Downloads
01/12/2006 11:31 <DIR> Favorites
01/12/2006 10:59 <DIR> Links
01/12/2006 10:59 <JUNCTION> Local Settings [C:\Users\Duncan\AppData\Local]
01/12/2006 10:59 <DIR> Music
01/12/2006 10:59 <JUNCTION> My Documents [C:\Users\Duncan\Documents]
01/12/2006 10:59 <JUNCTION> NetHood [C:\Users\Duncan\AppData\Roaming\Microsoft\Windows\Network Shortcuts]
01/12/2006 11:14 <DIR> Pictures
01/12/2006 10:59 <JUNCTION> PrintHood [C:\Users\Duncan\AppData\Roaming\Microsoft\Windows\Printer Shortcuts]
01/12/2006 10:59 <JUNCTION> Recent [C:\Users\Duncan\AppData\Roaming\Microsoft\Windows\Recent]
01/12/2006 18:16 <DIR> Saved Games
01/12/2006 10:59 <DIR> Searches
01/12/2006 10:59 <JUNCTION> SendTo [C:\Users\Duncan\AppData\Roaming\Microsoft\Windows\SendTo]
01/12/2006 10:59 <JUNCTION> Start Menu [C:\Users\Duncan\AppData\Roaming\Microsoft\Windows\Start Menu]
01/12/2006 10:59 <JUNCTION> Templates [C:\Users\Duncan\AppData\Roaming\Microsoft\Windows\Templates]
01/12/2006 10:59 <DIR> Videos
0 File(s) 0 bytes |
|
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Fri Dec 01, 2006 6:49 pm |
Would be pretty surprised if anyone does any Vista migrations over the xmas holidays. It's a very brave or very stupid (or heavily subsidised by Microsoft) IT department that rolls out software that's a month old ;)
|
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
Vitae Enchanter
Joined: 17 Jun 2005 Posts: 673 Location: New York
|
Posted: Fri Dec 01, 2006 7:24 pm |
Zugg wrote: |
Vitae: Did you read my post above? Option (2) is the same as how CMUD/zMUD have worked in the past. So select that option when you install and it will all work the way it always has with the session files stored in the same location as the EXE file. |
whoops. didn't see that sorry.
Of course then the folders for each mud are in there and the .mud files are in the mud folders of course right? |
|
|
|
|
|