View Full Version : A Civ3 Mod Installer/Manager by KingJoshi


kingjoshi
Jun 08, 2002, 09:05 PM
This is the thread for the Civ3 Mod Manager by KingJoshi. It's has many features and the updates have made this post pretty long, so I'm summarizing at the top.

This program copies all files and subdirectories from one folder to another. Any file that is about to be overwritten is backed up. A list is kept track of all the mods installed. you can view changes by any single mod or multiple mods. You can compare compatibility of mods. And more!

*Important note. Since this program only copies one folder to another, minor work might have to be done to set up a mod. There is an example in the README.TXT that clearly explains what to do. Basically, you just have to set up the same folder structure with the mod that's in the Civ3 directory for the files you're about to copy.

-----------------------------------------

UPDATED: a *serious bug* in the program occurs if you backup a mod within the source directory. Since the program tries to copy the whole directory, as you put the backup files to it, it copies them to the Civ3 directory. And somehow a loop continues infinitely. So use a different backup location than the source directory or subdirectory!

UPDATED: v0.4 - Added a feature by request. The program creates a list of the files in the Civ3 directory when it's first run so you can view which files are missing or have been replaced.

UPDATED: v0.3.2 - Fixed a simple feature. When you double click on any file in the listboxes, the default program opens it.

UPDATED: v0.3.1 - Added one simple feature. When you double click on any file in the listboxes, the default program opens it.

UPDATED: version 0.3 is here. A LOT OF IMPROVEMENTS! you can download it at the bottom of this post. You can see a screenshot below.

v0.3 *IMPORTANT*
**- Instead of "Setup.ini" the program now uses "ModManger.ini". This file stores some directory information and locations of all mods installed. The file is read in as records so each line MUST HAVE 78 characters and then the CARRIAGE RETURN and LINE FEED. The "UnInstall.log" file has not been changed, so it is SIMPLE to get your previous mod installations (by a previous version of this program) to be recognized.

When you start the program, it'll ask for the "ModManager.ini" location. Since this is the first time you're running it, it shouldn't exist yet. Choose the folder location where this program is stored. The file will be created and the program will start.

To import your previous installations, find their directory and store them in the textboxes. When you close the application, the textboxes are saved in the "ModManager.ini" file. Then, open "ModManager.ini" and copy the location of the mod and paste it at the end of the file. *You need to copy the newline character as well.* The easiest way to do this is to get the cursor at the beginning of the line, Hold SHIFT, and then press down. The whole line should be highlight and you can copy and then past at the end of the file.

- I got all my ideas for this release from Neale Lonslow's Civ3ModLdr. It's another Civ3 Mod Manager, but when I tried it, it didn't work. The files weren't backed up, so when attempting to uninstall a mod, the files would just be missing and you couldn't play the game. He is going to fix this. If it works for you, that's great. His program seems to have a better interface and more features. However, as of now, mine works for me at least You can find it at, http://mumbalicious.8m.com/
- The program got a face lift and many additions. Unfortunately, the interface doesn't look any prettier and probably worse, but works well. And to me, at this moment, that's what counts. But I'm open to suggestions on how to improve it.
- Added a listbox that displays the current installed mods. Anytime a mod is clicked, the path to it's backups is displayed in the third textbox.
- Added a command button called "Only Installed Mods" that checks the mod source location and sees if the files in the subdirectory conflict with any mods currently installed.
- Added a command button called "Mods & Civ3" that checks the mod source location and sees what current files needs backing up
- Improved the Installation phase with better error checks. Also, the FreeDiskSpace check is now accurate and calculates the total size needed for both backups and the mod and compares against the free drive space.
- For "Validate Mod", not only are the valid files (those still installed) written to a file called "Validfiles.log", they are displayed in a listbox. And invalid files (mod files that have been overwritten or are missing) are written to a file called "Invalidfiles.log" and also displayed in a separate listbox.
- Added a command button called "View Files Backed Up By A Mod" that takes the path in the third textbox and reads the "UnInstall.log" file and displays what files are currently backed up. No checking is done to see if those files are still actually backed up, only the log file is checked.
- Added a command button called "List Files For Installed Mod" that takes the path in the third textbox and reads the "UnInstall.log" file and displays what files are supposed to be with the mod. No checking is done with the current setup, for that, use "Validate Mod"
- Added a command button called "Check Compatibility of Installed Mod" that takes the path from the third textbox and reads the "UnInstall.log" file. All files that are in conflict with any other installed mod will be displayed in one listbox. All the other files will be displayed in another. This differs from "Validate Mod" because you could have overwritten several files from one mod and "Validate Mod" would not show that.
- Added a command button called "Compare Multiple Installed Mods" that requires 2 or more selected mods in the "Installed Mods" listbox. Any files that the selected mods are in conflict with will be displayed in a listbox.
- "Uninstall Mod" has been improved and refined.
- Added a command button called "Help" that displays this file. It goes to the same directory as the program/"ModManager.ini" file and opens "Readme.txt" with the default text editor. If this file is not in the directory, then nothing happens.

v0.2 - Added a Validation button. This allows the user to enter the location of a mod in the third textbox and then to see if the files are still installed or if they were overwritten by another mod.
- Added a LOT of error checking. Checks for errors against most system calls. They're handled much better, but hopefully, I didn't introduce new errors while implementing the system. They seem fine so far. They should make installations and uninstallations easier because they interpret the error messages from Windows better instead of making a blanket assumption or no assumption and quiting.
- The program now checks for free space. However, it's quite rudimentary. It calculates the space needed by the mod and checks to see if the drive where Civ3 is installed has that much free space. It also checks the mod folder where there is supposed to be the back up. I do not calculate the space needed for the backup so I just assume it'll be the same as for the mod. It's a bad assumption, but easy to make and will do for the current version. If the backup drive and Civ3 drive are the same, then there must be twice as much space as the size of the mod. However, the final decision is left up to the User as to whether to continue with the installtion.
- I did not realize that by introducing the ProgressBar, I made MSCOMCTL.OCX a requirement. I removed progress bar and just show percentage completed and update that.
- I have decided to not deal with zip files because I do not want to bring other dll files or such the mix. This program is simple and shall stay that way unless people request otherwise, but since I haven't received even one request, I don't expect any :(

Updated: Added a progress bar in v0.1.2 (no other improvements, nor bug fixes or anything)

The Civ3 Mod Manager by wiwi didn't work for me, so being stupid, instead of an email, I decided to write my own. I mean this as no offense to wiwi, but I like to program, so it was a challenge for myself as well.

The program takes a mod and copies the files to the Civ3 directory and subdirectories. All files that are supposed to be overwritten are backed up. An "UnInstall.log" file is written which allows for the restoration fo the original files. I've tested it on Womok's Terrain, Dixon Wonders, and DYP mod.

It can be used as an installer by anyone creating a mod. Anyone is welcome to add this small program with their mod so people can easily install/uninstall their mod. More suggestions and directions are in the Readme.

This program does not work straight out of the box for any mod that I know of. I wanted to created a flexible design that also allows the backup of other things besides mods for Civ3. However, to get the mods to work is VERY SIMPLE and outlined in the readme file.

The program was done in Visual Basic 6.0 and if anyone wants the source, let me know. PLEASE post questions, comments, complaints, suggestions, etc. I spent a day on this so far, so I know I need to do more error checking and will be continuing to update the program, so I welcome ideas. But it works currently. But since copying whole directories to another is a powerful computer feature, becareful not to copy one drive to another :)

Attachment: modmanager v0.3.2.zip
removed after 141 downloads

kingjoshi
Jun 10, 2002, 04:21 AM
I see some people have downloaded the program. Has anyone been able to run the program? Use it? Had problems starting it? I would appreciate any feedback. Thanks.

kring
Jun 11, 2002, 12:00 AM
I will download it later. since I need sleep soon. It sounds interesting.

wiwi28130
Jun 11, 2002, 05:23 AM
No offense :goodjob:

Must say that i am quite disappointing because ain't got a lot of feedback...

I think I will, for this reason, stop my modmanager experience...
If you want my sources, no pbs...

I am currently working on Morrowind plugin/Mod and a website.

kingjoshi
Jun 12, 2002, 08:58 PM
Hey wiwi,

yeah, I would love to look at your source code. It seems you used Access database, which seems like it would allow for a lot more possibilities, but also harder to program for. Could you please email that to me at kiran@joshi.com? Thanks.

PyroManiac
Jun 14, 2002, 08:58 AM
Very nice! Wiwi's modmanager didn't properly install the WW2 mod files so I deleted it. But your's Kingjoshi works without a hitch, it is very simple to use. I like it!

wiwi28130
Jun 15, 2002, 10:45 AM
If you told me this fact, I could have done something....

It's really a pity..............

kingjoshi
Jun 15, 2002, 02:46 PM
PyroManiac: Thanks for the comments. It's nice to hear someone used it and liked it.

Wiwi: I know what you mean. I feel bad that I didn't let you know the program didn't work for me because feedback is so important for any program. I'm sure some people have used my program and it might not work for them but I won't know it and won't be able to fix it so they will be able to use it.

PyroManiac
Jun 17, 2002, 09:02 PM
Sorry bout that Wiwi, but I wasn't registered at the time. Anyways Kingjoshi, when I tried to install the WW2 mod because it was giving me random errors, ur mod manager didn't work. It deleted all the files from the backup directory, and from the units folder also. It also gave no log, so I don't know what happened. I had to reinstall CIV3 but that's ok.

kingjoshi
Jul 05, 2002, 05:44 PM
Sorry for the late reply Pyro. You seemed fine about it and I don't know what I can do about it so I didn't reply. Well, just incase you read this, sorry my program messed up your installation. I'll try it with the ww2 mod and see what happens.

For others out there with success, please post so I know that some people have used it with success ;)

kingjoshi
Jul 05, 2002, 05:45 PM
screenshot of v0.3

kingjoshi
Jul 05, 2002, 06:16 PM
Pyro,

I tried a WW2 mod, version 3.0 by Grey Fox.

It worked fine. I did try this with v0.3 of my program, so I don't know if a previous version was at fault. I was able to start a scenario, play and uninstall without a hitch.

PyroManiac
Jul 13, 2002, 12:02 PM
Yea thats all right King Joski, I tried it with version .3 and it works so it's all good now:) Very nice btw now. Organized and stuff, highly recommend! :goodjob:

kingjoshi
Jul 13, 2002, 01:49 PM
Thanks PyroManiac, it's feels good to get feedback. ANY FEEDBACK IS MUCH APPRECIATED, but obviously, positive ones make me feel better :)

I made the name for the buttons long for a few reasons: self explanatory, take up space, couldn't think of anything better. So any ideas on improvement to the names or any interface issue would be appreciated.

I learned how to implement the "Browse for Folder" feature but I got used to the arrow buttons and found it more useful than a separate browse dialog box.

I'm thinking a "Right-Click" feature could come in handy (whether you click on a file or a mod) but I don't know what options to put on the menu-list that would come up. Currently, I don't know how to even do that (Since I've only taken once course in VB and am not experienced) but I'd learn it.

I think a Restore to Original Civ3 would be another good button and was wondering if anyone else would like that option. I have a couple of ideas on how to implement that.

Any feature request is also welcome. Though I can't assure everyone that everything will get implemented, I do promise to consider any request and give reasons for why not to implement something if I decide not to.

brab
Jul 23, 2002, 02:52 PM
I've just tried it to install Double Your Pleasure, and it worked perfectly out of the box.

Thanks :goodjob:

kingjoshi
Jul 23, 2002, 02:56 PM
My pleasure :) Since I speak at the DYP thread regularly, Isak was nice enough to setup the DYP mod so no changes had to be made for the user. What a nice guy! :)

Thanks for the comment.

CivAgamemnon
Jul 24, 2002, 07:03 AM
I just downloaded this, and am downloading DyP right now, and see if I get the hang of this thing. I haven't added any mods but various graphic mods, so I'm assuming this won't be a problem. I'm new to doing this, so hopefully it'll be easy. I hope. (nervous chuckle). Thank you for your hard work, KingJoshi- it is appreicated.

kingjoshi
Jul 24, 2002, 07:08 AM
My pleasure. The DYP mod shouldn't be a problem since you don't have to make any adjustments.

I appreciate the 100+ downloads from everyone. But I thought more than 100 people could use this program. Well, let's hope that more people like my next program...

CivAgamemnon
Jul 24, 2002, 07:19 AM
I may be dumb, but I want to make sure I got this right- Run the mod program and browse to where DyP is and click on install mod. Am I right? I just don't want to screw things up here.

kingjoshi
Jul 24, 2002, 07:24 AM
that should do it, but only because the DYP mod is setup up that way. What the program does is copy the source folder to the Civ3 folder. If the modder set up the file structure just like the Civ3 directory, then everything is good to go, like for DYP. for the other mods (graphics, units, other mods) you probably have to set up the folder structure. It's explained in the readme with an example if you want clarification.

CivAgamemnon
Jul 24, 2002, 07:32 AM
Ok, thank you! :-)

CivAgamemnon
Jul 24, 2002, 08:41 AM
It worked very nicely, once I figured out the mod backup directory location. Thanks!

CivAgamemnon
Jul 25, 2002, 06:39 AM
KingJoshi,

A feature you might want to consider adding is a way for Civ3 to check itself and see what files have been modified from the original files.

I uninstalled DyP (since it's not quite complete- I prefer complete Civilopedia info, there isn't much there- I want to know what does what before I build it), and went back to what I had just before I installed DyP. Worked like a charm.

I'm just curious if there was a way to indentify which files had been changed from the original?

kingjoshi
Jul 25, 2002, 08:08 AM
DJ54,

One possibility is to have a list of files in the Civ3 directory the first time it is run (but that doesn't ensure that they are the orginals).

Another would be to install a clean copy of Civ3 and then see what files are there and put that list in a file and attach that with the program (I could have different lists for v1.21f, v1.29f, or just the latest). Then, just compare that list with what's in the user's Civ3 directory.

I'm inclined to the first method (though it doesn't ensure originals) because I don't want to attach to other files with the program unless necessary. But I might setup the program to handle both.

What would you prefer if I only chose one method? Give me a little time on the program just because I'm working on another program for Civ3.

By the way, there is an excel file you can use that is the complete reference guide for the DYP mod. It has all the information you need, and if anything is different in the game from the excel file (which is rate), then that is mistake you can inform us about. If you don't have MS Excel, we can also give you the reference in HTML or text even.

CivAgamemnon
Jul 25, 2002, 09:08 AM
KJ, I think the first method would be terrific- sorta like an "index" of what is there the first time the program is run, with the caveat that if it isn't a clean install with no modifications, all you will get is what is there the first time you run the program. It would be a baseline to work against.

No big rush, just a thought that may help- it may even help modmakers who want to "mix and match" elements from different mods to create a new one with some additions of their own.

I do not have Excel, I would like an HTML or text copy of the data, then I can go from there. As I told Isak before, I'd be willing to help with the civilopedia if he wanted. I'm thinking of doing another install of Civ3 as a "clean install" and then installing the DyP to that instead of the one I have now- I'm rather attached to those graphic mods I have installed :lol:

kingjoshi
Jul 25, 2002, 09:55 AM
I take that back. here's the link to the DYP v0.77 html reference (http://forums.civfanatics.com/attachment.php?s=&postid=374299) (it's a zip file). Go to the DYP forum and complain to Isak about the Excel file not being posted for v0.795 :) RobO might be able to post a better looking one.

CivAgamemnon
Jul 25, 2002, 10:01 AM
Thanks, KingJoshi!

kingjoshi
Jul 30, 2002, 11:38 AM
I have added the feature you asked for. It was a minor addition actually and didn't even take a half hour (writing the readme and editing posts, ugh, that I can't do well).

However, it only displays what files from the original have been changed and/or are missing and what files from the original are still valid (since I only have two listboxes). It does not display what files have been added.

I welcome any more suggestions.

CivAgamemnon
Jul 30, 2002, 11:50 AM
Thank you, thank you, thank you!

Rory_20_uk
Aug 02, 2002, 03:01 AM
I've no idea how many times you util has been downloaded, but after reading the whole thread I have to say that I'm going to get it this evening! I as wondering how to have several mods without them causing severe damage to the origional game or each other, and this seems to fix it quite nicely.
The speed of the feedback support that you offer isalso a big incentive to try it, as if there is not a feature today, there might well be tomorrow :)

kingjoshi
Aug 02, 2002, 03:13 AM
well, good customer service is important :) and if you have ideas, let me know. I just shared my source code to someone else who might implement compression of the backup files, so we'll see about that.

The rest of the post is useless statistics based upon memory (so give or take a few):

The first version was downloaded 27 times before I updated it.

V0.1.2 was downloaded 83 times

v0.2 was never released to the public. (I made a improvements to the program, and as I was writing the readme, I thought of more stuff to add :) )

I can't recall how many times v0.3 and v0.3.1 was downloaded. :(

And the first post mentions how many times v0.3.2 and the current version has been downloaded.

I would post those numbers in the first post, but I can't be certain of them. It's probably in that vicinity though.

disorganizer
Aug 06, 2002, 04:46 AM
how do you check which files are original? by a crc-check?
if yes, it should be optional to rebuild the index with the files installed (kind of baselining) or to use a predefined index-file.
possible solution:
put the index in a file and have it re-generated with the files on a press of a button (or maybe put a generation utility in the package for it).
having a utility to generate the file-index for the original installation will enable non-english users to also use this feature, and maybe they even post their indexes somewhere so others can use them (by exchanging the file).

kingjoshi
Aug 06, 2002, 05:56 AM
The file that lists the "originals" only lists all the files in the Civ3 directory (and subdirectories) that are there when the Mod Manager is first run. Currently, the only way to restore back to the "original" is to uninstall all the mods in reverse order. Doing any more makes the program much more complicated than it needs to be.

If you do a basic installation in the default directory (which I do not), then run this Mod Manager, the list of "Originals" will contain the list of files installed by Civ3 with the exact location of the file and the time/date stamp. That file should be the same for everyone that uses that local version of Civ3 and you can distribute that list. But since the backup files are not distributed with it, other people will only be able to tell what files are changed from the original and not be able to restore them except to what they originally had through uninstallation of all their mods through the program.

If you have any more suggestions or questions, feel free to let me know.

disorganizer
Aug 06, 2002, 03:58 PM
bug report:
system: windows xp, 9gb free discspace, civ3 1.29f
before installation the mod-installer says "0bytes free". well, there is enough space (more than enough) and the installation of the mod works anyways. propably just an overflow of the variable holding the free space?

"bug" report:
when you enter a backup path beneath you mod-path, you get an endless recursive backup-directory resulting in a modded civ3 without any backed-up files.
example: mod directory is c:\xyz, backup dir is c:\xyz\backup
maybe you should check for the mod path being part of the backup path and issue a warning

feature request:
maybe you could also implement "versioning" by setting a standard on how version-numbers should be given to mods (like having a textfile with a standard name with the version in a standardized form in it) to show the version of the installed mod?

kingjoshi
Aug 06, 2002, 04:15 PM
Thanks for the bug info. I'll check those out.

I thought I had done something about the second bug you mentioned, but I guess not :( I know of some other problems I should probably also post, such as having the shortcut in one hard drive and the program in another. Then, every time you start the program, it asks for the location of the ModManager.ini file.

The version idea is interesting. Seems like a good way to update a mod installation instead of uninstalling and reinstalling.

Unfortunately, I'm getting busy and will be more soon as I move and start graduate school in a week. So I don't know when the updates will occur :(

Chieftess
Aug 06, 2002, 05:15 PM
Whoa, big bug. :)

My mod is in the directory: "c:\civ3\modfiles\Balancer\"
(the directory in quotes is what I used). I also used the defualt Civ3 directory (c:\progra~1\....).

Ok, I clicked the "Validate Mod", which said not valid (I had it zipped, and unzipped in the same directory). I clicked show compatible mods, and it listed that mod. So, I started installing it, and after a few "There's an error writing the uninstall.log file", I noticed it started going up to 126% (and higher!). Then it gave the same error, except this time, there was a backup directory, about 15 of them!!!.

Chieftess
Aug 06, 2002, 05:16 PM
Mod report; The mod won't work. I have 1.29f installed... oh well...


EDIT: Uninstall attempt resulted in a "Problem deleting mod folder" error.

kingjoshi
Aug 06, 2002, 07:43 PM
ahh! sorry for the bugs guys. I'll try to fix the bugs.

In VB, the largest number is a long (AFAIK), which is 4,294,967,295 bytes. Most hard drives have more space than that so I have to do something else I guess. I guess, as long as the mod you're installing isn't greater than 4 GB, then I can keep using the long.

Chieftess,

You said the Civ3 directory was the default and the source was "c:\civ3\modfiles\Balancer\", what was the mod backup location?

I think this is the same bug that disorganizer just reported about the recursive problem. I should check for that and not allow the backup location to be the a subdirectory of the source.

If that's the problem, it shouldn't be hard to fix. Though my carelessness as a programmer caused some other people some headaches. sorry :(

Chieftess
Aug 06, 2002, 08:15 PM
I had c:\civ3\modfiles\Balancer\backup

kingjoshi
Aug 06, 2002, 08:21 PM
Yeah, that makes sense. Since the program tries to copy the whole directory, as you put the backup files to it, it copies them to the Civ3 directory. And somehow a loop continues infinitely. Maybe I should make a list of the files to copy first, and then start the process and only copy those files. Instead, I use a dynamic process that loops, though I don't completely understand why yet.

So, as long as the backup location is not the source directory or subdirectory of the source lcoation, the program still seems to work fine.

By the way, thanks for the quick reply! :)

Chieftess
Aug 06, 2002, 08:26 PM
Originally posted by kingjoshi
By the way, thanks for the quick reply! :)

You're welcome. ;)

disorganizer
Aug 07, 2002, 01:08 AM
ct:
use c:\civ3\modfiles\Balancer-backup as backup directory and it works fine ;-)

vulchor
Mar 16, 2007, 04:50 AM
Just wondering how this works with the Conquests expansion. Alot of the mods require Conquests to play. Don't know if you still work on this program alot, but it'd be nice to know.