Skip to content
This repository was archived by the owner on Dec 25, 2025. It is now read-only.

Add Windows PowerShell Version#7

Open
Silent369 wants to merge 1 commit intocheatfreak47:mainfrom
Silent369:Silent369-powershell-1
Open

Add Windows PowerShell Version#7
Silent369 wants to merge 1 commit intocheatfreak47:mainfrom
Silent369:Silent369-powershell-1

Conversation

@Silent369
Copy link
Copy Markdown

Converted NMS-Decompressinator to PowerShell.

This script searches the registry for both Gog and Steam Installation Paths to ascertain the installation path for No Man's Sky It then uses this information to present the user with a choice as to which path they wish the script to act upon (Gog or Steam).

The main advantage is to mitigate the requirement of placing the script and tools into the game directory to perform its functions. This is no longer required in this version as long as this script and the tools reside within the same directory, it will work since this script accounts for its location and where the tools reside.

It also includes some basic error checking in order to report to the user if certain conditions are not met. If no installations for the game are found. Or if the tools (psarc.exe / NMSResign.exe) are not found in the script directory.

I also took the liberty of styling the output to try and give a consistent interface when the script is operating or reporting errors to the user. This is purely aesthetic and doesn't interfere with the functionality.

It has been tested multiple times with both the Gog and Steam versions of the game and functions as expected.

Converted NMS-Decompressinator to PowerShell.

This script searches the registry for both Gog and Steam Installation Paths to ascertain the installation path for No Man's Sky
It then uses this information to present the user with a choice as to which path they wish the script to act upon (Gog or Steam).

The main advantage is to mitigate the requirement of placing the script and tools into the game directory to perform its functions.
This is no longer required in this version as long as this script and the tools reside within the same directory, it will work since this
script accounts for its location and where the tools reside.

It also includes some basic error checking in order to report to the user if certain conditions are not met. If no installations for the
game are found. Or if the tools (psarc.exe  / NMSResign.exe) are not found in the script directory. 

I also took the liberty of styling the output to try and give a consistent interface when the script is operating or reporting errors to
the user. This is purely aesthetic and doesn't interfere with the functionality.

It has been tested multiple times with both the Gog and Steam versions of the game and functions as expected.
@cheatfreak47
Copy link
Copy Markdown
Owner

A Powershell version is fine but looking over the install detection code, it appears to make a pretty bad assumption about the user's game install directory- which is that it will always be in the location of Steam itself. Many people keep a library on another disk, which would cause it to fail to detect the game even though it is installed. Worst yet is that Steam does report a location in the "Uninstall" entry for the game under location for the game in the registry but not even that is a reliable source of the true location, since this key doesn't get updated if you move the game with steam, and it may not exist at all for migrated libraries.

Anyway, in light of this, I'd like to request a couple of changes before merging this, it's fine to have automatic install detection if it's ran from another folder, however, it should before jumping to that detection code, check if the folder it is currently in contains pak files and if it does, it will assume it is located in the PCBANKS folder and bypass all install detection code- keeping the original behavior

In addition, it'd be good for you to check the uninstall reg key as well in case that contains the correct path for the game first before guessing it may be in the steam install folder

Usually you can find an "InstallLocation" key in
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 275850"
that contains the path to the game, assuming the user didn't move the game around or migrate the library from another PC.

@cheatfreak47
Copy link
Copy Markdown
Owner

cheatfreak47 commented Aug 6, 2024

this error also kind of sucks, the pak detection, if it fails after auto-path detect should report that it was not able to find the user's copy of the game, and that inline with the original behavior, they can move the script and tools to the PCBANKS folder to get it working

Please correct the working directory: No Man's Sky\GAMEDATA\PCBANKS.

most users won't really understand what this means or what they should do to fix it

@Silent369
Copy link
Copy Markdown
Author

All valid points and an oversight on my behalf. I'll effect the changes proposed. Thanks for the feedback.

@cheatfreak47 cheatfreak47 added the changes requested Changes requested for the pull to be accepted label Aug 7, 2024
@cheatfreak47 cheatfreak47 requested review from cheatfreak47 and removed request for cheatfreak47 August 7, 2024 09:44
@m0lz
Copy link
Copy Markdown

m0lz commented Aug 29, 2024

I dont know if this has been thought of but the same can be said of GOG installations, the user can change the Galaxy Games installation location any time.
Plus GOG Manual Installers may have been used instead of Galaxy, and at install time the default path changed

@cheatfreak47 cheatfreak47 added the stale pull applied to old pulls that haven't seen updates in a long time label Sep 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

changes requested Changes requested for the pull to be accepted stale pull applied to old pulls that haven't seen updates in a long time

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants