mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-12 15:14:35 +01:00
Fix patch paths
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -17,6 +17,7 @@
|
|||||||
.env.development.local
|
.env.development.local
|
||||||
.env.test.local
|
.env.test.local
|
||||||
.env.production.local
|
.env.production.local
|
||||||
|
.vs
|
||||||
|
|
||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ pub fn install_location() -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub fn set_migoto_target(path: String, migoto_path: String) -> bool {
|
pub fn set_migoto_target(_path: String, migoto_path: String) -> bool {
|
||||||
let mut migoto_pathbuf = PathBuf::from(migoto_path);
|
let mut migoto_pathbuf = PathBuf::from(migoto_path);
|
||||||
|
|
||||||
migoto_pathbuf.pop();
|
migoto_pathbuf.pop();
|
||||||
|
|||||||
@@ -72,10 +72,8 @@ export class Main extends React.Component<IProps, IState> {
|
|||||||
if (wasPatched) {
|
if (wasPatched) {
|
||||||
const unpatched = await unpatchGame()
|
const unpatched = await unpatchGame()
|
||||||
|
|
||||||
if (!unpatched) {
|
if (unpatched) {
|
||||||
alert(
|
alert(`Could not unpatch game! (Delete version.dll in your game folder)`)
|
||||||
`Could not unpatch game! (Delete version.dll in your game folder)`
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -58,9 +58,10 @@ export async function patchGame() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Copy the patch to game files
|
// Copy the patch to game files
|
||||||
const replaced = await invoke('copy_file', {
|
const replaced = await invoke('copy_file_with_new_name', {
|
||||||
path: (await getBackupRSAPath()) + '\\version.dll',
|
path: (await getBackupRSAPath()) + '\\version.dll',
|
||||||
newPath: await getGameRSAPath(),
|
newPath: await getGameRSAPath(),
|
||||||
|
newName: 'version.dll',
|
||||||
})
|
})
|
||||||
|
|
||||||
if (!replaced) {
|
if (!replaced) {
|
||||||
@@ -86,7 +87,7 @@ export async function getGameRSAPath() {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
return gameData
|
return (gameData + '\\').replace(/\\/g, '/')
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getBackupRSAPath() {
|
export async function getBackupRSAPath() {
|
||||||
@@ -107,4 +108,4 @@ export async function downloadRSA(manager: DownloadHandler) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user