Installer touhou-7-youyoumu-perfect-che-thcrap-vpatch-helper

files:
- thcrap: https://github.com/thpatch/thcrap/releases/latest/download/thcrap.zip
- 100a: https://www16.big.or.jp/~zun/data/soft/youmu_update100a.lzh
- 100b: https://www16.big.or.jp/~zun/data/soft/youmu_update100b.lzh
- vpatch: https://www.thpatch.net/w/images/6/68/VsyncPatch.zip
game:
  arch: win64
  exe: $GAMEDIR/drive_c/default.lnk
  launch_configs:
  - exe: $GAMEDIR/drive_c/thcrap/bin/thcrap_configure_v3.exe
    name: THCRAP Patch Configuration
  - exe: $GAMEDIR/drive_c/users/$USER/Desktop/bootstrap_link_updater.bat
    name: Link Updater and Configuration Tool Launcher Script
  prefix: $GAMEDIR
installer:
- insert-disc:
    requires: th07.exe
- task:
    install_gecko: false
    install_mono: false
    name: create_prefix
- extract:
    dst: $GAMEDIR/drive_c/Program Files/th07/
    file: 100a
- extract:
    dst: $GAMEDIR/drive_c/Program Files/th07/
    file: 100b
- copy:
    dst: $GAMEDIR/drive_c/Program Files/th07/
    src: $DISC
- extract:
    dst: $GAMEDIR/drive_c/VsyncPatch/
    file: vpatch
- execute:
    command: cp $GAMEDIR/drive_c/VsyncPatch/vpatch_rev4/vpatch.exe "$GAMEDIR/drive_c/Program
      Files/th07/"
- execute:
    command: cp $GAMEDIR/drive_c/VsyncPatch/vpatch_rev4/vpatch.ini "$GAMEDIR/drive_c/Program
      Files/th07/"
- execute:
    command: cp $GAMEDIR/drive_c/VsyncPatch/vpatch_rev4/vpatch_th07.dll "$GAMEDIR/drive_c/Program
      Files/th07/"
- execute:
    command: chmod -R +w "$GAMEDIR/drive_c/Program Files/th07/"
- task:
    app: cjkfonts
    name: winetricks
    silent: true
- task:
    description: ZUN patch will run, press OK when prompted to continue.
    executable: $GAMEDIR/drive_c/Program Files/th07/youmu_update100a.EXE
    name: wineexec
    prefix: $GAMEDIR
- task:
    description: ZUN patch will run, press OK when prompted to continue.
    executable: $GAMEDIR/drive_c/Program Files/th07/youmu_update100b.EXE
    name: wineexec
    prefix: $GAMEDIR
- extract:
    dst: $GAMEDIR/drive_c/thcrap
    file: thcrap
- write_file:
    content: '{ "th07": "C:/Program Files/th07/vpatch.exe", "th07_custom": "C:/Program
      Files/th07/custom.exe" }'
    file: $GAMEDIR/drive_c/thcrap/config/games.js
- write_file:
    content: start cmd.exe /k "C:/users/%USERNAME%/Desktop/link_updater.bat"
    file: $GAMEDIR/drive_c/users/$USER/Desktop/bootstrap_link_updater.bat
- write_file:
    content: "@echo off \nsetlocal enabledelayedexpansion \nset count=0 \nset tempFile=%temp%\\\
      lnkfiles.txt \ncd users\\%USERNAME%\\Desktop  \ndir /b *.lnk > %tempFile% \n\
      if %errorlevel% neq 0 (echo No .lnk files found in the current directory. \n\
      goto :end) \nfor /f \"tokens=* delims=\" %%A in (%tempFile%) do (set /a count+=1\
      \ \nset \"file!count!=%%A\" \necho !count!. %%A) \nif %count%==0 (echo No .lnk\
      \ files found in the current directory. \ngoto :end) \nset /p choice=Enter the\
      \ number to set link as Lutris default launch: \nif not defined file%choice%\
      \ (echo Invalid choice. \ngoto :end) \nset chosenFile=!file%choice%! \nset \"\
      fullPath=%cd%\\%chosenFile%\" \necho %chosenFile% | findstr /c:\"custom\" >nul\n\
      if %errorlevel% equ 0 (echo The link chosen is game configuration tool. Launching\
      \ instead of setting as default.\nstart \"\" \"%fullPath%\"\nexit)\nset \"newPath=%cd%\\\
      ..\\..\\..\\default.lnk\"\ndel %tempFile% \necho Setting as default: %fullPath%\
      \ \ncopy \"%fullPath%\" \"%newPath%\" \nexit\n:end \nendlocal"
    file: $GAMEDIR/drive_c/users/$USER/Desktop/link_updater.bat
- task:
    description: Thcrap patch configuration tool will run. In the create shortcuts
      section, REQUIRED to leave all settings default!
    executable: $GAMEDIR/drive_c/thcrap/bin/thcrap_configure_v3.exe
    name: wineexec
- execute:
    command: find $GAMEDIR/drive_c/users/$USER/Desktop/ -not -name '*custom*.lnk'
      -and -name 'th07*.lnk' -exec cp {} $GAMEDIR/drive_c/default.lnk \;
system:
  env:
    LC_ALL: ja_JP.UTF-8
wine:
  dxvk: false
description: Both patched and unpatched game installer with thcrap and vpatch and
  with helper script
game_slug: touhou-7-youyoumu-perfect-cherry-blossom
gogslug: ''
humblestoreid: ''
installer_slug: touhou-7-youyoumu-perfect-che-thcrap-vpatch-helper
name: 'Touhou 7: Youyoumu - Perfect Cherry Blossom'
notes: "REQUIREMENTS:\r\n- Original JP Touhou 7 game directory any version 1.00-1.00b\
  \ (English pre-patched one may not work!)\r\n- System JP locale enabled (https://web.archive.org/web/20240126214334/https://www.visualnovelwiki.org/en/general/jp-locale\
  \ - your distro may not be listed in there, but do your own research to figure out\
  \ how to). Pay attention to the Lutris Flatpak configuration if you are using it!\r\
  \n\r\nTHIS INSTALLER PROVIDES:\r\n- Run ZUN patches to update the game to the latest\
  \ version\r\n- vpatch\r\n- Latest thcrap\r\n- A batch helper script to manipulate\
  \ thcrap created launch shortcuts\r\n\r\nHELPER SCRIPT EXPLANATION - This installer\
  \ script also includes batch script that does the following:\r\n- Look for all *.lnk\
  \ file in Desktop directory\r\n- Enumerate found .lnk from 1 to n and ask user for\
  \ input in choosing the .lnk\r\n- If chosen .lnk has 'custom' in it (meaning it\
  \ is the game configuration tool), it will open it immediately. This allows you\
  \ to edit the game config.\r\n- If chosen .lnk does not have 'custom' (meaning it\
  \ is launch shortcut for the game with patches), it will set that .lnk as the main\
  \ game executable for Lutris.\r\n\r\nThe reason for this is Lutris requires a static\
  \ location for the main game executable, but patching creates a different set of\
  \ shortcuts each time you create a patch stack. The solution is to have a script\
  \ that help you choose which shortcut is the main game executable. This also means\
  \ that Steam Deck users can dynamically choose between patches and enter game configuration\
  \ tool or run patch configuration all within the Flatpak Lutris launch options in\
  \ Desktop mode without having to manually edit by hand.\r\n\r\nTROUBLESHOOTING/FAQ:\r\
  \n- If you have no sound, toggle 'Prefer system library'.\r\n- Closing thcrap configuration\
  \ tool or the main game executable creates a hanging process, this is annoying but\
  \ fortunately a non-issue, just click 'Stop' in Lutris to force close background\
  \ processes. This also affects Steam Deck game mode, simply tap B when quitting\
  \ game to force close background processes."
runner: wine
script:
  files:
  - thcrap: https://github.com/thpatch/thcrap/releases/latest/download/thcrap.zip
  - 100a: https://www16.big.or.jp/~zun/data/soft/youmu_update100a.lzh
  - 100b: https://www16.big.or.jp/~zun/data/soft/youmu_update100b.lzh
  - vpatch: https://www.thpatch.net/w/images/6/68/VsyncPatch.zip
  game:
    arch: win64
    exe: $GAMEDIR/drive_c/default.lnk
    launch_configs:
    - exe: $GAMEDIR/drive_c/thcrap/bin/thcrap_configure_v3.exe
      name: THCRAP Patch Configuration
    - exe: $GAMEDIR/drive_c/users/$USER/Desktop/bootstrap_link_updater.bat
      name: Link Updater and Configuration Tool Launcher Script
    prefix: $GAMEDIR
  installer:
  - insert-disc:
      requires: th07.exe
  - task:
      install_gecko: false
      install_mono: false
      name: create_prefix
  - extract:
      dst: $GAMEDIR/drive_c/Program Files/th07/
      file: 100a
  - extract:
      dst: $GAMEDIR/drive_c/Program Files/th07/
      file: 100b
  - copy:
      dst: $GAMEDIR/drive_c/Program Files/th07/
      src: $DISC
  - extract:
      dst: $GAMEDIR/drive_c/VsyncPatch/
      file: vpatch
  - execute:
      command: cp $GAMEDIR/drive_c/VsyncPatch/vpatch_rev4/vpatch.exe "$GAMEDIR/drive_c/Program
        Files/th07/"
  - execute:
      command: cp $GAMEDIR/drive_c/VsyncPatch/vpatch_rev4/vpatch.ini "$GAMEDIR/drive_c/Program
        Files/th07/"
  - execute:
      command: cp $GAMEDIR/drive_c/VsyncPatch/vpatch_rev4/vpatch_th07.dll "$GAMEDIR/drive_c/Program
        Files/th07/"
  - execute:
      command: chmod -R +w "$GAMEDIR/drive_c/Program Files/th07/"
  - task:
      app: cjkfonts
      name: winetricks
      silent: true
  - task:
      description: ZUN patch will run, press OK when prompted to continue.
      executable: $GAMEDIR/drive_c/Program Files/th07/youmu_update100a.EXE
      name: wineexec
      prefix: $GAMEDIR
  - task:
      description: ZUN patch will run, press OK when prompted to continue.
      executable: $GAMEDIR/drive_c/Program Files/th07/youmu_update100b.EXE
      name: wineexec
      prefix: $GAMEDIR
  - extract:
      dst: $GAMEDIR/drive_c/thcrap
      file: thcrap
  - write_file:
      content: '{ "th07": "C:/Program Files/th07/vpatch.exe", "th07_custom": "C:/Program
        Files/th07/custom.exe" }'
      file: $GAMEDIR/drive_c/thcrap/config/games.js
  - write_file:
      content: start cmd.exe /k "C:/users/%USERNAME%/Desktop/link_updater.bat"
      file: $GAMEDIR/drive_c/users/$USER/Desktop/bootstrap_link_updater.bat
  - write_file:
      content: "@echo off \nsetlocal enabledelayedexpansion \nset count=0 \nset tempFile=%temp%\\\
        lnkfiles.txt \ncd users\\%USERNAME%\\Desktop  \ndir /b *.lnk > %tempFile%\
        \ \nif %errorlevel% neq 0 (echo No .lnk files found in the current directory.\
        \ \ngoto :end) \nfor /f \"tokens=* delims=\" %%A in (%tempFile%) do (set /a\
        \ count+=1 \nset \"file!count!=%%A\" \necho !count!. %%A) \nif %count%==0\
        \ (echo No .lnk files found in the current directory. \ngoto :end) \nset /p\
        \ choice=Enter the number to set link as Lutris default launch: \nif not defined\
        \ file%choice% (echo Invalid choice. \ngoto :end) \nset chosenFile=!file%choice%!\
        \ \nset \"fullPath=%cd%\\%chosenFile%\" \necho %chosenFile% | findstr /c:\"\
        custom\" >nul\nif %errorlevel% equ 0 (echo The link chosen is game configuration\
        \ tool. Launching instead of setting as default.\nstart \"\" \"%fullPath%\"\
        \nexit)\nset \"newPath=%cd%\\..\\..\\..\\default.lnk\"\ndel %tempFile% \n\
        echo Setting as default: %fullPath% \ncopy \"%fullPath%\" \"%newPath%\" \n\
        exit\n:end \nendlocal"
      file: $GAMEDIR/drive_c/users/$USER/Desktop/link_updater.bat
  - task:
      description: Thcrap patch configuration tool will run. In the create shortcuts
        section, REQUIRED to leave all settings default!
      executable: $GAMEDIR/drive_c/thcrap/bin/thcrap_configure_v3.exe
      name: wineexec
  - execute:
      command: find $GAMEDIR/drive_c/users/$USER/Desktop/ -not -name '*custom*.lnk'
        -and -name 'th07*.lnk' -exec cp {} $GAMEDIR/drive_c/default.lnk \;
  system:
    env:
      LC_ALL: ja_JP.UTF-8
  wine:
    dxvk: false
slug: touhou-7-youyoumu-perfect-che-thcrap-vpatch-helper
steamid: null
version: thcrap, vpatch, helper script
year: 2003
{
  "game_slug": "touhou-7-youyoumu-perfect-cherry-blossom",
  "version": "thcrap, vpatch, helper script",
  "description": "Both patched and unpatched game installer with thcrap and vpatch and with helper script",
  "notes": "REQUIREMENTS:\r\n- Original JP Touhou 7 game directory any version 1.00-1.00b (English pre-patched one may not work!)\r\n- System JP locale enabled (https://web.archive.org/web/20240126214334/https://www.visualnovelwiki.org/en/general/jp-locale - your distro may not be listed in there, but do your own research to figure out how to). Pay attention to the Lutris Flatpak configuration if you are using it!\r\n\r\nTHIS INSTALLER PROVIDES:\r\n- Run ZUN patches to update the game to the latest version\r\n- vpatch\r\n- Latest thcrap\r\n- A batch helper script to manipulate thcrap created launch shortcuts\r\n\r\nHELPER SCRIPT EXPLANATION - This installer script also includes batch script that does the following:\r\n- Look for all *.lnk file in Desktop directory\r\n- Enumerate found .lnk from 1 to n and ask user for input in choosing the .lnk\r\n- If chosen .lnk has 'custom' in it (meaning it is the game configuration tool), it will open it immediately. This allows you to edit the game config.\r\n- If chosen .lnk does not have 'custom' (meaning it is launch shortcut for the game with patches), it will set that .lnk as the main game executable for Lutris.\r\n\r\nThe reason for this is Lutris requires a static location for the main game executable, but patching creates a different set of shortcuts each time you create a patch stack. The solution is to have a script that help you choose which shortcut is the main game executable. This also means that Steam Deck users can dynamically choose between patches and enter game configuration tool or run patch configuration all within the Flatpak Lutris launch options in Desktop mode without having to manually edit by hand.\r\n\r\nTROUBLESHOOTING/FAQ:\r\n- If you have no sound, toggle 'Prefer system library'.\r\n- Closing thcrap configuration tool or the main game executable creates a hanging process, this is annoying but fortunately a non-issue, just click 'Stop' in Lutris to force close background processes. This also affects Steam Deck game mode, simply tap B when quitting game to force close background processes.",
  "name": "Touhou 7: Youyoumu - Perfect Cherry Blossom",
  "year": 2003,
  "steamid": null,
  "gogslug": "",
  "humblestoreid": "",
  "runner": "wine",
  "slug": "touhou-7-youyoumu-perfect-che-thcrap-vpatch-helper",
  "installer_slug": "touhou-7-youyoumu-perfect-che-thcrap-vpatch-helper",
  "script": {
    "files": [
      {
        "thcrap": "https://github.com/thpatch/thcrap/releases/latest/download/thcrap.zip"
      },
      {
        "100a": "https://www16.big.or.jp/~zun/data/soft/youmu_update100a.lzh"
      },
      {
        "100b": "https://www16.big.or.jp/~zun/data/soft/youmu_update100b.lzh"
      },
      {
        "vpatch": "https://www.thpatch.net/w/images/6/68/VsyncPatch.zip"
      }
    ],
    "game": {
      "arch": "win64",
      "exe": "$GAMEDIR/drive_c/default.lnk",
      "launch_configs": [
        {
          "exe": "$GAMEDIR/drive_c/thcrap/bin/thcrap_configure_v3.exe",
          "name": "THCRAP Patch Configuration"
        },
        {
          "exe": "$GAMEDIR/drive_c/users/$USER/Desktop/bootstrap_link_updater.bat",
          "name": "Link Updater and Configuration Tool Launcher Script"
        }
      ],
      "prefix": "$GAMEDIR"
    },
    "installer": [
      {
        "insert-disc": {
          "requires": "th07.exe"
        }
      },
      {
        "task": {
          "install_gecko": false,
          "install_mono": false,
          "name": "create_prefix"
        }
      },
      {
        "extract": {
          "dst": "$GAMEDIR/drive_c/Program Files/th07/",
          "file": "100a"
        }
      },
      {
        "extract": {
          "dst": "$GAMEDIR/drive_c/Program Files/th07/",
          "file": "100b"
        }
      },
      {
        "copy": {
          "dst": "$GAMEDIR/drive_c/Program Files/th07/",
          "src": "$DISC"
        }
      },
      {
        "extract": {
          "dst": "$GAMEDIR/drive_c/VsyncPatch/",
          "file": "vpatch"
        }
      },
      {
        "execute": {
          "command": "cp $GAMEDIR/drive_c/VsyncPatch/vpatch_rev4/vpatch.exe \"$GAMEDIR/drive_c/Program Files/th07/\""
        }
      },
      {
        "execute": {
          "command": "cp $GAMEDIR/drive_c/VsyncPatch/vpatch_rev4/vpatch.ini \"$GAMEDIR/drive_c/Program Files/th07/\""
        }
      },
      {
        "execute": {
          "command": "cp $GAMEDIR/drive_c/VsyncPatch/vpatch_rev4/vpatch_th07.dll \"$GAMEDIR/drive_c/Program Files/th07/\""
        }
      },
      {
        "execute": {
          "command": "chmod -R +w \"$GAMEDIR/drive_c/Program Files/th07/\""
        }
      },
      {
        "task": {
          "app": "cjkfonts",
          "name": "winetricks",
          "silent": true
        }
      },
      {
        "task": {
          "description": "ZUN patch will run, press OK when prompted to continue.",
          "executable": "$GAMEDIR/drive_c/Program Files/th07/youmu_update100a.EXE",
          "name": "wineexec",
          "prefix": "$GAMEDIR"
        }
      },
      {
        "task": {
          "description": "ZUN patch will run, press OK when prompted to continue.",
          "executable": "$GAMEDIR/drive_c/Program Files/th07/youmu_update100b.EXE",
          "name": "wineexec",
          "prefix": "$GAMEDIR"
        }
      },
      {
        "extract": {
          "dst": "$GAMEDIR/drive_c/thcrap",
          "file": "thcrap"
        }
      },
      {
        "write_file": {
          "content": "{ \"th07\": \"C:/Program Files/th07/vpatch.exe\", \"th07_custom\": \"C:/Program Files/th07/custom.exe\" }",
          "file": "$GAMEDIR/drive_c/thcrap/config/games.js"
        }
      },
      {
        "write_file": {
          "content": "start cmd.exe /k \"C:/users/%USERNAME%/Desktop/link_updater.bat\"",
          "file": "$GAMEDIR/drive_c/users/$USER/Desktop/bootstrap_link_updater.bat"
        }
      },
      {
        "write_file": {
          "content": "@echo off \nsetlocal enabledelayedexpansion \nset count=0 \nset tempFile=%temp%\\lnkfiles.txt \ncd users\\%USERNAME%\\Desktop  \ndir /b *.lnk > %tempFile% \nif %errorlevel% neq 0 (echo No .lnk files found in the current directory. \ngoto :end) \nfor /f \"tokens=* delims=\" %%A in (%tempFile%) do (set /a count+=1 \nset \"file!count!=%%A\" \necho !count!. %%A) \nif %count%==0 (echo No .lnk files found in the current directory. \ngoto :end) \nset /p choice=Enter the number to set link as Lutris default launch: \nif not defined file%choice% (echo Invalid choice. \ngoto :end) \nset chosenFile=!file%choice%! \nset \"fullPath=%cd%\\%chosenFile%\" \necho %chosenFile% | findstr /c:\"custom\" >nul\nif %errorlevel% equ 0 (echo The link chosen is game configuration tool. Launching instead of setting as default.\nstart \"\" \"%fullPath%\"\nexit)\nset \"newPath=%cd%\\..\\..\\..\\default.lnk\"\ndel %tempFile% \necho Setting as default: %fullPath% \ncopy \"%fullPath%\" \"%newPath%\" \nexit\n:end \nendlocal",
          "file": "$GAMEDIR/drive_c/users/$USER/Desktop/link_updater.bat"
        }
      },
      {
        "task": {
          "description": "Thcrap patch configuration tool will run. In the create shortcuts section, REQUIRED to leave all settings default!",
          "executable": "$GAMEDIR/drive_c/thcrap/bin/thcrap_configure_v3.exe",
          "name": "wineexec"
        }
      },
      {
        "execute": {
          "command": "find $GAMEDIR/drive_c/users/$USER/Desktop/ -not -name '*custom*.lnk' -and -name 'th07*.lnk' -exec cp {} $GAMEDIR/drive_c/default.lnk \\;"
        }
      }
    ],
    "system": {
      "env": {
        "LC_ALL": "ja_JP.UTF-8"
      }
    },
    "wine": {
      "dxvk": false
    }
  }
}
Back to game