Jump to content

Batch file to automate installation of WeiDU mods with selected components?


Recommended Posts

Posted (edited)

I am trying to set up batch files to automate the removal and (re)installation of individual Weidu mods. (I am NOT interested in using Project Infinity, so please do not recommend it to me.)

To remove a Weidu mod and all its components, (using Sword Coast Stratagems or "SCS" as the example,) here is my batch file:
 

setup-stratagems.exe --uninstall


Before the removal, I had copied all the installed SCS components from WeiDU.log. I have been trying to script a batch file to automatically reinstall all those components that were previously installed.

Let say some SCS lines that were copied and saved from WeiDU.log were:
 

~STRATAGEMS/SETUP-STRATAGEMS.TP2~ #0 #2050 // Icewind Dale-inspired tweaks to Baldur's Gate/Baldur's Gate II spells: 35.9
~STRATAGEMS/SETUP-STRATAGEMS.TP2~ #0 #2060 // Rebalancings of slightly-too-powerful spells: 35.9
~STRATAGEMS/SETUP-STRATAGEMS.TP2~ #0 #2080 // Spells increased in power: 35.9


How do I script the batch file to reinstall those three components?

I tried this:
 

setup-stratagems.exe --force-install 0 2050  & :: Icewind Dale-inspired tweaks to Baldur's Gate/Baldur's Gate II spells: 35.9
setup-stratagems.exe --force-install 0 2060  & :: Rebalancings of slightly-too-powerful spells: 35.9
setup-stratagems.exe --force-install 0 2080  & :: Spells increased in power: 35.9


(In the first line, 0 to select the English language, 2050 is the component number, and & :: is for inserting comments.)

That did not work: setup-strategem.exe ran but then stopped at the language selection.

Edited by ktchong
Posted (edited)

This is how you do it:

setup-stratagems.exe --language 0 --force-install-list 2050 2060 2080

 

Edited by AL|EN
Posted (edited)

Thanks.

Can I do it this way?  i.e., a separate line for each component with comments.

UPDATE: I've just tried it. It worked.

 

setup-stratagems.exe --language 0 --force-install 2050  & :: Icewind Dale-inspired tweaks to Baldur's Gate/Baldur's Gate II spells: 35.9
setup-stratagems.exe --language 0 --force-install 2060  & :: Rebalancings of slightly-too-powerful spells: 35.9
setup-stratagems.exe --language 0 --force-install 2080  & :: Spells increased in power: 35.9
. . .

 

Edited by ktchong
Posted (edited)

How do you deal with a situation in which the mod asks for TWO language inputs?  i.e., the first one for the mod, and the second one for the game.

Here is an abstract of my batch file, "00-setup-DlcMerger --install"?  (I numbered my batch files so I know the order to install the mods.) 

 

@echo Install DLC Merger?
@echo.

: PROMPT
set /p CONFIRM=Enter Y to confirm. 
if /i "%CONFIRM%" neq "Y" goto END

setup-DlcMerger.exe --language 0 --force-install 1  &: Merge DLC into game -> Merge "Siege of Dragonspear" DLC

: END
endlocal

 

I ran the batch file, and it stopped at the second language selection; (I edited out some unnecessary information like the drive and directory location.)

 

Install DLC Merger?

Enter Y to confirm. y

setup-DlcMerger.exe --language 0 --force-install 1
[setup-DlcMerger.exe] WeiDU version 24900
Using Language [English]

Please choose the language in which you wish to play the game.
If you later wish to play the game in a different language you will need to edit the file weidu.conf and reinstall your mods.
 0 [Czech]
 1 [German]
 2 [English]
 3 [Spanish]
 4 [French]
 5 [hu_hu]
 6 [Italian]
 7 [Japanese]
 8 [Korean]
 9 [Polish]
10 [Portuguese]
11 [Russian]
12 [Turkish]
13 [Ukrainian]
14 [Simplified Chinese]

 

It stopped there to wait for another input for the language to play the game.

Adding "2" into did not work, (i.e., "setup-DlcMerger.exe --language 0 2 --force-install 1" did not work.)

 

Edited by ktchong
Posted

That’s not the mod asking that, it is weidu itself. If you install any mod snd answer that question, it will generate a weidu.conf file. Then you can uninstall the mod and then do your batch-install and as long as that weidu.conf file is present, it won’t ask for that second language input anymore. 

Posted (edited)

Got it, I'd just figured that one out. 

Anyway, I found an alternative solution.  I just put weidu.conf into my "backup-fresh-install.zip"; (I decided to save the entire Baldur's Gate directory so I would not have to keep re-downloading and re-installing the game whenever  I need to roll back all the mods and start over.)

Edited by ktchong
Posted
30 minutes ago, ktchong said:

Got it, I'd just figured that one out. 

Anyway, I found an alternative solution.  I just put weidu.conf into my "backup-fresh-install.zip"; (I decided to save the entire Baldur's Gate directory so I would not have to keep re-downloading and re-installing the game whenever  I need to roll back all the mods and start over.)

I would advice you to actually make the backup from the game that has already the setup-DlcMerger.exe installed on it. Because you need to install that if you want to install any other mods to the BG1EE+DLC'ed game. The language pick is already made in the tools install, so you'll never need to do that again. This is of course if you plan to use the one selected as the base language, always.

Posted
16 hours ago, AL|EN said:

This is how you do it:

setup-stratagems.exe --language 0 --force-install 2050 2060 2080

 

Just a small addendum to this for anyone passing through:

You need to add list if you want multiple components consecutively installed like this in the same session.

--force-install-list
Posted

On this topic...

Does anyone know what I need to change to answer a prompt like this?

setup-bp-bgt-worldmap.exe --language 0 --force-install-list 0 1

 

Install Component [Worldmap for Baldur's Gate - including colored Baldur's Gate map icons]?
[I]nstall, or [N]ot Install or [Q]uit? i

Installing [Worldmap for Baldur's Gate - including colored Baldur's Gate map icons] [v11.0.0]
Copying 1 file ...
Creating 1 directory
Copying and patching 1 file ...
Copying and patching 1 file ...

Which travel times do you want?

1. Original Travel Times and Area Visibility
2. Revised Travel Times and Area Visibility.

PLEASE ENTER  1 OR 2
Posted (edited)

That looks line it is using READLN, which as I understand things, cannot be automated. 

Sad thing is, there is no reason to use READLN there, if you are just giving two choices (or four or six, whatever), the mod is better off using subcomponents. Several NPC mods I have installed did this, and it is pretty annoying. 

Edited by subtledoctor
Posted (edited)
17 minutes ago, subtledoctor said:

That looks line it is using READLN, which as I understand things, cannot be automated. 

Yes it can, you can set up a .txt file for example to insert the replies... something something --arg ... what ever, going off a memory here from a long time ago, so I have actually forgotten about how to do it. BGT had this in the .rar files readme for so long, as there it asked  the BG1's installation folder and the .txt gave the default answer.
This is the difference between megamodders and someone that knew nothing about it. And before you say anything as a reply, I saidknew intentionally, you might know stuff now and how to do it, but you don't know what people then knew.
There's also a reason why AlienQuake, or the todays AL|EN hates about the readln command.

Edited by Jarno Mikkola

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...