Skip to content

Commit

Permalink
Ignore backup assets when applying language specific assets
Browse files Browse the repository at this point in the history
  • Loading branch information
drojf committed Jul 16, 2023
1 parent 112f75b commit 48a81de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion higurashiInstaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def _applyLanguageSpecificSharedAssets(self, folderToApply):
# We don't use the version stored in self.info.unityVersion because on certain configurations,
# the mod itself updates the unity version, causing it to change mid-install.
try:
versionString = installConfiguration.getUnityVersion(self.dataDirectory)
versionString = installConfiguration.getUnityVersion(self.dataDirectory, ignoreBackupAssets=True)
except Exception as e:
# If don't know own unity version, don't attempt to apply any UI
print("ERROR (_applyLanguageSpecificSharedAssets()): Failed to retrieve unity version from resources.assets as {}".format(e))
Expand Down
4 changes: 2 additions & 2 deletions installConfiguration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def getSHA256(path):
m.update(file.read())
return m.hexdigest()

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

if not os.path.exists(assetsbundlePath):
Expand Down

0 comments on commit 48a81de

Please sign in to comment.