mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2024-11-26 13:20:33 +00:00
Fix patch paths
This commit is contained in:
parent
b18f7a0cf6
commit
9e6029faf3
1
.gitignore
vendored
1
.gitignore
vendored
@ -17,6 +17,7 @@
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
.vs
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
|
@ -94,7 +94,7 @@ pub fn install_location() -> String {
|
||||
}
|
||||
|
||||
#[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);
|
||||
|
||||
migoto_pathbuf.pop();
|
||||
|
@ -72,10 +72,8 @@ export class Main extends React.Component<IProps, IState> {
|
||||
if (wasPatched) {
|
||||
const unpatched = await unpatchGame()
|
||||
|
||||
if (!unpatched) {
|
||||
alert(
|
||||
`Could not unpatch game! (Delete version.dll in your game folder)`
|
||||
)
|
||||
if (unpatched) {
|
||||
alert(`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
|
||||
const replaced = await invoke('copy_file', {
|
||||
const replaced = await invoke('copy_file_with_new_name', {
|
||||
path: (await getBackupRSAPath()) + '\\version.dll',
|
||||
newPath: await getGameRSAPath(),
|
||||
newName: 'version.dll',
|
||||
})
|
||||
|
||||
if (!replaced) {
|
||||
@ -86,7 +87,7 @@ export async function getGameRSAPath() {
|
||||
return null
|
||||
}
|
||||
|
||||
return gameData
|
||||
return (gameData + '\\').replace(/\\/g, '/')
|
||||
}
|
||||
|
||||
export async function getBackupRSAPath() {
|
||||
@ -107,4 +108,4 @@ export async function downloadRSA(manager: DownloadHandler) {
|
||||
})
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user