๐Ÿ“ฆ BSArch Installation Guide - Realistic & User-Friendly Approach

๐ŸŽฏ The Problem with Automatic Downloads

Original approach had issues:

๐Ÿš€ Our Smart Solution: Guided Manual Setup

Instead of trying to automate what canโ€™t be automated, we guide users through the process and automate everything we can.

๐ŸŽฎ User Experience

Step 1: User Downloads

๐Ÿ’ก For optimal performance, install BSArch: https://www.nexusmods.com/newvegas/mods/64745?tab=files
๐Ÿ’ก Or use: safe-resource-packer --install-bsarch for guided setup

Step 2: We Handle Everything Else

safe-resource-packer --install-bsarch

What happens:

  1. ๐Ÿ” Auto-search Downloads folder - Finds BSArch files automatically
  2. ๐Ÿ“ฆ Extract from archives - Handles .zip, .7z files intelligently
  3. ๐Ÿ”ง Install to proper location - Sets up in system directories
  4. ๐Ÿ› ๏ธ Configure PATH - Makes BSArch globally available
  5. โœ… Verify installation - Confirms everything works

๐Ÿ” Smart Search Strategy

Search Locations (in order):

  1. Downloads folder - ~/Downloads, C:/Users/*/Downloads
  2. Desktop - Common alternative location
  3. System-wide search - If user agrees (can be slow)

Search Patterns (case-insensitive):

File Types Handled:

๐Ÿ› ๏ธ Technical Implementation

Search Process:

def find_bsarch_in_downloads(self) -> Optional[str]:
    patterns = ['*bsarch*', '*BSArch*', '*BSARCH*']

    for download_dir in self.common_download_dirs:
        for pattern in patterns:
            # Look for archives first
            for ext in ['.zip', '.7z', '.rar']:
                for file_path in Path(download_dir).glob(pattern + ext):
                    return str(file_path)

            # Look for direct executables
            for file_path in Path(download_dir).glob(pattern + '.exe'):
                return str(file_path)

Archive Extraction:

def extract_bsarch_from_archive(self, archive_path: str) -> Optional[str]:
    # Support multiple formats
    if archive_path.lower().endswith('.zip'):
        success = self._extract_zip(archive_path, temp_dir)
    elif archive_path.lower().endswith('.7z'):
        success = self._extract_7z(archive_path, temp_dir)

    # Find BSArch.exe (case-insensitive)
    for root, dirs, files in os.walk(temp_dir):
        for file in files:
            if file.lower() in ['bsarch.exe', 'bsarch']:
                return os.path.join(root, file)

Installation Process:

def _install_bsarch_executable(self, source_path: str) -> Tuple[bool, str]:
    # Copy to proper location
    target_path = os.path.join(self.install_dir, target_name)
    shutil.copy2(source_path, target_path)

    # Make executable (Linux/macOS)
    if self.system != 'windows':
        os.chmod(target_path, 0o755)

    # Verify installation
    return self.is_bsarch_available()

๐ŸŽฏ User Journey Examples

Scenario 1: Perfect Case

1. User downloads BSArch from Nexus to Downloads folder
2. Runs: safe-resource-packer --install-bsarch
3. Tool finds BSArch.zip automatically
4. Extracts BSArch.exe
5. Installs and configures PATH
6. โœ… Ready to create optimal BSA/BA2 archives!

Scenario 2: Different Location

1. User downloaded BSArch to Desktop
2. Runs installer
3. Not found in Downloads โ†’ searches Desktop
4. Finds and installs successfully
5. โœ… Works perfectly!
1. User has BSArch somewhere on system
2. Runs installer
3. Not found in common locations
4. Tool asks: "Search entire system? (may be slow)"
5. User agrees โ†’ finds BSArch anywhere on system
6. โœ… Installation successful!

Scenario 4: Guidance Needed

1. User runs installer
2. BSArch not found anywhere
3. Tool provides clear instructions:
   - Exact Nexus URL
   - What file to download
   - Where to save it
   - How to run installer again
4. โœ… User knows exactly what to do!

๐Ÿ’ก Benefits of This Approach

โœ… For Users:

โœ… For Developers:

โœ… For Tool Ecosystem:

๐Ÿ”ง Installation Commands

Main Installation:

# Guided BSArch setup
safe-resource-packer --install-bsarch

Console UI Integration:

# Interactive interface includes BSArch installer
safe-resource-packer
# โ†’ Choose "Tools" โ†’ "Install BSArch"

Help and Guidance:

# Shows installation instructions
safe-resource-packer --help
# Look for "PACKAGING OPTIONS" section

๐Ÿ“‹ What Users See

Clear Messaging:

โš ๏ธ  WARNING: BSA/BA2 creation tools not found!
โš ๏ธ  Creating ZIP archive instead of BSA (not optimal for game performance)
๐Ÿ’ก For optimal performance, download BSArch: https://www.nexusmods.com/newvegas/mods/64745?tab=files
๐Ÿ’ก Or use: safe-resource-packer --install-bsarch for guided setup

Installation Process:

๐Ÿ”ง Setting up BSArch for optimal BSA/BA2 creation...
๐Ÿ” Searching for BSArch in download directories...
โœ… Found BSArch file: /home/user/Downloads/BSArch_v0.9.zip
๐Ÿ“ฆ Extracting BSArch from: /home/user/Downloads/BSArch_v0.9.zip
โœ… Found BSArch executable: /tmp/bsarch_extract_xyz/BSArch.exe
๐Ÿ“‹ Copied BSArch to: /home/user/.local/bin/BSArch.exe
๐Ÿ”ง Made BSArch executable
โœ… BSArch installed and available!

๐ŸŽŠ Perfect Balance

This approach achieves the perfect balance between automation and user control:

Result: Users get optimal BSA/BA2 creation with minimal effort and maximum reliability! ๐ŸŒŸ