Jump to content


Photo

Questions about AT_NOW, INTERACTIVE and weidu command line


  • Please log in to reply
12 replies to this topic

#1 Turambar

Turambar
  • Modder
  • 935 posts

Posted 23 January 2011 - 09:33 AM

I haven't understood when an (un)installation is considered interactive.
For example: if I have a mod with components 0 and 1, both installed; I [R]e-install 0.
It uninstalls 1 automatically, then 0 as requested. It then re-installs 0 as requested;I quit when it prompts for 1.
Which of these processes are %INTERACTIVE% and which aren't?

Another question: how can I re-install component 0 of a mod from terminal/cmd?
can I do something like setup-mymod(.exe) [options] or do I need a copy of weidu(.exe) called weidu?

Edited by Turambar, 24 January 2011 - 03:35 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#2 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 23 January 2011 - 09:50 AM

The quick answer is: only use AT_NOW and AT_UNINSTALL in your mod (no AT_INTERACTIVE_* or AT_*_EXIT), and don't check against INTERACTIVE. Attempts at acting differently between INTERACTIVE and non-INTERACTIVE will backfire and leave you with a partially installed mod or otherwise cause you grief. If you really have to use INTERACTIVE, and then run a trillion of mock tests with ACTION_IF INTERACTIVE THEN BEGIN PRINT ~interactive~ END ELSE BEGIN PRINT ~non interactive~ END to ensure that it will work the way you designed it in all scenarios.

--yes, --force-install and friends count as INTERACTIVE, components automatically [R]einstalled if you answered [Q]uit are non-interactive (whether from the same tp2 or another tp2).

To reinstall a single mod component, setup-mymod.exe --force-install 124 works correctly.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#3 Turambar

Turambar
  • Modder
  • 935 posts

Posted 23 January 2011 - 10:04 AM

The quick answer is: only use AT_NOW and AT_UNINSTALL in your mod (no AT_INTERACTIVE_* or AT_*_EXIT), and don't check against INTERACTIVE. Attempts at acting differently between INTERACTIVE and non-INTERACTIVE will backfire and leave you with a partially installed mod or otherwise cause you grief. If you really have to use INTERACTIVE, and then run a trillion of mock tests with ACTION_IF INTERACTIVE THEN BEGIN PRINT ~interactive~ END ELSE BEGIN PRINT ~non interactive~ END to ensure that it will work the way you designed it in all scenarios.

--yes, --force-install and friends count as INTERACTIVE, components automatically [R]einstalled if you answered [Q]uit are non-interactive (whether from the same tp2 or another tp2).

To reinstall a single mod component, setup-mymod.exe --force-install 124 works correctly.

I actually wanted to use an A_I_U_E (in this case, at the end of component 1, AT_I_U_EXIT ~(./)setup-mymod(.exe) --reinstall 0~) as a "fool-saver": if component 1 is re-installed without touching component 0, the game is broken. Re-installing 0 (and thus 1) recovers it.
I have written "do not [R]e-install, but I thought that an AT_INTERACTIVE_EXIT which re-installs component 0 would fix the game automatically.
The thing is, if it triggers when I re-install component 0, it could cause a loop, and if it triggers when I [u] or [R] component 0 without touching component 1, it prevents uninstallation.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#4 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 23 January 2011 - 10:15 AM

Again, can't you could simply tell the three Linux players to grab generalized biffing rather than having to code multi-stage uninstallers and whatnot?

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#5 Turambar

Turambar
  • Modder
  • 935 posts

Posted 24 January 2011 - 01:35 AM

Again, can't you could simply tell the three Linux players to grab generalized biffing rather than having to code multi-stage uninstallers and whatnot?

Yes, you're right, it's much easier and safer. I've removed all ITM, SPL,... biffs and written that they should use generalized biffing at the end of their installation.

I actually wanted to use an A_I_U_E (in this case, at the end of component 1, AT_I_U_EXIT ~(./)setup-mymod(.exe) --reinstall 0~) as a "fool-saver": if component 1 is re-installed without touching component 0, the game is broken. Re-installing 0 (and thus 1) recovers it.
I have written "do not [R]e-install, but I thought that an AT_INTERACTIVE_EXIT which re-installs component 0 would fix the game automatically.
The thing is, if it triggers when I re-install component 0, it could cause a loop, and if it triggers when I [u] or [R] component 0 without touching component 1, it prevents uninstallation.

Anyway, I've made some tests.
Uninstall 0, no change 1 -> 0 is interactive, 1 isn't.
But the --reinstall option from command line applies to all components -> both wuold uninstall interactively, and it would loop.
Is there any way to only re-install component 0 (I mean, a command line equivalent to the sequence [R] and [Q] in a manual installation)?

edit: another question. I've read, in the WeiDu documentation, that AT_NOW ~weidu.exe --make-biff ...~ crashes installation, and you must use AT_EXIT instead.
does it also happen with other Weidu.exe command line options? For example, can I AT_NOW --get-biff, in order to get some resources from a different game, and then normally work on them?

Edited by Turambar, 24 January 2011 - 03:12 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#6 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 24 January 2011 - 02:15 PM

Anyway, I've made some tests.
Uninstall 0, no change 1 -> 0 is interactive, 1 isn't.
But the --reinstall option from command line applies to all components -> both wuold uninstall interactively, and it would loop.
Is there any way to only re-install component 0 (I mean, a command line equivalent to the sequence [R] and [Q] in a manual installation)?

--force-install 0 should do the trick.

edit: another question. I've read, in the WeiDu documentation, that AT_NOW ~weidu.exe --make-biff ...~ crashes installation, and you must use AT_EXIT instead.
does it also happen with other Weidu.exe command line options? For example, can I AT_NOW --get-biff, in order to get some resources from a different game, and then normally work on them?

Depends on the command; --get-biff works: if the target file was backed up, then it'll be restored (or erased) at Reinstall even if it's edited by an external source. If the file wasn't backed up the original can't be restored, but that doesn't really matter if you're creating a new file rather than overwriting an existing file.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#7 Turambar

Turambar
  • Modder
  • 935 posts

Posted 25 January 2011 - 02:02 AM

if the target file was backed up, then it'll be restored (or erased) at Reinstall even if it's edited by an external source. If the file wasn't backed up the original can't be restored, but that doesn't really matter if you're creating a new file rather than overwriting an existing file.

I don't quite get that...
if I --get-biff file.ext, it should leave the biff (and chitin.key) unmodified (just read them), and create a copy of file.ext in my folder; I can then patch the file and so on, and when I uninstall, the original file.ext will be in my folder. Does it work like that?

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#8 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 25 January 2011 - 03:28 AM

Yes; my point is that, if file.ext already existed, it will be overwritten without creating a backup.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#9 Turambar

Turambar
  • Modder
  • 935 posts

Posted 25 January 2011 - 03:49 AM

Yes; my point is that, if file.ext already existed, it will be overwritten without creating a backup.

Ok, thanks for the warning. Anyway, I'd do it to an empty folder, and then MOVE, COPY,... it with WeiDU actions

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#10 Turambar

Turambar
  • Modder
  • 935 posts

Posted 25 January 2011 - 06:08 AM

How does weidu --biff work?
./weidu --log bif.log --out biff/out.txt --biff data/stores.bif
should output a list of all files in data/stores.bif. It does not output anything but the log, is my command wrong?
Spoiler


Is it possible to pipe the output of a WeiDU command into another? for example, list all files in x.bif | --biff-get them?

Edited by Turambar, 25 January 2011 - 06:18 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#11 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 25 January 2011 - 06:58 AM

--biff requires to use backslashes (\) even on Linux. weidu --biff data\stores.bif --out log.txt produces this log.txt:
Spoiler


On Linux, you can equivalently use `` or $() to pass the output of a command to a command line; such a construct doesn't exist on Windows.

Let me re-state that, if you use gen_biff -like coding, you can leave the files in SoS-Itm and let WeiDU move them back to the override without having to do it yourself. 12 MB of on-disk space for a mod that weights over 300 MB is not significant enough to warrant complex uninstall procedures.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#12 Turambar

Turambar
  • Modder
  • 935 posts

Posted 25 January 2011 - 08:45 AM

--biff requires to use backslashes (\) even on Linux. weidu --biff data\stores.bif --out log.txt produces this log.txt:

That same code, copy-pasted in my terminal, does not create any output file. I've tried to --list-biffs and

[DATA\STORES.BIF] 156344 bytes, 1 locations

is in its output. I've tried your code upper and lower case, but still without effect. It doesn't work with other biffs, either

./weidu --biff DATA\AREA550A.bif --out log.txt

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#13 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 25 January 2011 - 09:10 AM

In Bash, \ is the escape character, and you need to escape it to be passed to WeiDU: weidu --biff data\\stores.cre --other-options.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.