Background

Skyblock by Asma

ModsSkyblock by Asma
Skyblock by Asma

Skyblock by Asma

CurseForge
AdventureSurvival

Jump across multiple islands in Asma’s Skyblock experience for Hytale! 🇮🇹 Salta tra le varie isole nell’esperienza Skyblock di Asma per Hytale!

install.bat - Technical Documentation

Overview

install.bat is a Windows batch script designed to automate the installation of the Skyblock by Asma mod into the Hytale saves directory. It provides a user-friendly interface with color-coded output and supports both automated and manual folder detection.

Features

  • Automatic folder detection: Searches for folders matching the pattern Skyblock_by_Asma_v*
  • Custom folder support: Accepts a folder name as a command-line argument
  • Dry-run mode: Preview installation without making changes
  • Color-coded output: ANSI color codes for better readability
  • Overwrite protection: Prompts user before overwriting existing installations
  • Version extraction: Automatically extracts version from folder name or uses folder name as fallback

Command-Line Arguments

Syntax

install.bat [FolderName] [/dry-run | /d | --dry-run] [/? | /help | --help]

Arguments

Argument Description Example
FolderName Optional. Name of the folder to install. If not provided, searches for Skyblock_by_Asma_v* pattern. install.bat "MyCustomFolder"
/dry-run Optional. Run in dry-run mode (no changes will be made). install.bat /dry-run
/d Short form of /dry-run install.bat /d
--dry-run Alternative form of /dry-run install.bat --dry-run
/?, /help, --help Display help information install.bat /?

Examples

# Default behavior - auto-detect folder
install.bat

# Specify custom folder name
install.bat "MyCustomFolder"

# Dry-run with default folder
install.bat /dry-run

# Dry-run with custom folder
install.bat "MyCustomFolder" /dry-run

# Display help
install.bat /help

Technical Implementation

Color System

The script uses ANSI escape codes for color output. Colors are defined at the start:

  • RED (31): Error messages
  • GREEN (32): Success messages and found items
  • YELLOW (33): Warnings and cancellation messages
  • CYAN (36): Information, paths, and headers
  • MAGENTA (35): Dry-run mode indicators
  • BOLD (1): Emphasis on important text
  • RESET (0): Reset to default color

ANSI support is enabled by extracting the escape character using echo prompt $E | cmd.

Folder Detection Logic

  1. Custom Folder Name (if provided):

    • Validates that the folder exists in the script's directory
    • Checks that it's actually a folder (not a file)
    • Uses the provided path directly
  2. Default Pattern (if no folder name provided):

    • Searches for folders matching Skyblock_by_Asma_v* pattern
    • Uses the first matching folder found
    • Exits with error if no match is found

Version Extraction

The script attempts to extract version information from the folder name:

  1. Pattern Match: If folder name matches Skyblock_by_Asma_v*, extracts everything after Skyblock_by_Asma_v as the version
  2. Fallback: If pattern doesn't match, uses the entire folder name as the version identifier

Example:

  • Folder: Skyblock_by_Asma_v1.0.4 → Version: 1.0.4
  • Folder: MyCustomFolder → Version: MyCustomFolder

Destination Path Construction

The destination path is constructed as:

%APPDATA%\Hytale\UserData\Saves\Skyblock_by_Asma_v{VERSION}

Where {VERSION} is the extracted version or folder name.

Installation Process

  1. Validation:

    • Verifies source folder exists
    • Checks if destination directory structure exists (creates if needed)
  2. Overwrite Check:

    • If destination folder exists, prompts user for confirmation
    • User can choose to overwrite (Y) or cancel (N)
  3. File Operations (only in non-dry-run mode):

    • Removes existing installation if overwrite confirmed
    • Creates destination directory structure if needed
    • Copies all files using xcopy /E /I /Y (recursive, assume destination is directory, suppress prompts)
  4. Error Handling:

    • Validates folder existence before proceeding
    • Checks file operation success
    • Provides clear error messages with troubleshooting tips

Dry-Run Mode

When dry-run mode is enabled:

  • All file operations are skipped
  • Output is prefixed with [DRY-RUN]
  • Shows what would happen without making changes
  • Useful for testing and verification

Error Handling

The script handles several error conditions:

  1. Folder Not Found: Exits with error code 1, displays helpful message
  2. Invalid Folder: If path exists but isn't a folder, exits with error
  3. Copy Failure: Checks xcopy exit code, displays troubleshooting tips
  4. User Cancellation: Exits with code 0 (normal exit)

Exit Codes

  • 0: Success or user cancellation
  • 1: Error (folder not found, copy failure, etc.)

Dependencies

  • Windows: Designed for Windows batch scripting (cmd.exe)
  • ANSI Support: Requires Windows 10/11 or terminal with ANSI support for colors
  • xcopy: Uses built-in Windows xcopy command for file copying

Environment Variables

The script uses the following environment variables:

  • %APPDATA%: Windows application data directory (typically C:\Users\{Username}\AppData\Roaming)
  • %~dp0: Script's directory path (automatically set by batch processor)
  • %CD%: Current working directory

Limitations

  1. Windows Only: Designed specifically for Windows batch scripting
  2. ANSI Colors: Color output requires ANSI-capable terminal (Windows 10/11 default terminal)
  3. Single Folder: Only processes one folder at a time
  4. No Rollback: Does not provide rollback functionality if installation fails mid-process

Future Enhancements

Potential improvements:

  • Support for multiple folder installations
  • Backup creation before overwrite
  • Installation log generation
  • Support for custom destination paths
  • Progress indicator for large file copies

See Also

  • INSTALL.en.md: User-friendly English installation guide
  • INSTALL.it.md: User-friendly Italian installation guide
Skyblock by Asma - Hytale Mod | Hytale Wiki