Author Topic: WeiDU is executing every executable called setup-* even if it's not weidu  (Read 1480 times)

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 391
  • Gender: Male
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?
« Last Edit: January 22, 2021, 12:40:04 AM by AL|EN »
Project Infinity public BETA - mod manager for Infinity Engine games
Modder's Guide to Github - you cannot have progress without committing changes

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
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.

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 391
  • Gender: Male
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?
« Last Edit: February 29, 2020, 10:10:03 AM by AL|EN »
Project Infinity public BETA - mod manager for Infinity Engine games
Modder's Guide to Github - you cannot have progress without committing changes

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
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.

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 391
  • Gender: Male
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?
Project Infinity public BETA - mod manager for Infinity Engine games
Modder's Guide to Github - you cannot have progress without committing changes

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
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. 

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 391
  • Gender: Male
But why can't simpy skip overwriting the 'Setup-Not-WeiDU.exe' when the reported version is -1?
Project Infinity public BETA - mod manager for Infinity Engine games
Modder's Guide to Github - you cannot have progress without committing changes

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
I meant as a workaround until a fix can be delivered. Not overwriting not-WeiDUs is the fix.

Offline AL|EN

  • Planewalker
  • *****
  • Posts: 391
  • Gender: Male
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

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?
« Last Edit: January 22, 2021, 01:54:27 AM by AL|EN »
Project Infinity public BETA - mod manager for Infinity Engine games
Modder's Guide to Github - you cannot have progress without committing changes

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: