Mord3rca / gamma-launcher

Just another Launcher to setup S.T.A.L.K.E.R.: G.A.M.M.A.
GNU General Public License v3.0
91 stars 14 forks source link

Support for tilde expansion #174

Open dhasial opened 3 days ago

dhasial commented 3 days ago

I keep getting the same result no matter if the downloads directory is a symlink to the cache, a normal, empty directory, or even if the entire GAMMA directory is moved somewhere else.

gamma-launcher gamma-setup --anomaly ~/Games/fastergames/Anomaly --gamma ~/Games/fastergames/GAMMA --cache-directory ~/.cache/gammacache

[+] Installing base setup for GAMMA
Extracting /home/$USER/.cache/gammacache/modorganizer-Mod.Organizer-2.4.4.7z
Traceback (most recent call last):
  File "/home/$USER/src/gamma-launcher/env/bin/gamma-launcher", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/$USER/src/gamma-launcher/env/lib/python3.12/site-packages/launcher/cli.py", line 113, in main
    args.cobject().run(args)
  File "/home/$USER/src/gamma-launcher/env/lib/python3.12/site-packages/launcher/commands/install.py", line 129, in run
    downloads_dir.rmdir()
  File "/usr/lib/python3.12/pathlib.py", line 1351, in rmdir
    os.rmdir(self)
FileNotFoundError: [Errno 2] No such file or directory: '/home/$USER/Games/fastergames/GAMMA/downloads'

I'm on the lastest commit, 3ea98fb4

Mord3rca commented 2 days ago

Hey !

175 should do the trick. Can you try ? Thanks

dhasial commented 1 day ago

I ended up having to reinstall completely with the full-install command, as I ran out of drive space with both GAMMA and Stalker 2 on my drive.

While I think it's technically a different case now because of that, it seemed to run past the point I was running into before until I got here in the output

[+] Installing mod: Milspec PDA
Extracting /home/$USER/Games/fastergames/GAMMA/downloads/Catspaw_Milspec_PDA-1.14.1.zip
Traceback (most recent call last):
  File "/home/$USER/src/gamma-launcher/env/bin/gamma-launcher", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/$USER/src/gamma-launcher/env/lib/python3.12/site-packages/launcher/cli.py", line 113, in main
    args.cobject().run(args)
  File "/home/$USER/src/gamma-launcher/env/lib/python3.12/site-packages/launcher/commands/install.py", line 304, in run
    self._install_mods()
  File "/home/$USER/src/gamma-launcher/env/lib/python3.12/site-packages/launcher/commands/install.py", line 253, in _install_mods
    mod.install(self._mod_dir)
  File "/home/$USER/src/gamma-launcher/env/lib/python3.12/site-packages/launcher/mods/installer/default.py", line 68, in install
    with DefaultTempDir(self, prefix="gamma-launcher-modinstall-") as pdir:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/$USER/src/gamma-launcher/env/lib/python3.12/site-packages/launcher/mods/tempfile.py", line 49, in __enter__
    getattr(self, hotfix)(s)
  File "/home/$USER/src/gamma-launcher/env/lib/python3.12/site-packages/launcher/mods/tempfile.py", line 32, in _post_decompression_hotfix_00_malformed_archive
    p.parent.mkdir(parents=True, exist_ok=True)
  File "/usr/lib/python3.12/pathlib.py", line 1311, in mkdir
    os.mkdir(self, mode)
FileExistsError: [Errno 17] File exists: '/tmp/gamma-launcher-modinstall-abq3iqxm/00. Milspec PDA with Kill Tracker (required)/gamedata'

I'm not sure if it's related to the original bug. I did try wiping everything a second time, and got the exact same error.

Also, if I manage to get past this point and fully install it, and then get the original bug again, I'll update this issue.

Mord3rca commented 1 day ago

~See #176~ Now merged.

Mord3rca commented 1 day ago

175 was updated. Now it should fix your issue (caused by using ~ in path)

Ganikoo commented 17 hours ago

While updating my existing Gamma installation i get a similar looking error.

I am using the gamma launcher 2.1 release: ./gamma-launcher-2-1 full-install --anomaly ./Anomaly --gamma ./gamma --cache-directory ./cache

Error: [+] Installing mod: Milspec PDA Extracting gamma/downloads/Catspaw_Milspec_PDA-1.14.1.zip Traceback (most recent call last): File "gamma-launcher.py", line 8, in <module> File "launcher/cli.py", line 113, in main File "launcher/commands/install.py", line 304, in run File "launcher/commands/install.py", line 253, in _install_mods File "launcher/mods/installer/default.py", line 68, in install File "launcher/mods/tempfile.py", line 49, in __enter__ File "launcher/mods/tempfile.py", line 32, in _post_decompression_hotfix_00_malformed_archive File "pathlib.py", line 1116, in mkdir NotADirectoryError: [Errno 20] Not a directory: '/tmp/gamma-launcher-modinstall-botdno8_/02. Legacy Non-DLTX Mapspots and Crafting (DO NOT use with GAMMA or other modded exes)/gamedata/configs/ui'

Extracting the zip Catspaw_Milspec_PDA-1.14.1.zip manually like "right click file in file manager => extract here", creates an empty folder "Catspaw_Milspec_PDA-1.14.1". If i extract the archive a second time, the new folder "Catspaw_Milspec_PDA-1.14 (1).1" contains all the files from the archive.

Mord3rca commented 17 hours ago

@Ganikoo Yeah, this archive is not correctly created. A fix has been made for this, make sure to use master branch and pip installation. (see #176 )