Getting around launch as Admin for mergers

phungus420

Deity
Joined
Mar 1, 2003
Messages
6,296
We all know about the problem with Vista and being in the Program files directory. Now there must be a way around this, while still installing the main mod in program files instead of my documents (MP is not supported from My Documents, also I've found some users just can't play big mods from that path, so it's not a viable solution). Many of the big mods (mostly built around a RevDCM core) that use BUG now have installers that can be set up by the mod maker. So we should be able to get around this issue, mainly the ini files being in the Program files directory. Civ itself puts it's main ini file in the My documents path, which it then references. Is there some way to do this with mods? Couldn't we set it up so that the installer puts the User Settings folder in the My Documents path, and then somehow get the mod to reference and write to these files, instead of putting this folder in the main mod's directory? If this is possible, how would we go about doing it?
 
It's totally possible. The main difficulty is that BUG looks for a single Data folder by looking for the UserSettings folder and assuming it is its parent. The Data folder also contains the Info folder (help, readme, changelog, etc).

Even if I split out the UserSettings folder and have BUG create it and all of the INI files, that doesn't address the Customizable Domestic Advisor's settings file nor the Advanced Unit Naming's Advanced INI file. These cannot be created by the mod upon startup.

If people are using install scripts we can install these settings files to the My Documents folder. Another option is to copy them if they aren't found.
 
If people are using install scripts we can install these settings files to the My Documents folder. Another option is to copy them if they aren't found.
This would be perfect. At least I know davidallen would use the functionality for Dune Wars, and I'd set it up for LoR. I also assume Avain would do the same for Quote Capita. What exactly do I need to do to have the BUG components read their associative ini files in the User Settings folder from a different directory (and also this directory needs to be variable, as it would be set to the user's computer for installation, but we can have NSIS write this path in a python file on installation, so this part shouldn't be too hard)?

So we are on the same page here, what I am envisioning is this setup:

1)User Settings folder held in seperate spot from the main mod when compiling the install script so it is added in a similar way as an add on (but not optional, it's just a seperate install function, held separately)
2)When the mod installs it reads the registry, installs the main mod files as normal, but also does a registry check for My Documents/.../BtS, and installs the User Settings folder there. On installing there it writes a registry key, like the main install, so that it's path is stored, and the uninstaller can remove it, also the NSIS script will open and write this path to some python file that defines for the BUG components where the User Settings folder is.
 
bumping
 
I have found my way here, thanks for the pointer phungus.

Why is a separate python file needed? BTS can find its way into My Games, because all the logfiles are written there. Also I know some modders have written their own logs into the my games ... logs directory, so the access functions must be available.

If there is something I can do to help on this problem, please let me know. It is now the #1 reported issue for Dune Wars, and I am afraid many users just give up without even reporting it.
 
I have suggested the workaround of going to your My Games\Beyond The Sword folder and creating a folder called "BUG Mod", and then inside that folder creating a folder called "UserSettings". One user has reported this does not help. So we are stuck; each run will require "run as administrator". I have blasted an alert about this into all the places people may download Dune Wars.

You have mentioned that some contributed modules such as Customizable Domestic Advisor and Advanced Unit Naming may make the problem worse. Do you think if we rip out these optional modules, then the workaround would work? If so, how should I do that?
 
See my post in the other thread. You must name the first folder using the modName you specified in CvModName.
 
There are a lot of sub-threads mixed on the bug reporting thread. Let's stay here.

I have reported a crash due to the theme file in WOC modules/interface. Keldath has fixed this for Dune Wars. I don't understand quite enough about how WOC does modules, but he deleted the modules/interface directory and moved a bunch of the files into Dune Wars/Resource. Anyway, using my XP read-only test harness, I verify that the init xml crash is gone.

We have pretty much decided that DW has two problems while other mods which are WOC-free but use BUG have only one problem. DW's WOC problem now appears fixed, so I need to learn more about the BUG problem.

The solution I understood was to create a directory "My Documents/My Games/Beyond The Sword/Dune Wars/UserSettings". Note there is no space between "User" and "Settings" near the end there.

In the existing DW installation, there are about a dozen ini files such as Dune Wars/Better Espionage.ini, Dune Wars/BUG Main Interface.ini, etc. Also we have Dune Wars/Dune Wars.ini and Dune Wars/Revolutions.ini. I am pretty sure Dune Wars.ini is important for the game operation. RevDCM gets upset if it can't find Revolutions.ini and it puts up a big dialog box when the game starts.

I need to understand when I build my installation, which of these ini files should I delete? Which are critical to leave there? Are there some which the installer will need to copy into the MD/MG/BTS/DW/US directory? If we leave any ini files there, then what happens when the Vista user without write permission, makes a change to a setting via the gui?

I can find 4-5 vista users who have recently complained about the problem, to test the solution. But they are already mad at me because the mod failed and they had to post into the DW sub-forum to find the solution. So I can ask them to try *one* thing. It would be really nice to get all the loose ends ironed out at once before going back with a partial solution.

Specifically what should I do with these various ini files?

EDIT: by experimentation, I have found "something", it is not what I expected. I left only Dune Wars.ini and Revolutions.ini in the top level mod directory, and created MD/MG/BTS/DW/US. When I brought up the game, all the ini files were written into MD/MG/BTS/DW, not in the UserSettings subdirectory. So UserSettings seems un-needed. Is this right? Or is there some installation-dependent reason I may want UserSettings to exist anyway?
 
Any INI settings files managed by BUG will be created with default values the first time BUG starts up. It sounds like you are using an old version of BUG (pre-4.0) that doesn't use the UserSettings folder. If you stick with that version, you don't need the UserSettings folder inside BTS/DW.
 
You need to update Dune Wars RevDCM core to 2.6. This will update the BUG component to 4.1 instead of 3.6. 3.6 did not have a user settings folder; the ini files were just written into the mod's main directory.
 
OK, now I understand. We have tried twice to update the revdcm inside DW, but failed. There are many modifications local to DW, and when we merge, it crashes on the end of the first turn. We have not figured out why.

Fortunately, an installer which creates the UserSettings directory under my games will also obviously create the parent directory, so we are OK.

Is that a very small change to the installer, or does it require some work to do?
 
Is that a very small change to the installer, or does it require some work to do?
It will be somewhat complex. I expect to update the script to do this over the next couple weeks with a lot of help and research. Like last time I made the script, I expect to be referencing BUG's installer (because it does very similar things) and asking help when I f up or get stuck. My goal is to get a working script out for LoR by the 0.9.8 release, so probably a couple of weeks. If you think you can set it up sooner, by all means go ahead, do not let me hold you back.
 
@davidlallen

Lemon Merchant tested it and having a folder of the mod's name ( with a User Settings folder in it) the My Documents path seems to work fine. I was going to use this information and update the installer; but I am no longer sure. The person who does the art for LoR has not posted in almost 2 weeks, that coupled with general inactivity has left me with no real motivation to continue the project. I wol't be updating the installer with new functionality if I quit working on it, which is looking probable at the moment.
 
@davidlallen

Lemon Merchant tested it and having a folder of the mod's name ( with a User Settings folder in it) the My Documents path seems to work fine.

Well, even if LoR won't use it right away, I will use it. Can I motivate you? Perhaps with a personalized copy of the latest DW mod?
 
It will be somewhat complex. I expect to update the script to do this over the next couple weeks with a lot of help and research. Like last time I made the script, I expect to be referencing BUG's installer (because it does very similar things) and asking help when I f up or get stuck. My goal is to get a working script out for LoR by the 0.9.8 release, so probably a couple of weeks. If you think you can set it up sooner, by all means go ahead, do not let me hold you back.

Bump. I am going to release DW 1.7 in the next few weeks. Having a new installer which creates the My Documents/My Games/Beyond The Sword/<modname>/UserSettings directory would be very helpful. I tried looking into the nsi format documentation, but I don't understand enough of it to get started.
 
If you can suggest one or two lines which can be cut/pasted into the installer to create the directory if it doesn't exist, that would be great.
 
I'm going to eventually get around to writing this. But I'm not sure how long it'll take, so you may want to do it yourself davidallen. My problem is that LoR's art guy PMed me stating his computer was fried, and he didn't have money to get another one. That was on Nov12th, and he hasn't logged into civfanatics since. So I don't really know what I should do for my next update to LoR. I pretty much have 0.9.8 done, just need the new installer and art, but without the art, a new update seems kind of pointless, so I haven't figured out how to proceed. Further adding this functionality to the install script, at least done right (so that it'll check for the presence of the BtS ini file, and handle things correctly if not found, etc) is a little over my level in terms of coding knowledge; so I'll have to post here asking for a lot of help.

If you decide to pursue this, please update to the current script; I know Dune Wars uses a very old one. I suggest you use this one for your template:
http://forums.civfanatics.com/downloads.php?do=file&id=12230
Use your source code as an optional add on, and eliminate the second option. Enabling an optional add for for the SDK of Dune Wars should get you more familiure with the script.
Also the current install script was developed in this thread, so browsing it would probably be pretty insightful:
http://forums.civfanatics.com/showthread.php?t=325642
 
@alerum68

Kind of unrelated, but sort of is. Any chance you'd be willing to set up a LoR SVN, so I could post a current version there? I tried the SVN, but got confused... I figure you and some others would want the current version with BUG 4.2 and all, but I don't want to put out an official release until I figure things out more. If you do decide to do this, I'll need a seperate file structure for the art, as I'll assume anyone dealing with an SVN can pak their own art, and the art would need to be seperated into RevDCM, Wolfshanze, Achilleszero, and Enhanced folders.
 
Phungus,
Now is a really hard time for me to do any work on BAT, let alone another project.:( I don't understand what you mean about the art... wouldn't it just be easier to have the art in modular folders?
 
Top Bottom