description: Both patched and unpatched game installer with thcrap and vpatch and
with helper script
game_slug: touhou-06-embodiment-of-scarlet-devil
gogslug: ''
humblestoreid: ''
installer_slug: touhou-6-koumakyou-the-embodi-thcrap-vpatch-helper
name: 'Touhou 6: Koumakyou - The Embodiment of Scarlet Devil'
notes: "REQUIREMENTS:\r\n- Original JP Touhou 6 game directory any version 1.00-1.02h\
\ (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
- 102f: https://www16.big.or.jp/~zun/data/soft/kouma_update102h.EXE
- 102h: https://www16.big.or.jp/~zun/data/soft/kouma_update102f.EXE
- vpatch: https://www.thpatch.net/w/images/f/f0/vpatch_th06_for_thcrap.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: "\u6771\u65B9\u7D05\u9B54\u90F7.exe"
- task:
install_gecko: false
install_mono: false
name: create_prefix
- copy:
dst: $GAMEDIR/drive_c/Program Files/th06/
src: 102f
- copy:
dst: $GAMEDIR/drive_c/Program Files/th06/
src: 102h
- copy:
dst: $GAMEDIR/drive_c/Program Files/th06/
src: $DISC
- extract:
dst: $GAMEDIR/drive_c/Program Files/th06/
file: vpatch
- execute:
command: chmod -R +w "$GAMEDIR/drive_c/Program Files/th06/"
- 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/th06/kouma_update102f.EXE
name: wineexec
prefix: $GAMEDIR
- task:
description: ZUN patch will run, press OK when prompted to continue.
executable: $GAMEDIR/drive_c/Program Files/th06/kouma_update102h.EXE
name: wineexec
prefix: $GAMEDIR
- extract:
dst: $GAMEDIR/drive_c/thcrap
file: thcrap
- write_file:
content: '{ "th06": "C:/Program Files/th06/vpatch.exe", "th06_custom": "C:/Program
Files/th06/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 'th06*.lnk' -exec cp {} $GAMEDIR/drive_c/default.lnk \;
system:
env:
LC_ALL: ja_JP.UTF-8
wine:
dxvk: false
slug: touhou-6-koumakyou-the-embodi-thcrap-vpatch-helper
steamid: null
version: thcrap, vpatch, helper script
year: 2002
{
"game_slug": "touhou-06-embodiment-of-scarlet-devil",
"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 6 game directory any version 1.00-1.02h (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 6: Koumakyou - The Embodiment of Scarlet Devil",
"year": 2002,
"steamid": null,
"gogslug": "",
"humblestoreid": "",
"runner": "wine",
"slug": "touhou-6-koumakyou-the-embodi-thcrap-vpatch-helper",
"installer_slug": "touhou-6-koumakyou-the-embodi-thcrap-vpatch-helper",
"script": {
"files": [
{
"thcrap": "https://github.com/thpatch/thcrap/releases/latest/download/thcrap.zip"
},
{
"102f": "https://www16.big.or.jp/~zun/data/soft/kouma_update102h.EXE"
},
{
"102h": "https://www16.big.or.jp/~zun/data/soft/kouma_update102f.EXE"
},
{
"vpatch": "https://www.thpatch.net/w/images/f/f0/vpatch_th06_for_thcrap.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": "\u6771\u65b9\u7d05\u9b54\u90f7.exe"
}
},
{
"task": {
"install_gecko": false,
"install_mono": false,
"name": "create_prefix"
}
},
{
"copy": {
"dst": "$GAMEDIR/drive_c/Program Files/th06/",
"src": "102f"
}
},
{
"copy": {
"dst": "$GAMEDIR/drive_c/Program Files/th06/",
"src": "102h"
}
},
{
"copy": {
"dst": "$GAMEDIR/drive_c/Program Files/th06/",
"src": "$DISC"
}
},
{
"extract": {
"dst": "$GAMEDIR/drive_c/Program Files/th06/",
"file": "vpatch"
}
},
{
"execute": {
"command": "chmod -R +w \"$GAMEDIR/drive_c/Program Files/th06/\""
}
},
{
"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/th06/kouma_update102f.EXE",
"name": "wineexec",
"prefix": "$GAMEDIR"
}
},
{
"task": {
"description": "ZUN patch will run, press OK when prompted to continue.",
"executable": "$GAMEDIR/drive_c/Program Files/th06/kouma_update102h.EXE",
"name": "wineexec",
"prefix": "$GAMEDIR"
}
},
{
"extract": {
"dst": "$GAMEDIR/drive_c/thcrap",
"file": "thcrap"
}
},
{
"write_file": {
"content": "{ \"th06\": \"C:/Program Files/th06/vpatch.exe\", \"th06_custom\": \"C:/Program Files/th06/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 'th06*.lnk' -exec cp {} $GAMEDIR/drive_c/default.lnk \\;"
}
}
],
"system": {
"env": {
"LC_ALL": "ja_JP.UTF-8"
}
},
"wine": {
"dxvk": false
}
}
}