Pocket Plane Group

Friends and Neighbors => Weimer Republic (WeiDU.org) => WeiDU => Topic started by: AL|EN on February 15, 2020, 02:15:24 AM

Title: WeiDU is executing every executable called setup-* even if it's not weidu
Post by: AL|EN on February 15, 2020, 02:15:24 AM
Hi,

WeiDU is executing every executable called setup-* even if it's not weidu. I'm assuming that it's because of autoupdate design. Can you alter this so the non-weidu executable won't be executed?
Title: Re: Weidu is executing every executable called setup-* even if it's not weidu
Post by: Wisp on February 16, 2020, 04:14:17 AM
I can't know if an executable matching the setup pattern is or is not a WeiDU without running it to see if it takes the expected input and produces the expected output. Yes, it is autoupdate which runs all the setup executables in the game directory.
Title: Re: Weidu is executing every executable called setup-* even if it's not weidu
Post by: AL|EN on February 28, 2020, 05:36:01 AM
Sure you can, just check ProductName property of the executable. If it's there, it's weidu so compare ProductVersion with the current one.

EDIT: well, apparently on macOS and Linux, there is no way to check executable without launching?
Title: Re: Weidu is executing every executable called setup-* even if it's not weidu
Post by: Wisp on March 12, 2020, 12:53:03 PM
Sure you can, just check ProductName property of the executable. If it's there, it's weidu so compare ProductVersion with the current one.
I can't use features that only exist in the most recent versions of WeiDU. Autoupdate needs to be able to handle any old WeiDU ever released.
Title: Re: Weidu is executing every executable called setup-* even if it's not weidu
Post by: AL|EN on January 17, 2021, 11:57:15 AM
Well, it's even worse:
Code: [Select]
[E:\Gry\Beamdog\00766\Setup-weidu.exe] WeiDU version 24700
{Setup-Not-WeiDU.exe} Queried (pid = 252) version = -1
Newest WeiDU is version 24700, updating!
WeiDU files in version order:
  [Setup-weidu.exe] version 24700
  [Setup-Not-WeiDU.exe] version -1
        Copying [Setup-weidu.exe] -> [Setup-Not-WeiDU.exe]: true
WeiDU is destroying every executable which is called 'Setup-xxx' even if the returned version is -1.

Can you please fix this? Is there a workaround in order to prevent this happen?
Title: Re: Weidu is executing every executable called setup-* even if it's not weidu
Post by: Wisp on January 21, 2021, 12:15:41 PM
This is intended behaviour. In the next phase, WeiDU will additionally start to replace important OS files with itself.

I should probably fix this, yes. Beyond --noautoupdate I don't think there's a way to not have your setup-*.exes "updated" if you are running a WeiDU instance that would otherwise perform autoupdates. 
Title: Re: Weidu is executing every executable called setup-* even if it's not weidu
Post by: AL|EN on January 21, 2021, 02:05:32 PM
But why can't simpy skip overwriting the 'Setup-Not-WeiDU.exe' when the reported version is -1?
Title: Re: Weidu is executing every executable called setup-* even if it's not weidu
Post by: Wisp on January 21, 2021, 03:59:19 PM
I meant as a workaround until a fix can be delivered. Not overwriting not-WeiDUs is the fix.
Title: Re: Weidu is executing every executable called setup-* even if it's not weidu
Post by: AL|EN on January 22, 2021, 12:38:58 AM
Och sorry, I misunderstood.

I'm looking at the source code and I see this: https://github.com/WeiDUorg/weidu/blob/796845951679926f5ca57b65ef6b7622cb88add3/src/arch_mingw.ml#L85 (https://github.com/WeiDUorg/weidu/blob/796845951679926f5ca57b65ef6b7622cb88add3/src/arch_mingw.ml#L85)

Code: [Select]
  let pid = create_process_env
      f [| "WeiDU-Backup" ; "--game bar" |] [| |] newstdin newstdout' newstderr'
  in
So does the WeiDU is launching itself with "WeiDU-Backup" and "--game bar" command line args? If yes, I could detect such a case and act accordingly?