Skip to content

Commit

Permalink
Hou Plus Installer Preparation (#220)
Browse files Browse the repository at this point in the history
Add Hou Plus (initial trial) to Installer

* Add Rei Plus installer button

* Update Installer for Hou Plus [unfinished URLs left as TODOs]

* Add UI file URLs and remove og-dll-asset-update for now

* Remove unix movie (.webm) as hou can play mp4 on mac/linux

* Update cachedDownloadSizes

# Conflicts:
#	cachedDownloadSizes.json

* Load Install page description from github
 - Add retrieval of a JSON file containing any generic, data we wish to display/use in the installer.
 - For now only Hou Plus uses this data, to display information about the status of the mod on its installation page
 - This JSON file is generated in the new repo python-patcher-updates.
 - Having a generated JSON file avoids manually editing JSON files where we can't put comments, and allows storing data in separate files etc.

* Use updated mod updates URL

* Update script version
  • Loading branch information
Auu-Auu authored Feb 8, 2024
1 parent ef4844e commit 7d7ca1a
Show file tree
Hide file tree
Showing 11 changed files with 106 additions and 7 deletions.
7 changes: 7 additions & 0 deletions cachedDownloadSizes.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@
"https://07th-mod.com/rikachama/audio/Higurashi-OG-BGM-SE.7z": 141845264,
"https://07th-mod.com/rikachama/audio/Higurashi-Remake-BGM.7z": 58551253,
"https://07th-mod.com/rikachama/audio/HigurashiKai-OG-BGM-SE.7z": 99901166,
"https://07th-mod.com/rikachama/audio/Hou-Plus-BGM-SE.7z": 331353506,
"https://07th-mod.com/rikachama/audio/MangaGamer-Answer-BGM-SE-Restore.7z": 191763378,
"https://07th-mod.com/rikachama/audio/MangaGamer-Question-BGM-SE-Restore.7z": 96916638,
"https://07th-mod.com/rikachama/audio/Rei-BGM-SE.7z": 98043879,
"https://07th-mod.com/rikachama/graphics/ConsoleArcs-Graphics.7z": 2582826726,
"https://07th-mod.com/rikachama/graphics/Himatsubushi-Graphics.7z": 629705673,
"https://07th-mod.com/rikachama/graphics/Hou-Plus-Graphics.7z": 681819126,
"https://07th-mod.com/rikachama/graphics/Matsuribayashi-Graphics.7z": 1184019461,
"https://07th-mod.com/rikachama/graphics/Meakashi-Graphics.7z": 905125642,
"https://07th-mod.com/rikachama/graphics/Minagoroshi-Graphics.7z": 1044205595,
Expand Down Expand Up @@ -98,11 +100,14 @@
"https://07th-mod.com/rikachama/og-hou-sprites/hou-ogsprites-ep09.7z": 98108774,
"https://07th-mod.com/rikachama/tsumi-system/Tsumihoroboshi-System.7z": 22511057,
"https://07th-mod.com/rikachama/tsumi-system/this-file-intentionally-left-blank.7z": 32,
"https://07th-mod.com/rikachama/ui/Hou-Plus-UI_2019.4.4_unix.7z": 8213798,
"https://07th-mod.com/rikachama/ui/Hou-Plus-UI_2019.4.4_win.7z": 8208025,
"https://07th-mod.com/rikachama/ui/Matsuribayashi-UI_2017.2.5_unix_gog_mg.7z": 16788726,
"https://07th-mod.com/rikachama/video/ConsoleArcs-Movie.7z": 187522730,
"https://07th-mod.com/rikachama/video/ConsoleArcs-Movie_UNIX.7z": 287760347,
"https://07th-mod.com/rikachama/video/Himatsubushi-Movie.7z": 35305006,
"https://07th-mod.com/rikachama/video/Himatsubushi-Movie_UNIX.7z": 39109862,
"https://07th-mod.com/rikachama/video/Hou-Plus-Movie.7z": 181045870,
"https://07th-mod.com/rikachama/video/Matsuribayashi-Movie.7z": 89598773,
"https://07th-mod.com/rikachama/video/Matsuribayashi-Movie_UNIX.7z": 190479863,
"https://07th-mod.com/rikachama/video/Meakashi-Movie.7z": 37285873,
Expand All @@ -121,6 +126,7 @@
"https://07th-mod.com/rikachama/video/Watanagashi-Movie_UNIX.7z": 54868919,
"https://07th-mod.com/rikachama/voice/ConsoleArcs-Voices.7z": 2066713772,
"https://07th-mod.com/rikachama/voice/Himatsubushi-Voices.7z": 128808310,
"https://07th-mod.com/rikachama/voice/Hou-Plus-Voices.7z": 190697532,
"https://07th-mod.com/rikachama/voice/Matsuribayashi-Voices.7z": 473869798,
"https://07th-mod.com/rikachama/voice/Meakashi-Voices.7z": 227279402,
"https://07th-mod.com/rikachama/voice/Minagoroshi-Voices.7z": 530726655,
Expand Down Expand Up @@ -160,6 +166,7 @@
"https://github.com/07th-mod/higurashi-rei/releases/latest/download/Rei.Voice.and.Graphics.Patch.zip": 2384978,
"https://github.com/07th-mod/himatsubushi/releases/download/v0.5.1/Himatsubushi.Voice.Patch.v0.5.1.7z": 414749,
"https://github.com/07th-mod/himatsubushi/releases/latest/download/Himatsubushi.Voice.and.Graphics.Patch.zip": 7754808,
"https://github.com/07th-mod/hou-plus/releases/latest/download/Hou.Voice.and.Graphics.Patch.zip": 2145340,
"https://github.com/07th-mod/matsuribayashi/releases/download/v0.0.1/Matsuribayashi.Voice.Patch.v0.0.1.zip": 1472655,
"https://github.com/07th-mod/matsuribayashi/releases/latest/download/Matsuribayashi.Voice.and.Graphics.Patch.zip": 4942860,
"https://github.com/07th-mod/meakashi/releases/download/v0.5.0/Meakashi.Voice.Patch.v0.5.0.7z": 4709083,
Expand Down
9 changes: 9 additions & 0 deletions common.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,15 @@ def handle_starttag(self, tag, attrs):

return parser.months_remaining, parser.funding_goal_percentage

def preloadModUpdatesHTML():
html, errorInfo = getJSON("https://github.com/07th-mod/python-patcher-updates/releases/latest/download/updates.json", isURL=True)

if errorInfo is not None:
print('WARNING: Failed to get mod updates from server')
print(errorInfo)

return html

def getJSON(jsonURI, isURL):
#type: (str, bool) -> (Dict, Exception)
"""
Expand Down
20 changes: 20 additions & 0 deletions httpGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,13 +733,32 @@ def __init__(self):

# This caches the self.try_start_install(...) function, only used for install previews
self.cachedFullInstallConfigs = {} # type: Dict[str, Tuple[bool, installConfiguration.FullInstallConfiguration]]
self.updates = None

def shutdown(self):
self.installRunningLock.release()

def loadDonationStatus(self):
self.donationMonthsRemaining, self.donationProgressPercent = common.getDonationStatus()

def preloadModUpdatesHTML(self):
self.updates = common.preloadModUpdatesHTML()

def getUpdate(self, modName):
try:
if self.updates is None:
return '<strong>ERROR: Failed to get Mod Updates - self.updates is None'

if modName not in self.updates:
return '<strong>ERROR: Failed to get Mod Updates HTML for {} - modName missing from self.updates</strong>'.format(modName)

if 'status' not in self.updates[modName]:
return '<strong>ERROR: Failed to get Mod Updates HTML for {} - status is missing! </strong>'.format(modName)

return self.updates[modName]['status']
except Exception as e:
return 'ERROR: Failed to get Mod Updates - {}'.format(e)

def setSubModconfigs(self, allSubModConfigs):
"""
Set the submodconfigs to be used for the install.
Expand Down Expand Up @@ -884,6 +903,7 @@ def getSubModHandlesRequestHandler(requestData):
'modOptionGroups': modOptionsToWebFormat(subModConfig.modOptions),
'family': subModConfig.family,
'identifiers': subModConfig.identifiers,
'modUpdatesHTML': self.getUpdate(subModConfig.modName),
}
)

Expand Down
Binary file added httpGUI/img/games/header10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions httpGUI/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ <h3>Error while checking if installer is latest</h3>
<div class="container">
<div class="row">
<div class="col-md-6">
<h2 class="uppercase mb8">Higurashi Rei</h2>
<p class="lead mb0">New chapter: Higurashi Rei<br></p>
<a class="btn btn-lg" onclick="setModNameAndNavigate('Rei')">INSTALL</a>
<h2 class="uppercase mb8">Higurashi Hou Plus</h2>
<p class="lead mb0">New chapter: Higurashi Hou Plus<br></p>
<a class="btn btn-lg" onclick="setModNameAndNavigate('Hou Plus')">INSTALL</a>
</div>
</div>

Expand Down
4 changes: 4 additions & 0 deletions httpGUI/installer.html
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ <h4>🔧 Adding Console Arcs to Steam Library</h4>
<li>Opening videos</li>
</ul>
</div>
<!-- In the future should remotely get installer page description, but for now just test it on Hou Plus only -->
<div v-else-if="selectedSubMod.modName === 'Hou Plus'">
<span class="rendered-markdown" v-html="renderHTML(selectedSubMod.modUpdatesHTML)"></span>
</div>
<div v-else>
For details and screenshots on what the mod contains, <a href="https://07th-mod.com/wiki/Higurashi/Higurashi-Getting-started/" target="_blank">see the Intro page on our Wiki</a><br>
This mod contains:
Expand Down
4 changes: 4 additions & 0 deletions httpGUI/python-patcher-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ window.onload = function onWindowLoaded() {
img: 'img/games/header9.png',
dataFilter: 'Bonus Content',
},
'Hou Plus': {
img: 'img/games/header10.png',
dataFilter: 'Bonus Content',
}
},
// Data filters are defined manually so you can set the order
dataFilters: ['Question Arcs', 'Answer Arcs', 'Console Arcs', 'Bonus Content'],
Expand Down
6 changes: 5 additions & 1 deletion httpGUI/python-patcher-lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ Continue install anyway?`)) {
renderMarkdown(markdownText) {
return DOMPurify.sanitize(marked(markdownText));
},
renderHTML(htmlText) {
return DOMPurify.sanitize(htmlText);
},
validateInstallPath(deleteVersionInformation, allowCache, noProgressUpdate) {
// Just validate the install - don't actually start the installation
const args = {
Expand Down Expand Up @@ -478,7 +481,8 @@ Continue install anyway?`)) {
'Tsumihoroboshi Ch.6': 'https://github.com/07th-mod/tsumihoroboshi/releases',
'Minagoroshi Ch.7': 'https://github.com/07th-mod/minagoroshi/releases',
'Matsuribayashi Ch.8': 'https://github.com/07th-mod/matsuribayashi/releases',
'Rei': 'https://github.com/07th-mod/higurashi-rei/releases'
'Rei': 'https://github.com/07th-mod/higurashi-rei/releases',
'Hou Plus': 'https://github.com/07th-mod/hou-plus/releases'
}, app.selectedMod, null);

app.metaInfo = responseData.metaInfo;
Expand Down
27 changes: 27 additions & 0 deletions installData.json
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,33 @@
}
]
},
{
"family": "higurashi",
"name": "Hou Plus",
"target": "Hou Plus",
"CFBundleName": "Higurashi When They Cry Hou+",
"dataname": "HigurashiEp10_Data",
"identifiers" : ["Higurashi When They Cry Hou Plus_Data", "HigurashiEp10_Data", "HigurashiEp10.x86_64", "HigurashiEp10.exe"],
"submods": [
{
"name": "full",
"descriptionID": "higurashiFull",
"files": [
{"name": "graphics", "url": "https://07th-mod.com/rikachama/graphics/Hou-Plus-Graphics.7z", "priority": 0},
{"name": "movie", "url": "https://07th-mod.com/rikachama/video/Hou-Plus-Movie.7z", "priority": 0},
{"name": "voices", "url": "https://07th-mod.com/rikachama/voice/Hou-Plus-Voices.7z", "priority": 0},
{"name": "bgm-se", "url": "https://07th-mod.com/rikachama/audio/Hou-Plus-BGM-SE.7z", "priority": 0},
{"name": "ui", "url": null, "priority": 0, "installOnRepair": true},
{"name": "script", "url": "https://github.com/07th-mod/hou-plus/releases/latest/download/Hou.Voice.and.Graphics.Patch.zip", "priority": 5, "installOnRepair": true}
],
"fileOverrides": [
{"name": "ui", "id": "ui-windows-mg","os": ["windows"], "unity": "2019.4.4", "url":"https://07th-mod.com/rikachama/ui/Hou-Plus-UI_2019.4.4_win.7z"},
{"name": "ui", "id": "ui-unix-mg", "os": ["mac", "linux"], "unity": "2019.4.4", "url":"https://07th-mod.com/rikachama/ui/Hou-Plus-UI_2019.4.4_unix.7z"}
]
}
],
"modOptionGroups": []
},
{
"family": "higurashi",
"name": "Console Arcs",
Expand Down
8 changes: 8 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,10 @@ def thread_getSubModConfigList():
def thread_unimportantTasks():
t_loadDonations = common.makeThread(installerGUI.loadDonationStatus)
t_loadLatestInstallerStatus = common.makeThread(common.Globals.loadInstallerLatestStatus)
t_preloadModUpdatesHTML = common.makeThread(installerGUI.preloadModUpdatesHTML)
t_loadDonations.start()
t_loadLatestInstallerStatus.start()
t_preloadModUpdatesHTML.start()

try:
t_loadDonations.join(timeout=6)
Expand All @@ -254,6 +256,12 @@ def thread_unimportantTasks():
except Exception as e:
print(e)

try:
t_preloadModUpdatesHTML.join(timeout=6)
except Exception as e:
print(e)


def doInstallerInit():
try:
if common.Globals.IS_MAC:
Expand Down
22 changes: 19 additions & 3 deletions versionData.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@
{"id": "og-bgm-se", "version": "1.0.6"}
]
},
{
"id": "Matsuribayashi Ch.8/voice-only",
"files": [
{"id": "voices", "version": "0.0.1"},
{"id": "script", "version": "0.0.1"}
]
},
{
"id": "Rei/full",
"files": [
Expand All @@ -206,10 +213,19 @@
]
},
{
"id": "Matsuribayashi Ch.8/voice-only",
"id": "Hou Plus/full",
"files": [
{"id": "voices", "version": "0.0.1"},
{"id": "script", "version": "0.0.1"}
{"id": "graphics", "version": "1.0.0"},
{"id": "movie", "version": "1.0.0"},
{"id": "voices", "version": "1.0.0"},
{"id": "bgm-se", "version": "1.0.0"},
{"id": "script", "version": "0.1.1"},
{"id": "movie-unix", "version": "1.0.0"},
{"id": "ui-windows", "version": "1.0.0"},
{"id": "ui-windows-mg", "version": "1.0.0"},
{"id": "ui-unix", "version": "1.0.0"},
{"id": "ui-unix-mg", "version": "1.0.0"},
{"id": "og-dll-asset-update", "version": "1.0.0"}
]
},
{
Expand Down

0 comments on commit 7d7ca1a

Please sign in to comment.