This code fails when engine.lua has "Hidden" attribute enabled (tested using clean Windows 7):
1. Set engine.lua as "Hidden" file in Windows
2. Try to install A1 component
BACKUP ~A1/backup~
AUTHOR ~A1~
BEGIN ~A1~
COPY ~engine.lua~ ~engine.lua~
REPLACE_TEXTUALLY ~engine_name[ %TAB%]*=[ %TAB%]*".*"~ ~engine_name = "Baldur's Gate - Enhanced Edition Trilogy"~
Error:
[V:\Gry\BGIIEE\data\00783\setup-A1.exe] WeiDU version 23901
This is a non-stable version. Unless you're sure about what you're doing, consider downgrading.
Using .\lang\en_us\dialog.tlk
Install Component [A1]?
[I]nstall, or [N]ot Install or [Q]uit? i
Installing [A1]
Copying 1 file ...
ERROR: COPY ~engine.lua~ ~engine.lua~ FAILED: cannot open target
Stopping installation because of error.
ERROR Installing [A1], rolling back to previous state
Will uninstall 1 files for [SETUP-A1.TP2] component 0.
Uninstalled 1 files for [SETUP-A1.TP2] component 0.
ERROR: Sys_error("engine.lua: Permission denied")
PLEASE email the file SETUP-A1.DEBUG to A1
Install Component [A1]?
[I]nstall, or [N]ot Install or [Q]uit?
3. After this error popups, weidu 'unhide' file (attribute "Hidden" is somehow removed and the second try of installation will pass without problems.
I don't know what is the reason but the fact it exist is definitely not a good thing.