Skip to content

Add Linux GUI installer via Wine#3

Open
Vic-Nas wants to merge 38 commits into
Bitflash-sh:mainfrom
Vic-Nas:main
Open

Add Linux GUI installer via Wine#3
Vic-Nas wants to merge 38 commits into
Bitflash-sh:mainfrom
Vic-Nas:main

Conversation

@Vic-Nas

@Vic-Nas Vic-Nas commented Jul 26, 2026

Copy link
Copy Markdown

Adds a one-shot installer that runs the Bitflash Windows GUI wallet on Linux via Wine, making the full GUI (including Send Coins) available without needing a separate machine.

What it does:

  • Installs Wine if not present
  • Downloads the latest Windows release from GitHub
  • Extracts and sets up the GUI in ~/.btf-wine/
  • Initializes the Wine environment
  • Optionally imports an existing ~/.bitflash/wallet.dat (converting BDB format automatically via db_dump/db_load)
  • Creates a bitflash command in ~/.local/bin/ that accepts the same args as the node (-gen, -announcerelay, etc.)

Usage after install:

bash install-bitflash-wine.sh
bitflash          # launch GUI
bitflash -gen     # mine

Tested on: Ubuntu 24.04, Wine 9.0

Why this is useful: The headless Linux node has no send functionality — this gives Linux users a GUI wallet with full send capability, and allows importing coins mined by the headless node into the GUI wallet.

Copilot AI review requested due to automatic review settings July 26, 2026 00:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Linux-side installer script intended to bootstrap and run the Bitflash Windows GUI wallet under Wine, including optional wallet import and a convenience bitflash launcher in ~/.local/bin.

Changes:

  • Introduces install-bitflash-wine.sh to install Wine + DB utilities, download the latest Windows GUI release, and extract it into ~/.btf-wine/.
  • Initializes the Wine environment and optionally converts/imports an existing Linux ~/.bitflash/wallet.dat.
  • Creates a bitflash launcher and updates user PATH for easy invocation.
Comments suppressed due to low confidence (7)

install-bitflash-wine.sh:18

  • This block assumes sudo and apt-get are available. If the script is run as root (common for installers) and sudo isn’t installed, or on a non-apt distro, the install step will fail in a confusing way. Prefer the same SUDO pattern used in build-linux.sh and fail fast when apt-get is missing.
if ! command -v wine &>/dev/null; then
    echo "    Installing Wine..."
    sudo apt-get update -qq && sudo apt-get install -y wine
fi

install-bitflash-wine.sh:136

  • The generated launcher doesn’t set WINEPREFIX, so it will always run against the user’s default prefix even if the installer uses a dedicated prefix. This can lead to the GUI using a different data directory than the installer prepared.
cat > "$BIN_DIR/bitflash" << LAUNCHER
#!/usr/bin/env bash
WINEDLLOVERRIDES="libdb_cxx-6.2=n" wine "$INSTALL_DIR/bitflash.exe" "\$@"
LAUNCHER

install-bitflash-wine.sh:58

  • unzip is used but never checked/installed, and the unzip | grep ... || true pipeline masks unzip failures (the script may proceed even if extraction failed). Install unzip if missing and preserve unzip’s exit code while filtering warnings.
rm -rf "$INSTALL_DIR"
mkdir -p "$INSTALL_DIR"
echo "    Running unzip -j..."
unzip -j "$TMPZIP" -d "$INSTALL_DIR" 2>&1 | grep -v "^warning" || true
echo "    Files after extract: $(ls "$INSTALL_DIR" | wc -l)"

install-bitflash-wine.sh:94

  • If Wine never creates wallet.dat within the timeout, the script still continues and later steps will operate on a non-initialized prefix/data dir. It should fail with a clear error when initialization doesn’t complete.
# Wait until wallet.dat is created, max 30 seconds
for i in $(seq 1 30); do
    sleep 1
    if [ -f "$WINE_DATA/wallet.dat" ]; then
        echo "    wallet.dat created after ${i}s"

install-bitflash-wine.sh:121

  • Importing overwrites the GUI wallet file without taking a backup. Re-running the installer (or importing by mistake) could cause irreversible wallet loss. Create a timestamped backup of the existing Wine wallet before copying the converted file in place.
        echo "    Installing converted wallet..."
        cp "$CONVERTED" "$WINE_DATA/wallet.dat"
        rm "$DUMP" "$CONVERTED"

install-bitflash-wine.sh:142

  • This appends to ~/.bashrc based on the current PATH, which can cause duplicate entries on repeated runs (e.g., if PATH is customized elsewhere). It’s safer to check whether the exact export line is already present in ~/.bashrc before appending, and to use $BIN_DIR consistently.
if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
    echo "==> Adding ~/.local/bin to PATH..."
    echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$HOME/.bashrc"
fi

install-bitflash-wine.sh:49

  • The download step doesn’t fail on HTTP errors and doesn’t retry transient failures, which can lead to corrupted/partial downloads being executed. At minimum, make curl fail fast and retry; ideally also verify a published checksum/signature for the release asset.
curl -L -o "$TMPZIP" "$RELEASE_URL"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread install-bitflash-wine.sh
Comment on lines +1 to +3
#!/usr/bin/env bash
# Bitflash GUI installer for Linux (via Wine)

Comment thread install-bitflash-wine.sh
Comment on lines +4 to +8
INSTALL_DIR="$HOME/.btf-wine"
WINE_DATA="$HOME/.wine/drive_c/users/$USER/AppData/Roaming/Bitflash"
LINUX_DATA="$HOME/.bitflash"
BIN_DIR="$HOME/.local/bin"
REPO="Bitflash-sh/bitflash"
Vic-Nas and others added 26 commits July 25, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants