Kulyok's Xan mod offers an optinal component after the main one with an alternative soundset. If installed, HANDLE_AUDIO is used to convert .ogg files on the original engine and replace the first version of wavs in the override, installed in the main component also from .ogg files with HANDLE_AUDIO. The replaced files share the same name, obviously.
The oggdec and sox are in the same folder as the first soundset called "audio", thus in the main component, HANDLE_AUDIO is simply called via LAF HANDLE_AUDIO END.
The optional component uses the same oggdec in xan/audio, but the sound files are in xan/audio2, so it uses
LAF HANDLE_AUDIO
STR_VAR
audio_path = ~Xan/audio2~
oggdec_path = ~Xan/audio~
sox_path = ~Xan/audio~
END
What happens upon install: when installing the optional component, the created wav-files are placed into the xan/audio2 folder. (This does not happen for the main component, i.e. when the soundfiles are installed the first time.)
This is what the debug says if installing the audio files from the optional component:
Copied [.../fl#inlined/null.file] to [Xan/audio2/O#XAN001.wav]
MOVE [Xan/audio2/O#XAN001.wav] [override/O#XAN001.wav]: destination exists, falling back to COPY_LARGE
Upon deinstallation the first time, the wavs in xan/audio2 are not deleted and there is the following error message:
(...)
Install Component [Xan NPC MOD for Baldur's Gate II]?
[R]e-Install, [N]o Change or [U]ninstall or [Q]uit?
Removing [Xan NPC MOD for Baldur's Gate II] (component #0)
uninstall: XAN/XAN.TP2 0
We must temporarily uninstall [XAN/XAN.TP2] component 6
[Xan/Backup/6/UNSETSTR.6] SET_STRING uninstall info not found
Will uninstall 629 files for [XAN/XAN.TP2] component 6.
Restoring backed-up [Xan/Backup/6/O#XAN001.wav]
Xan/Backup/6/O#XAN001.wav copied to Xan/audio2/O#XAN001.wav, 332302 bytes
Restoring backed-up [Xan/Backup/6/O#XAN001.wav]
ERROR: error copying [Xan/Backup/6/O#XAN001.wav]
(...)
WARNING: unable to restore [Xan/audio/O#XAN316.wav]: Unix.Unix_error(20, "rename", "override/O#XAN316.wav")
(...)
WARNING: unable to restore [Xan/audio/O#XAN316.wav]: Unix.Unix_error(20, "rename", "override/O#XAN316.wav")
If the mod is installed again - with the wavs in the xan/audio2 folder - and deinstalled, there is no error messages:
Will uninstall 629 files for [XAN/XAN.TP2] component 6.
Restoring backed-up [Xan/Backup/6/O#XAN001.wav]
Xan/Backup/6/O#XAN001.wav copied to Xan/audio2/O#XAN001.wav, 332302 bytes
Restoring backed-up [Xan/Backup/6/override.O#XAN001.wav]
Xan/Backup/6/override.O#XAN001.wav copied to override/O#XAN001.wav, 332302 bytes
Restoring backed-up [Xan/Backup/6/O#XAN002.wav]
(...)
What I would expect:
1. the wavs not being placed into the mod folder. (I need to delete them by hand to get rid of them.)
2. no error message upon deinstallation, especially not one that tells me that it couldn't "restore" wav files that wheren't in the folder before the installation.
Questions:
Is this intended behavior?
How would I prevent the wav files in the mod package and the error messages?