nms-mod-installer-macos 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,13 @@
1
+ __pycache__/
2
+ *.pyc
3
+ .DS_Store
4
+ _pak_index_cache.json
5
+ _mod_registry.json
6
+ _config.json
7
+ _MOD_BACKUPS/
8
+ filenames.json
9
+ *.pak
10
+ NMS_MOD_INSTALLER.md
11
+ .venv/
12
+ dist/
13
+ *.egg-info/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Enes Salman
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,366 @@
1
+ Metadata-Version: 2.4
2
+ Name: nms-mod-installer-macos
3
+ Version: 0.1.0
4
+ Summary: No Man's Sky mod installer for macOS — HGPAK extract / patch / repack pipeline
5
+ Project-URL: Homepage, https://github.com/Enki013/nms-mod-installer-macos
6
+ Project-URL: Repository, https://github.com/Enki013/nms-mod-installer-macos
7
+ Project-URL: Issues, https://github.com/Enki013/nms-mod-installer-macos/issues
8
+ License: MIT License
9
+
10
+ Copyright (c) 2026 Enes Salman
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ License-File: LICENSE
30
+ Keywords: hgpak,macos,mods,nms,no-mans-sky
31
+ Classifier: Development Status :: 4 - Beta
32
+ Classifier: Environment :: Console
33
+ Classifier: Intended Audience :: End Users/Desktop
34
+ Classifier: License :: OSI Approved :: MIT License
35
+ Classifier: Operating System :: MacOS
36
+ Classifier: Programming Language :: Python :: 3
37
+ Classifier: Programming Language :: Python :: 3.9
38
+ Classifier: Programming Language :: Python :: 3.10
39
+ Classifier: Programming Language :: Python :: 3.11
40
+ Classifier: Programming Language :: Python :: 3.12
41
+ Classifier: Topic :: Games/Entertainment
42
+ Requires-Python: >=3.9
43
+ Requires-Dist: hgpaktool>=1.1.3
44
+ Description-Content-Type: text/markdown
45
+
46
+ # NMS Mod Installer for macOS
47
+
48
+ A command-line tool for installing mods into **No Man's Sky** on macOS by patching HGPAK `.pak` archives.
49
+
50
+ On macOS, the game's built-in `MODS` folder does not work. This tool bridges that gap by extracting `.pak` archives, replacing files with mod contents, and repacking them with LZ4 compression — all automatically.
51
+
52
+ ## How It Works
53
+
54
+ ```
55
+ ┌──────────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
56
+ │ Mod Folder │────>│ Scan & │────>│ Extract │────>│ Replace │────>│ Repack │
57
+ │ │ │ Match │ │ .pak │ │ Files │ │ & Install│
58
+ └──────────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘
59
+ │ │
60
+ Maps mod files LZ4 compressed
61
+ to game .paks HGPAK v2 format
62
+ │
63
+ ▼
64
+ ┌──────────────┐
65
+ │ MACOSBANKS/ │
66
+ │ (game dir) │
67
+ └──────────────┘
68
+ ```
69
+
70
+ 1. **Scan** — Indexes all `.pak` archives in the game and maps each mod file to its target `.pak`
71
+ 2. **Backup** — Copies original `.pak` files to `_MOD_BACKUPS/` before any changes
72
+ 3. **Extract** — Unpacks affected `.pak` archives using `hgpaktool -U -M`
73
+ 4. **Replace** — Overwrites extracted files with mod versions (case-insensitive matching)
74
+ 5. **Repack** — Rebuilds `.pak` archives with LZ4 compression using `hgpaktool -R -Z`
75
+ 6. **Register** — Records installed mod metadata for clean uninstall later
76
+
77
+ ## Requirements
78
+
79
+ - **macOS** (tested on macOS 15+)
80
+ - **Python 3.9+** (pre-installed on macOS)
81
+ - **[hgpaktool](https://github.com/monkeyman192/HGPAKtool)** — HGPAK archive tool by monkeyman192
82
+ - **.NET 8 Runtime** (`Microsoft.NETCore.App 8.x`) — required for EXML-based mods (MBINCompiler)
83
+
84
+ ## Installation
85
+
86
+ ```bash
87
+ # 1. Install hgpaktool
88
+ pip3 install --user hgpaktool
89
+
90
+ # 2. Clone this repo
91
+ git clone https://github.com/Enki013/nms-mod-installer-macos.git
92
+ cd nms-mod-installer-macos
93
+
94
+ # 3. Make executable (required for ./ shortcuts below)
95
+ chmod +x nms_mod_installer.py
96
+ ```
97
+
98
+ Commands below assume your shell’s current directory is the repo folder (`nms-mod-installer-macos` or wherever you cloned it). From anywhere else you can still run `python3 /path/to/nms_mod_installer.py …`.
99
+
100
+ ## Usage
101
+
102
+ ### Set game path (first time only)
103
+
104
+ The tool auto-detects the game in common locations (`/Applications`, `~/Applications`, Steam library). If auto-detection fails, set it manually:
105
+
106
+ ```bash
107
+ ./nms_mod_installer.py set-game "/Applications/No Man's Sky.app"
108
+ ```
109
+
110
+ The path is saved and remembered for future runs. You can also use `--game <path>` with any command to override.
111
+
112
+ ### Scan a mod (preview, no changes)
113
+
114
+ ```bash
115
+ ./nms_mod_installer.py scan ~/Downloads/MyMod
116
+ ```
117
+
118
+ Shows which `.pak` files the mod will affect without modifying anything.
119
+
120
+ ### Interactive wizard (beginner mode)
121
+
122
+ ```bash
123
+ ./nms_mod_installer.py wizard
124
+ ```
125
+
126
+ Step-by-step guided CLI flow for scan/install/list/uninstall without remembering commands.
127
+
128
+ ### Install a mod
129
+
130
+ ```bash
131
+ ./nms_mod_installer.py install ~/Downloads/MyMod
132
+ ```
133
+
134
+ Full pipeline: scan, backup originals, extract, replace, repack, install.
135
+
136
+ <img src="docs/images/install.gif" alt="Install command in terminal">
137
+
138
+ To preview which paks a mod touches without installing, use `scan` (see above).
139
+
140
+ ### List installed mods
141
+
142
+ ```bash
143
+ ./nms_mod_installer.py list
144
+ ```
145
+
146
+ <img src="docs/images/list.png" alt="Installed mods list with index numbers" width="900">
147
+
148
+ ### Uninstall a mod
149
+
150
+ ```bash
151
+ ./nms_mod_installer.py uninstall 2
152
+ # or by name:
153
+ ./nms_mod_installer.py uninstall "MyMod"
154
+ ```
155
+
156
+ Restores original `.pak` files from backup.
157
+
158
+ <img src="docs/images/uninstall.png" alt="Uninstalling a mod by index" width="900">
159
+
160
+ ### Options
161
+
162
+ | Flag | Description |
163
+ |---|---|
164
+ | `--game <path>` | Path to `No Man's Sky.app` (auto-detected or saved via `set-game`) |
165
+ | `--force-reindex` | Rebuild the pak index cache (use after game updates) |
166
+
167
+ ## Mod Folder Structure
168
+
169
+ Mods must mirror the game's internal directory structure. File and folder names are **case-insensitive**.
170
+
171
+ ```
172
+ MyMod/
173
+ ├── LANGUAGE/
174
+ │ └── NMS_LOC1_ENGLISH.MBIN
175
+ ├── FONTS/
176
+ │ └── GAME/
177
+ │ └── CONSOLEFONT2.TTF
178
+ ├── TEXTURES/
179
+ │ └── PLANETS/
180
+ │ └── ...
181
+ └── METADATA/
182
+ └── REALITY/
183
+ └── TABLES/
184
+ └── SOME_TABLE.MBIN
185
+ ```
186
+
187
+ The tool automatically determines which `.pak` archive each file belongs to.
188
+
189
+ ## Example: Turkish Language Patch
190
+
191
+ ```bash
192
+ # Preview
193
+ ./nms_mod_installer.py scan ~/Downloads/Turkish\ Localisation
194
+
195
+ # Output:
196
+ # Mod would affect 3 pak(s):
197
+ # NMSARC.Language.pak (8 files)
198
+ # NMSARC.Precache.pak (1 file)
199
+ # NMSARC.fonts.pak (1 file)
200
+
201
+ # Install
202
+ ./nms_mod_installer.py install ~/Downloads/Turkish\ Localisation
203
+
204
+ # Verify
205
+ ./nms_mod_installer.py list
206
+
207
+ # Uninstall if needed
208
+ ./nms_mod_installer.py uninstall 1
209
+ ```
210
+
211
+ ## Game File Structure (macOS)
212
+
213
+ On macOS, No Man's Sky stores assets differently from Windows:
214
+
215
+ | | Windows | macOS |
216
+ |---|---|---|
217
+ | Archive directory | `GAMEDATA/PCBANKS/` | `GAMEDATA/MACOSBANKS/` |
218
+ | MODS folder | Supported | **Not supported** |
219
+ | Compression | ZSTD | LZ4 |
220
+ | Archive format | HGPAK v2 | HGPAK v2 |
221
+
222
+ ```
223
+ No Man's Sky.app/
224
+ └── Contents/Resources/GAMEDATA/MACOSBANKS/
225
+ ├── NMSARC.Language.pak # Localization strings
226
+ ├── NMSARC.fonts.pak # Game fonts
227
+ ├── NMSARC.Precache.pak # Metadata, dialog tables, UI
228
+ ├── NMSARC.globals.pak # Global game settings
229
+ ├── NMSARC.Materials.pak # Material definitions
230
+ ├── NMSARC.UI.pak # UI definitions
231
+ ├── NMSARC.TexPlanet*.pak # Planet textures (per-biome)
232
+ ├── NMSARC.MeshPlanet*.pak # 3D models
233
+ └── ...
234
+ ```
235
+
236
+ ## Technical Details
237
+
238
+ ### HGPAK Format
239
+
240
+ - **Magic:** `HGPAK\x00\x00\x00` (8 bytes)
241
+ - **Version:** 2 (uint64 LE)
242
+ - **Compression:** LZ4 (macOS), ZSTD (Windows/Linux), Oodle (Switch)
243
+ - Introduced in NMS 5.50 (Worlds Part II), replacing the older PSARC format
244
+
245
+ ### Tool Chain
246
+
247
+ ```bash
248
+ hgpaktool -L <pak> # List contents (outputs filenames.json)
249
+ hgpaktool -U -M <pak> -O <dir> # Extract + generate manifest
250
+ hgpaktool -R -Z <manifest> -O <output.pak> # Repack with compression
251
+ ```
252
+
253
+ ### Caching
254
+
255
+ On first run, the tool scans all `.pak` files and builds an index cache (`_pak_index_cache.json`). This cache is valid for 24 hours. After a game update, use `--force-reindex` to rebuild it.
256
+
257
+ ## Troubleshooting
258
+
259
+ ### Permission denied (do not use `sudo python3`)
260
+
261
+ The installer must write inside `No Man's Sky.app/.../MACOSBANKS/`. If you see **Permission denied**, do **not** run it as `sudo python3 …` (that runs the script as root and can confuse file ownership).
262
+
263
+ **Preferred:** install or copy the game under your user, e.g. `~/Applications/No Man's Sky.app`, so you already own the files.
264
+
265
+ **If the game is in `/Applications` and owned by root**, fix ownership once, then use `./nms_mod_installer.py` as your normal user:
266
+
267
+ ```bash
268
+ sudo chown -R "$(whoami)" "/Applications/No Man's Sky.app"
269
+ ```
270
+
271
+ ### hgpaktool not found
272
+
273
+ ```bash
274
+ pip3 install --user hgpaktool
275
+
276
+ # If not on PATH:
277
+ export PATH="$PATH:$HOME/Library/Python/3.9/bin"
278
+ ```
279
+
280
+ ### .NET runtime mismatch (EXML mods)
281
+
282
+ If you see an error like:
283
+ - `You must install or update .NET to run this application`
284
+ - `Framework: 'Microsoft.NETCore.App', version '8.0.xx'`
285
+
286
+ Install **.NET 8 Runtime** (arm64 on Apple Silicon), then verify:
287
+
288
+ [Download .NET 8](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)
289
+
290
+ ```bash
291
+ dotnet --list-runtimes
292
+ ```
293
+
294
+ You should see `Microsoft.NETCore.App 8.0.x`.
295
+
296
+ ### `.NET` is installed but `dotnet` is not found
297
+
298
+ If you've already installed the .NET SDK but the installer still reports that `dotnet` is missing, try the following:
299
+
300
+ 1. Close and reopen Terminal.
301
+ 2. Verify that .NET is available:
302
+
303
+ ```bash
304
+ dotnet --info
305
+ ```
306
+
307
+ 3. If the command is still not found, ensure the .NET installation directory is in your `PATH`.
308
+
309
+ On macOS (Apple Silicon), add this to your shell profile if necessary:
310
+
311
+ ```bash
312
+ export PATH="$PATH:/usr/local/share/dotnet"
313
+ ```
314
+
315
+ or, if using Homebrew:
316
+
317
+ ```bash
318
+ export PATH="$PATH:/opt/homebrew/share/dotnet"
319
+ ```
320
+
321
+ After updating your `PATH`, restart your terminal and run:
322
+
323
+ ```bash
324
+ dotnet --info
325
+ ```
326
+
327
+ ### Mod stopped working after game update
328
+
329
+ Game updates overwrite `.pak` files. Reinstall the mod:
330
+
331
+ ```bash
332
+ ./nms_mod_installer.py install ~/Downloads/MyMod --force-reindex
333
+ ```
334
+
335
+ ### Game won't launch / crashes
336
+
337
+ Remove mods and restore originals:
338
+
339
+ ```bash
340
+ ./nms_mod_installer.py uninstall "MyMod"
341
+ ```
342
+
343
+ Or manually:
344
+
345
+ ```bash
346
+ cd "No Man's Sky.app/Contents/Resources/GAMEDATA/MACOSBANKS"
347
+ cp _MOD_BACKUPS/MyMod/*.pak ./
348
+ ```
349
+
350
+ ### macOS "damaged app" warning
351
+
352
+ Modifying `.pak` files may break the app's code signature:
353
+
354
+ ```bash
355
+ xattr -cr ~/Applications/No\ Man\'s\ Sky.app
356
+ codesign --force --deep --sign - ~/Applications/No\ Man\'s\ Sky.app
357
+ ```
358
+
359
+ ## License
360
+
361
+ [MIT](LICENSE)
362
+
363
+ ## Credits
364
+
365
+ - **[hgpaktool](https://github.com/monkeyman192/HGPAKtool)** by monkeyman192 — HGPAK extraction and repacking
366
+ - **[Hello Games](https://hellogames.org/)** — No Man's Sky