Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGCSInjector Issue (Files not Generating) #795

Closed
SentaiBrad opened this issue Apr 24, 2023 · 15 comments
Closed

IGCSInjector Issue (Files not Generating) #795

SentaiBrad opened this issue Apr 24, 2023 · 15 comments
Labels
bug Something isn't working

Comments

@SentaiBrad
Copy link

Sorry for going poof on everyone here, life happens. xD

System Information

  • SteamTinkerLaunch version: V14.0.20230414-5
  • Distribution: SteamOS
  • Installation Method: ProtonQT Up - STL-Git

Issue Description

https://github.com/sonic2kk/steamtinkerlaunch/wiki/IGCSInjector

Based on that page, I am expecting "IGCSInjector.ini" to be generated so that I can change the dll that is being injected for a game, but nothing is being generated. No injector, and no ini. I've launched the game im testing, Guild Wars, in GameMode and Desktop mode, but no file generation.

Logs

image

image

Which logs would you want me to attach, specifically?

As a side note: Would it be possible to have a spot in STL where we can identify the dll's we want to inject instead of needing it to be named a specific name, or wait for the ini to generate and change it?

@SentaiBrad SentaiBrad added the bug Something isn't working label Apr 24, 2023
@sonic2kk
Copy link
Owner

Interesting, I have never heard of this tool before and didn't know STL included it. The code for it doesn't seem to have been touched in a long time.

As for which file to attach, you should disable this IGCSINjector option, then re-enable it, and then attach /dev/shm/steamtinkerlaunch.log after this so we can see a log from this option being freshly enabled. It'll be interesting to see what gets called and if perhaps STL cannot fetch the zip for some reason. I'll give this a try on my desktop and see what's up, but the log should note if it can't download this for some reason.

Though interestingly from looking at the code, it appears that a project directory should be created for this tool, and if STL is not even creating that folder, that's an interesting problem.

As a side note: Would it be possible to have a spot in STL where we can identify the dll's we want to inject instead of needing it to be named a specific name, or wait for the ini to generate and change it?

This may be possible, but I am still not even sure how this tool works, this is the first time I have looked into it at all so I can't comment much for now. All I can say is an improvement here may have to come from a community member who knows more about this than I do. Still, if I can get my head around this and get the program working for you, this can be tackled as a separate feature request! :-)

Sorry for going poof on everyone here, life happens.

It's all good, these things happen 🙂

@sonic2kk
Copy link
Owner

sonic2kk commented Apr 24, 2023

I can reproduce the issue on my Arch PC. It creates the folder at ~/.config/steamtinkerlaunch/downloads/igcs (where the zip should be downloaded) but it doesn't actually download anything, it doesn't even attempt to.

I'll take a look into this and see what I can find out.

@SentaiBrad
Copy link
Author

Interesting, I have never heard of this tool before and didn't know STL included it. The code for it doesn't seem to have been touched in a long time.

As for which file to attach, you should disable this IGCSINjector option, then re-enable it, and then attach /dev/shm/steamtinkerlaunch.log after this so we can see a log from this option being freshly enabled. It'll be interesting to see what gets called and if perhaps STL cannot fetch the zip for some reason. I'll give this a try on my desktop and see what's up, but the log should note if it can't download this for some reason.

Though interestingly from looking at the code, it appears that a project directory should be created for this tool, and if STL is not even creating that folder, that's an interesting problem.

I had it unchecked earlier, checked it, and tested it again right before I posted, so this log should have that behavior.

steamtinkerlaunch.log

I've been trying to get certain things to overlay on top of Guild Wars and Guild Wars 2 for the deck, and an Everquest dev pointed me in the right direction with their tutorial that used STL. Their method works with this overlay's own program just fine (with a delay), but their inject and launch box does not work in Game Mode for what ever reason (STL needs to launch their injector as a forked command on a bit of a delay, and pops up about the time I am at the character selection screen). A DLL injection method directly with STL would be even better.

@sonic2kk
Copy link
Owner

sonic2kk commented Apr 24, 2023

Thanks for the log! The relevant lines mirror what I see on my Arch PC:

Mon Apr 24 02:14:50 PM PDT 2023 INFO - prepareLaunch - checkIGCSInjector:
Mon Apr 24 02:14:50 PM PDT 2023 INFO - checkIGCSInjector - '/home/deck/.local/share/Steam/steamapps/common/Guild Wars/IGCSInjector.exe' not found
Mon Apr 24 02:14:50 PM PDT 2023 SKIP - checkIGCSInjector - '/home/deck/.config/steamtinkerlaunch/downloads/igcs//IGCSInjector_v102.zip' not found and could not be created - skipping 'IGCSInjector'

I'm currently trying to trace through why it's jumping straight to "not found and could not be created". I confirmed that the IGCS zip URL is still valid, there's something in checkIGCSInjector that isn't working right.

I just noticed the double slashing (/home/deck/.config/steamtinkerlaunch/downloads/igcs//IGCSInjector_v102.zip), which also happens on my system. I wonder if that's causing problems...

but their inject and launch box does not work in Game Mode for what ever reason

This could be some kind of Steam Deck Game Mode issue with the GameScope session. Several have been reported recently to Valve and specific STL things not working properly in the Game Mode session, so I think this is something on Valve's end as SteamTinkerLaunch shouldn't launch programs differently in Game Mode (it just runs another process with Proton, after that it's out of STL's control). Not sure that I can help much with this part specifically sadly.

@SentaiBrad
Copy link
Author

Oh, sorry, I was mostly giving context. I didn't think you would be able to help with that. I figured it was a Proton issue too. I appreciate the explanation though, cause I didn't know it was a wider known issue.

@sonic2kk
Copy link
Owner

Okay, I found out the problem. I was able to get STL to download IGCSInjector_v102.zip and it now also prompts for a DLL to use.

image

image

(Cookie Clicker is just my generic test game 🙂)

The issue was that b71e794 (17 months ago), there was a change to how STL handled downloads. It migrated to using the dlCheck function, which is a generic function that manages downloading files using wget and verifies any checksums if they exist (IGCS doesn't have a checksum, but this is a shared, "general" function for STL downloads). In this commit many downloads were switched to using dlCheck. An example line: dlCheck "$FWSURL/$DSTFILE" "$DLDST" "$DLCHK" "Downloading '$DSTFILE'" "$INCHK".

However, it seems dlCheck was not included for checkIGCSInjector. The line is this:

"$IGCSZIP" "$IGCSDST" "X" "'$IGCSDST' not found - downloading automatically from '$IGCSZIP'"

When it should be this:

dlCheck "$IGCSZIP" "$IGCSDST" "X" "'$IGCSDST' not found - downloading automatically from '$IGCSZIP'"

The code forgot to call dlCheck but passed all of the arguments that dlCheck would take. It follows the correct pattern but just didn't make the function call at the beginning. Adding dlCheck fixes the issue. It follows the convention of the other download changes, but this one just happened to get missed back then. This was broken for 17 months and no one reported it, holy cow!

I'm going to push a commit that should fixes this momentarily, thanks for bringing this up and great find! The actual functionality should work with this change. You can update from ProtonUp-Qt by reinstalling SteamTinkerLaunch-git.

From combing through the changes in b71e794 it doesn't look like dlCheck was missing anywhere else. It also looks like it had an extra space, so it seems like it may have been accidentally removed at some point before the change was committed.

@sonic2kk
Copy link
Owner

Ugh I forgot to reference this issue in the commit description, but d7701e4 has been pushed and should resolve this issue.

@SentaiBrad
Copy link
Author

xD Awesome, I appreciate you as always. I will test as soon as I am able.

@SentaiBrad
Copy link
Author

Damn. The DLL is not injecting, but the process of the injection for STL is functioning as expected now. I didn't even know it would prompt for which DLL xD.

However, It prompts for which DLL each and every time. Possible (read, is it easy) to add a "remember selection" box or move the dll selection to the settings page for it?

@sonic2kk
Copy link
Owner

It appears that the way to get it to remember the DLL is to specify a DLL in the IGCSINjector.ini file. I will stress that I haven't used this tool before, this is just from looking over the code and trying to infer what it would do 😅

It checks if there is a DLL in the game directory that matches Dll= in the ini file with this logic:

IGCSDLL="$(grep "^Dll=" "$IGCSINI" | cut -d '=' -f2)"  # Gets the DLL name after the equals sign from the first line in the INI file starting with "Dll="
if [ ! -f "$EFD/$IGCSDLL" ]; then  # If this file doesn't exist in the game directory (no idea why it's called EFD, maybe ExeFileDir?
    # does some checks for some related tool called "UUUSEIGCS"
else
    writelog "INFO" "${FUNCNAME[0]} - No valid dll found in '$IGCSINI' - Choose one"
    selectIGCSdll  # Shows DLL selection window
fi

This would get it to remember a DLL. This would require, as far as I can tell, having it in the same directory as the game exe.

Possible (read, is it easy) to add a "remember selection" box

Great question, and tentatively I want to say it should be straightforward. Those are famous last words that future sonic2kk may come to regret though ;-)

There appears to be a related tool that the code refers to UUUSEIGCS, which from what I can glean is something related to Unreal Engine DLL injection (Universal UE4 Unlocker most likely). This appears to be a separate option in the main menu underneath the IGCS option. STL writes out a DLL for this tool into the INI file. I have not verified if it does this, but if it can do it for this Unreal Engine tool, it should be able to do it generally I think.

I am not sure yet on an "implementation plan", but after selection we should be able to write this out. It actually looks like STL is meant to be doing this, but that it isn't working for some reason. These lines in selectIGCSdll seem like they're meant to be writing out the DLL.

IGCSINI="$EFD/${IGCS}.ini"
writelog "INFO" "${FUNCNAME[0]} - Inserting '$IGCSDLL' into '$IGCSINI'"
sed "/^Dll=/d" -i "$IGCSINI"
echo "Dll=$IGCSDLL" >> "$IGCSINI"

If that's the case though, I don't know if there's a way to get re-prompted for a DLL without manually editing this ini file. It may be worth checking the IGCSInjector.ini to see if it injected a DLL. My understanding of what STL does is that once the game process starts up, it runs the IGCS executable, and then it's this executable that actually reads the INI file to know which DLL to inject. I assume based on the Process= line in the ini file (which should point to the game exe), it knows which directory to look for the per-game IGCSInjector.ini file in, and so it then can read this file and try to load the DLL. But if nothing is written out to this file, that's probably an issue.

@SentaiBrad
Copy link
Author

Both the Process and DLL got written to the ini, but the pop-up to select the DLL happened every time regardless.

Considering injecting DLLs is very common for modding, having an easy method on Linux would be killer. It not injecting is most likely a separate issue, but worth noting that I can inject the DLL with their tool in desktop mode, but we come back to the unrelated game mode issues, etc.

As for whether this feature is functioning, it is, so there we have it.

@sonic2kk
Copy link
Owner

Okay, so it's this specific DLL that for some reason isn't injecting if I understand properly.

Considering injecting DLLs is very common for modding, having an easy method on Linux would be killer.

Indeed, I agree! This feature has gone mostly unnoticed. Though for the handful of modding that I do these days, dinput8 is typically the used DLL, or other "regular" DLLs, which STL does let you set overrides for on the Game Menu. It exports the Wine DLL override environment variable, so if there are built in DLLs that need to be injected, this can be set as an override. The dropdown has a few built-in presets but you can enter your own :-) Something I modded a little while back required this (maybe re4hd) so I added it to the preset dropdown. That's the extent of my experience with DLL overrides.

Improving IGCSInjector is certainly something that would be nice. Having a separate issue to track improvements could be a good idea, that way it's more visible and allows community members to step up if they have an interest in this feature to improve things - I've become more aware that I tend not to discuss my ideas for improving STL and only note various things on a personal ticket board, so I've been trying to create issues for the fleshed out ideas that I have for improving STL for development transparency and to (hopefully) improve community engagement.

@SentaiBrad
Copy link
Author

I try and make tickets for what I can where I can, just no knowledge of how to enact the changes. xD

And yes, the injection issue is now most likely down to the game or dll (probably the game or delay). IGCSInjector does pop up with a Windows-style command prompt and says that it was injected properly, but the overlay does not appear. I can get it to function when I use the custom argument method and select their exe as the launch method, with a delay.

@sonic2kk
Copy link
Owner

I try and make tickets for what I can where I can, just no knowledge of how to enact the changes

I'm sure any (sane) project manager will tell you it's much appreciated :-)

There are probably many areas that this could be improved, once I have some time I'll open a ticket that could encapsulate some form of "discussion" around the improvements that could be made. As usual, no ETA or anything, but I am hoping to improve various STL features (One-Time Run is on my mind to improve currently) so hopefully various features can be improved this year, with any and all help from the community (tickets, PRs, bug reports, etc). That would be my hope! 😄

@sonic2kk
Copy link
Owner

Though there can be improvement to this functionality, the initial bug report seems to be resolved. I will close this issue now but some enhancements will hopefully come in the future :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants