#!/bin/bash
install_packages yad aria2 udftools cabextract wimtools chntpw genisoimage exfat-fuse wget exfatprogs '|' exfat-utils || exit 1

git_clone https://github.com/Botspot/wor-flasher || error "Failed to download wor-flasher repository!"
if [ -d ~/wor-flasher-files ];then
  echo -e "\nDuring use, WoR-flasher downloads all files to $HOME/wor-flasher-files\nThis folder exists right now.\nIf WoR-flasher is malfunctioning, deleting this folder may help.\n"
fi

echo "Creating menu button..."
echo "[Desktop Entry]
Type=Application
Name=WoR Flasher
Comment=WoR Flasher - Flash Windows 10 or 11 to your Raspberry Pi
Categories=Utility;
Exec=$HOME/wor-flasher/install-wor-gui.sh
Icon=$HOME/wor-flasher/logo.png
StartupNotify=true" > ~/.local/share/applications/wor-flasher.desktop
