Fast/easy way to reinstall mods with weidu
jtth
Member Posts: 171
I installed all my mods on 2.2 yesterday. Now, 2.3 is out! Yay! Rather than sitting in front of my computer for 45 minutes answering prompts every 5 while SCS reinstalls, is there a way to use the debug files Weidu spits out to do an automated reinstallation?
2
Comments
I will exemplify using one of my mods: the Silver Staff of Aule. The default install would require to enter the following answers:
0 (to select English)
i (to install the main component of the mod)
1 (to select the default icon for the staff)
This can be automatised by doing this:
1) write in a plain text file, let's say, "ssa.txt".
2) create a .bat file (that's just a plain text file with extension changed from .txt to .bat; let's say it is called "ssa.bat"), containing the following 3) put both ssa.txt and ssa.bat in the main game folder
4) double click ssa.bat
Also be careful that the first mod installed will also ask for the language in which you play the overall game (not just the language for the mod), so there is an additional answer to account for. Using the same mod as example this means something like
0 (to select English for the mod)
2 (to select English for the game)
i (to install the main component of the mod)
1 (to select the default icon for the staff)
Setup-themod.exe --force-install 0 1 2 3
What I was thinking was something more along the lines of this:
Will the following reinstall the mods I have installed already, using the options I already chose, if I copy over the `weidu.log` file and all the mod folders?
weidu --reinstall
That is, does the weidu executable read from weidu.log, or from some other database, to determine what was installed?
Edit: that doesn't work.
But that's programming in a nutshell: spending hours writing code to automatically do in seconds what would manually take minutes.
Jokes aside, I'm actually using the method described in my previous post to speed up reinstallation of large mods. For example this is my current installation file for "Level 1 NPCs" on my EasyTutu install:
N
Y
Y
Y
I
N
N
N
N
I
I
I
I
6
0
3
101
101
112
112
I
4
0
0
4
4
4
4
6
6
6
6
107
91
I
3
0
2
107
97
I
9
0
0
1
1
1
1
5
5
5
5
104
104
90
90
I
19
0
0
107
15
11
I
1
0
2
107
I
5
0
2
104
99
I
11
0
1
107
102
I
5
0
3
103
94
I
4
0
0
4
4
4
4
6
6
6
6
105
91
I
16
0
0
107
107
95
112
I
2
0
1
92
92
114
114
I
2
0
1
89
89
114
114
I
12
0
1
113
104
104
99
111
I
2
0
1
93
93
111
111
0
0
I
9
0
4
1
1
1
1
5
5
5
5
107
107
96
96
I
14
0
8
107
101
I
4
0
3
7
7
7
7
7
7
7
7
95
113
I
2
0
1
114
114
114
90
I
4
0
2
3
3
3
3
3
3
3
3
94
103
I
15
0
4
2
2
2
2
2
2
2
2
107
97
I
3
0
1
107
97
I
19
0
0
107
15
11
I
1
0
7
107
I
8
0
6
107
97
97
112
I
3
0
0
100
107
I
3
0
3
97
107
I
7
0
0
90
90
105
105
Anyway what I do is I use BWS, which lets you pick components, and export bws selection.ini which I use the next time I want to reload all my mods. Normally at that point I reconsider the list as well when I load my selections.
If you can't (or don't want to) use it for installing mods, you can try out the following procedure:
- Open the current WeiDU.log in a text editor that supports regular expressions (such as Notepad++)
- Remove the comments from the first three lines and any comment you might find at the end of the file.
- Open the "Replace" dialog and enable the search mode "Regular expression" (or whatever it's called in your text editor).
- Enter the following lines into the Find and Replace fields:
Find what: ^~((.+/)*(.+)\.TP2)~ #([0-9]+) #([0-9]+)( //.*)?$ Replace with: weidu.exe "\1" --language \4 --force-install \5 --log \3-\4-\5.DEBUG
- Click on "Replace all" (or whatever it's called in your text editor).
- Save the modifications as a batch file (e.g. install_mods.cmd) in a safe location and quit the text editor.
- Install the latest game patch.
- Unpack all mods you want to install in the same way as you've done for the previous game version.
- Unpack the weidu.exe from the WeiDU package you can find here.
- Place the "install_mods.cmd" into the game directory.
- Start a Command Prompt in Administrator mode and navigate to the game directory.
- Execute "install_mods.cmd"
Mods that require manual input of data can be installed that way as well, but you have to manually input data when these mods are about to be installed before the script can continue.
I can't guarantee that it installs everything successfully, but it's worth a try.
Whether you use this procedure or install all mods manually or via BWS, you have to start a new game in any case.
Why would I have to start a new game if the previous mod install mirrors my current one? (This is not the case as I'm starting BG2 importing a character from a similarly modded BG1-SOD installation.)