ST-Apps / CS2-ExtendedRoadUpgrades

A mod that enables multiple upgrade options for your roads.
Other
38 stars 4 forks source link

Does not load in BepInEx 5.4.22.0 on Wine #12

Closed NiPfi closed 11 months ago

NiPfi commented 11 months ago

As the title says, the current version of the mod seems not to be able to be loaded for me. I get the following errors in BepInEx' LogOutput file.

[Error  :   BepInEx] System.IO.DirectoryNotFoundException: Could not find a part of the path "Z:\mounts\game_ssd_2\SteamLibrary\steamapps\common\Cities Skylines II\BepInEx\plugins\ExtendedRoadUpgrades\ExtendedRoadUpgrades\0Harmony.dll".
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x00164] in <b89873cb176e44a995a4781c7487d410>:0 
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) [0x00000] in <b89873cb176e44a995a4781c7487d410>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at Mono.Cecil.ModuleDefinition.GetFileStream (System.String fileName, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) [0x00006] in <6034b380a22b41a596c9dc29d282c0a9>:0 
  at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00008] in <6034b380a22b41a596c9dc29d282c0a9>:0 
  at Mono.Cecil.AssemblyDefinition.ReadAssembly (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00000] in <6034b380a22b41a596c9dc29d282c0a9>:0 
  at BepInEx.Bootstrap.TypeLoader.FindPluginTypes[T] (System.String directory, System.Func`2[T,TResult] typeSelector, System.Func`2[T,TResult] assemblyFilter, System.String cacheName) [0x0006c] in <5e471ddbeb974684bff43bc61f1b58cb>:0 
[Error  :   BepInEx] System.IO.DirectoryNotFoundException: Could not find a part of the path "Z:\mounts\game_ssd_2\SteamLibrary\steamapps\common\Cities Skylines II\BepInEx\plugins\ExtendedRoadUpgrades\ExtendedRoadUpgrades\ExtendedRoadUpgrades.dll".
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x00164] in <b89873cb176e44a995a4781c7487d410>:0 
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) [0x00000] in <b89873cb176e44a995a4781c7487d410>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at Mono.Cecil.ModuleDefinition.GetFileStream (System.String fileName, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) [0x00006] in <6034b380a22b41a596c9dc29d282c0a9>:0 
  at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00008] in <6034b380a22b41a596c9dc29d282c0a9>:0 
  at Mono.Cecil.AssemblyDefinition.ReadAssembly (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00000] in <6034b380a22b41a596c9dc29d282c0a9>:0 
  at BepInEx.Bootstrap.TypeLoader.FindPluginTypes[T] (System.String directory, System.Func`2[T,TResult] typeSelector, System.Func`2[T,TResult] assemblyFilter, System.String cacheName) [0x0006c] in <5e471ddbeb974684bff43bc61f1b58cb>:0 

Full log: LogOutput.log

I have two other plugins that load fine so I think the issue might be specific to this mod. Any ideas?

CorvetteCole commented 11 months ago

Can you check the path and see if it actually exists? Windows is case-insensitive whereas Unix is usually case-sensitive so I bet that's the issue here

NiPfi commented 11 months ago

Actually, I found out what the issue was just now. It seems to be related to the released zip archive not unpacking correctly. When I open it in my archiver, I get 5 files all starting with ExtendedRoadUpgrades\[...] instead of being in a folder called "ExtendedRoadUpgrades". image When I remove this "path prefix" from the filenames, it loads correctly.

ST-Apps commented 11 months ago

This is interesting but I'm glad you sorted this out :)

NiPfi commented 11 months ago

Well, yes I did figure it out but the issue persists as long as the build pipeline produces erroneous zip files imo. I would help but I don't think I can create PRs for build issues

ST-Apps commented 11 months ago

Hey @NiPfi, I don't think there's an issue with the zip file to be fair as it unzips fine even using unzip on bash 🤔

How are you extracting it?

NiPfi commented 11 months ago

I'm opening it in Ark, the default archiver for KDE. With the latest Release 1.2.3 it still looks like this:

image

If I open it in PeaZip, another archiver, it also looks weird; the folder is displayed separately and contains nothing

image

When I inspect the ZIP file with unzip on the console, I get the following output:

$ unzip -l ExtendedRoadUpgrades_v1.2.3-BepInEx5.zip 
Archive:  ExtendedRoadUpgrades_v1.2.3-BepInEx5.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
   264192  2023-08-30 00:12   ExtendedRoadUpgrades\0Harmony.dll
     1870  2023-11-24 17:59   ExtendedRoadUpgrades\Elevated.svg
    30208  2023-11-30 22:07   ExtendedRoadUpgrades\ExtendedRoadUpgrades.dll
   107584  2023-11-30 20:16   ExtendedRoadUpgrades\icon.png
      580  2023-11-30 22:07   ExtendedRoadUpgrades\manifest.json
     1482  2023-11-23 19:00   ExtendedRoadUpgrades\Quay.svg
     3077  2023-11-30 20:18   ExtendedRoadUpgrades\README.md
     1523  2023-11-23 19:01   ExtendedRoadUpgrades\RetainingWall.svg
---------                     -------
   410516                     8 files

Indeed, when I actually unzip the file using the CLI tool, it gives me the expected output. I'm suspecting, that the Windows style paths in the zip file aren't handled well by most zip tools under Unix. Interestingly, this is the first ZIP file I've ever encountered this issue with. This might also pose issues on Mac. @ST-Apps What archiver are you using to create these ZIP files?

NiPfi commented 11 months ago

Btw, this is what the mod LegacyFlavour looks like in unzip:

$ unzip -l LegacyFlavour_v0.0.3_BepInExv5.zip 
Archive:  LegacyFlavour_v0.0.3_BepInExv5.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
   264192  2023-08-29 22:12   LegacyFlavour/0Harmony.dll
     2085  2023-11-19 22:42   LegacyFlavour/config.json
    41472  2023-11-28 02:24   LegacyFlavour/LegacyFlavour.dll
---------                     -------
   307749                     3 files

And this leads to my archivers working perfectly. Who would have thought, that path styles with \ vs / still could pose such an issue in 2023.

NiPfi commented 11 months ago

Awesome, thank you! :smiley: