diff --git a/.gitignore b/.gitignore
index cad8fe1..f30c023 100644
--- a/.gitignore
+++ b/.gitignore
@@ -546,4 +546,3 @@ FodyWeavers.xsd
.idea/**
*.s2pk
s2pk.toml
-dist/**
diff --git a/Config.cs b/Config.cs
deleted file mode 100644
index b896468..0000000
--- a/Config.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-namespace S2PK;
-
-public class Config
-{
- public Destinations Paths { get; set; } = new();
-
- ///
- /// Loads the configuration from the specified file path.
- ///
- /// The path to the configuration file.
- /// The loaded configuration.
- public static Config Load(string path)
- {
- var file = File.ReadAllText(path);
- var config = Toml.ToModel(file);
- return config ?? throw new FileNotFoundException("Configuration file not found.");
- }
-}
-
-public class Destinations
-{
- public string Sims2 { get; set; } = string.Empty;
- public string Sims3 { get; set; } = string.Empty;
-}
diff --git a/GlobalUsing.cs b/GlobalUsing.cs
deleted file mode 100644
index 800695e..0000000
--- a/GlobalUsing.cs
+++ /dev/null
@@ -1,2 +0,0 @@
-global using S2PK;
-global using Tomlyn;
diff --git a/Makefile b/Makefile
deleted file mode 100644
index f3f883a..0000000
--- a/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-# Makefile for building and packaging the Sims 2 .s2pk CLI tool
-
-APP_NAME = s2pk
-CONFIGURATION = Release
-RUNTIME_LINUX = linux-x64
-RUNTIME_MAC = osx-x64
-OUTPUT_DIR = ./dist
-
-.PHONY: all clean build-linux build-mac package-linux package-mac
-
-all: build-linux build-mac package-linux package-mac
-
-clean:
- rm -rf bin obj $(OUTPUT_DIR)
-
-build-linux:
- dotnet publish -c $(CONFIGURATION) -r $(RUNTIME_LINUX) --self-contained true /p:PublishSingleFile=true -o $(OUTPUT_DIR)/$(APP_NAME)-linux
-
-build-mac:
- dotnet publish -c $(CONFIGURATION) -r $(RUNTIME_MAC) --self-contained true /p:PublishSingleFile=true -o $(OUTPUT_DIR)/$(APP_NAME)-mac
-
-package-linux:
- tar -czvf $(OUTPUT_DIR)/$(APP_NAME)-linux.tar.gz -C $(OUTPUT_DIR)/$(APP_NAME)-linux .
-
-package-mac:
- tar -czvf $(OUTPUT_DIR)/$(APP_NAME)-mac.tar.gz -C $(OUTPUT_DIR)/$(APP_NAME)-mac .
diff --git a/PackageManger.cs b/PackageManger.cs
index ace0601..38d2ab5 100644
--- a/PackageManger.cs
+++ b/PackageManger.cs
@@ -1,4 +1,4 @@
-namespace S2PK;
+namespace S2Pkg;
using System.IO.Compression;
@@ -6,25 +6,11 @@ public static class PackageManager
{
const string PackageExtension = ".package";
const string S2pkExtension = ".s2pk";
- const string S3pkExtension = ".s3pk";
- ///
- /// Returns the extension for the package file.
- ///
- /// Whether to use the Sims 3 extension.
- /// The extension for the package file.
- static string ExtensionHandler(bool ts3 = false) => ts3 ? S3pkExtension : S2pkExtension;
-
- ///
- /// Packs a directory into a package file.
- ///
- /// The source directory.
- /// The output package file.
- public static void PackPackages(string source, string package, bool ts3 = false)
+ public static void PackPackages(string source, string output)
{
var dir = new DirectoryInfo(source);
- var file = new FileInfo(package);
- var extension = ExtensionHandler(ts3);
+ var file = new FileInfo(output);
if (!dir.Exists)
{
@@ -50,36 +36,8 @@ public static class PackageManager
Console.WriteLine($"Created {file.FullName} with {packageFiles.Length} files.");
}
- ///
- /// Unpacks a package file into a destination directory.
- ///
- /// The path to the package file.
- /// The destination directory. If not provided, the destination is read from the configuration file.
- /// Whether to unpack for The Sims 3.
- public static void UnpackPackages(string package, string destination = "", bool ts3 = false)
+ public static void UnpackPackages(string package, string destination)
{
- var extension = ExtensionHandler(ts3);
-
- // If destination is not provided, read from configuration file
- if (string.IsNullOrEmpty(destination))
- {
- var config = Config.Load("s2pk.toml"); // TODO: Config file should be in home directory
-
- // If The Sims 3 is not specified, use the default destination
- if (!ts3)
- destination = config.Paths.Sims2;
- else
- destination = config.Paths.Sims3;
- }
-
- // Check if destination directory exists
- if (!Directory.Exists(destination))
- {
- Console.Error.WriteLine("Destination directory does not exist.");
- return;
- }
-
-
var file = new FileInfo(package);
var dir = new DirectoryInfo(destination);
@@ -89,20 +47,6 @@ public static class PackageManager
return;
}
-
- if (!file.FullName.Contains(extension))
- {
- Console.Error.WriteLine("Package file is not a valid.");
- return;
- }
-
- // Check for extension mismatch
- if (file.FullName.Contains(S3pkExtension) && !ts3)
- {
- Console.Error.WriteLine("Package is for The Sims 3 but unpacking for The Sims 2.");
- return;
- }
-
dir.Create(); // Ensures directory exists
using var archive = ZipFile.OpenRead(file.FullName);
diff --git a/Program.cs b/Program.cs
index 6ab3c17..307e2e7 100644
--- a/Program.cs
+++ b/Program.cs
@@ -1,12 +1,8 @@
+using S2Pkg;
using System.CommandLine;
var rootCommand = new RootCommand("The Sims 2 .s2pk Package Manager");
-var sims3option = new Option(
- aliases: ["--ts3"],
- description: "Switch to The Sims 3 mode.",
- getDefaultValue: () => false);
-
var sourceOption = new Option(
aliases: ["--source", "-s"],
description: "Source directory containing .package files")
@@ -24,10 +20,10 @@ var packCommand = new Command("pack", "Packs .package files into a .s2pk archive
outputOption
};
-packCommand.SetHandler((source, output, sims3) =>
+packCommand.SetHandler((source, output) =>
{
- PackageManager.PackPackages(source, output, sims3);
-}, sourceOption, outputOption, sims3option);
+ PackageManager.PackPackages(source, output);
+}, sourceOption, outputOption);
var packageOption = new Option(
aliases: ["--package", "-p"],
@@ -36,7 +32,8 @@ var packageOption = new Option(
var destinationOption = new Option(
aliases: ["--destination", "-d"],
- description: "Destination directory (e.g., The Sims 2 Downloads folder)");
+ description: "Destination directory (e.g., The Sims 2 Downloads folder)")
+{ IsRequired = true };
// Unpack command
var unpackCommand = new Command("unpack", "Unpacks a .s2pk archive to the Downloads folder")
@@ -45,10 +42,10 @@ var unpackCommand = new Command("unpack", "Unpacks a .s2pk archive to the Downlo
destinationOption
};
-unpackCommand.SetHandler((package, destination, sims3) =>
+unpackCommand.SetHandler((package, destination) =>
{
- PackageManager.UnpackPackages(package, destination, sims3);
-}, packageOption, destinationOption, sims3option);
+ PackageManager.UnpackPackages(package, destination);
+}, packageOption, destinationOption);
// Register commands
rootCommand.AddCommand(packCommand);
diff --git a/README.md b/README.md
index 85574da..acb2f45 100644
--- a/README.md
+++ b/README.md
@@ -2,33 +2,18 @@
S2PK, or Sims 2 Package Manager, aims to provide a simple cross-platform solution to package management.
-## β Why This Exists
+## π‘ Why This Exists
-While The Sims 2 runs well on Linux through Wine, especially with Lutris setups, and natively from macOS, only the Windows community had varies mod managers and installers compared to their cross-platform counterparts. Later installments addressed this dilemma, but TS2 never got that treatment.
-
-`s2pk` aims to fill this gap: a no-nonsense CLI utility for packaging, sharing, and managing mods across all platforms. Itβs small, clean, and plays nicely with scripts, backups, and version control. In theory, it would be possible to use it on legacy front ends.
-
-## π Features
-
-- First-class CLI support for modders on non-Windows platforms
-- Custom default unpacking directory for The Sims 2 & 3
-- Pack `.packages` into portable `.s2pk` archives
+S2PK was created to address the need for a reliable and efficient cross-platform package management system for The Sims 2 on Linux and macOS. Players on these platforms often face challenges in managing mods due to the lack of a unified solution that their Windows counterparts solved a long time ago.
## π£οΈ Project Roadmap
| Phase | Goal | Status |
| ----- | ------------------------------------------- | ------ |
-| v0.1 | Core package manager | β
|
-| v0.2 | Config file with default paths | β
|
-| v0.3 | Sims 3 support with `s3pk` extention | π |
-| v0.x | Target .NET 10 | π |
+| v0.1 | Core package manager | β
|
+| v0.2 | Config file with default destination | π |
| v1.0 | Stable "Release" version with documentation | π |
-## π― Stretch Goals
-
-- [ ] Manifest validation
-- [ ] `s1pk` soft fork
-
## π§© Tech Stack
- .NET 8.0
@@ -36,28 +21,7 @@ While The Sims 2 runs well on Linux through Wine, especially with Lutris setups,
- System.CommandLine for CLI parsing (no external libraries)
- Pure backend logic (no UI planned)
-## π Design Principles
-
-- Stay true to UNIX design philosophy
-- Simple with no bloat or feature creep
-- Portable and clean
-
-## π οΈ Installation
-
-You can build yourself with `make`, or use the installer script:
-
-```shell
-./install.sh ./dist/s2pk-linux/s2pk
-```
-
-Make sure `~/.local/bin` is in your `PATH`:
-
-```shell
-echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
-source ~/.bashrc
-```
-
-## ποΈ Usage
+## Example
```shell
s2pk pack -s ./mods -o output.s2pk
@@ -73,7 +37,7 @@ s2pk unpack -p ./output.s2pk -d "%USERPROFILE%\Documents\EA Games\The Sims 2\Dow
| ------------ | ---------------- | ---------------------------------------- |
| Minor Update | Every 3β6 months | Small enhancements, non-breaking changes |
| Patch Update | As needed | Bug fixes, security updates |
-| Major Update | As needed | Framework upgrades, major refactors |
+| Major Update[^1] | As needed | Framework upgrades, major refactors |
- Reserve months: June (Mid-Year Chill) & December (End-Year Freeze)
@@ -92,6 +56,10 @@ s2pk unpack -p ./output.s2pk -d "%USERPROFILE%\Documents\EA Games\The Sims 2\Dow
- Critical vulnerabilities
- Framework-breaking issues
+## π Footnotes
+
+- [^1]: At this early stage, major updates bump the minor version number. This usually involves re-targeting to the newest .NET LTS.
+
## ποΈ License
I license this project under the GPL v3 license - see [LICENSE](LICENSE) for details.
diff --git a/S2PK.csproj b/S2PK.csproj
index 9adff19..48a4c19 100644
--- a/S2PK.csproj
+++ b/S2PK.csproj
@@ -3,7 +3,7 @@
Exe
net8.0
- 0.3.101
+ 0.1.101
enable
enable
Tony Bark
@@ -13,8 +13,8 @@
+
-
diff --git a/install.sh b/install.sh
deleted file mode 100644
index 20a5fda..0000000
--- a/install.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-
-# Install s2pkg locally for current user (no sudo)
-# Usage: ./install.sh ./dist/s2pkg-linux/s2pkg
-
-set -e
-
-SOURCE_BIN="$1"
-INSTALL_DIR="$HOME/.local/bin"
-TARGET="$INSTALL_DIR/s2pkg"
-
-if [[ ! -x "$SOURCE_BIN" ]]; then
- echo "β Error: Provide a valid built s2pkg binary as the first argument."
- exit 1
-fi
-
-mkdir -p "$INSTALL_DIR"
-cp "$SOURCE_BIN" "$TARGET"
-chmod +x "$TARGET"
-
-if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then
- echo "β οΈ $INSTALL_DIR is not in your PATH. Consider adding this to your shell profile:"
- echo " export PATH=\"\$HOME/.local/bin:\$PATH\""
-else
- echo "β
Installed s2pkg to $TARGET"
- echo "Run 's2pkg --help' to get started."
-fi
diff --git a/s2pk.toml.sample b/s2pk.toml.sample
index 3399cb5..5f2bf08 100644
--- a/s2pk.toml.sample
+++ b/s2pk.toml.sample
@@ -1,3 +1 @@
-[paths]
-sims2 β‘ "path/to/sims2"
-sims3 β‘ "path/to/sims3"
+destination β‘ "path/to/destination"