Skip to content

Commit 48a81de

Browse files
committed
Ignore backup assets when applying language specific assets
1 parent 112f75b commit 48a81de

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

higurashiInstaller.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ def _applyLanguageSpecificSharedAssets(self, folderToApply):
328328
# We don't use the version stored in self.info.unityVersion because on certain configurations,
329329
# the mod itself updates the unity version, causing it to change mid-install.
330330
try:
331-
versionString = installConfiguration.getUnityVersion(self.dataDirectory)
331+
versionString = installConfiguration.getUnityVersion(self.dataDirectory, ignoreBackupAssets=True)
332332
except Exception as e:
333333
# If don't know own unity version, don't attempt to apply any UI
334334
print("ERROR (_applyLanguageSpecificSharedAssets()): Failed to retrieve unity version from resources.assets as {}".format(e))

installConfiguration.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def getSHA256(path):
1919
m.update(file.read())
2020
return m.hexdigest()
2121

22-
def getUnityVersion(datadir, verbosePrinting=True):
22+
def getUnityVersion(datadir, verbosePrinting=True, ignoreBackupAssets=False):
2323
# type: (str, bool) -> str
2424
"""
2525
Given the datadir of a Higurashi game (like 'HigurashiEp0X_Data'), returns the unity version of the game
@@ -40,7 +40,7 @@ def getUnityVersion(datadir, verbosePrinting=True):
4040
# For this reason, we make a temporary version of the 'original' resources.assets file as 'resources.assets.backup' when the install starts,
4141
# When the upgrade finishes successfully, we delete this temporary file to signify that the upgrade is complete.
4242
assetsbundlePath = os.path.join(datadir, "resources.assets.backup")
43-
if not os.path.exists(assetsbundlePath):
43+
if ignoreBackupAssets or (not os.path.exists(assetsbundlePath)):
4444
assetsbundlePath = os.path.join(datadir, "resources.assets")
4545

4646
if not os.path.exists(assetsbundlePath):

0 commit comments

Comments
 (0)