Fix patch paths

This commit is contained in:
Thoronium 2023-02-27 19:26:04 -07:00
parent b18f7a0cf6
commit 9e6029faf3
4 changed files with 8 additions and 8 deletions

1
.gitignore vendored
View File

@ -17,6 +17,7 @@
.env.development.local
.env.test.local
.env.production.local
.vs
npm-debug.log*
yarn-debug.log*

View File

@ -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();

View File

@ -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)`)
}
}
})

View File

@ -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
}
}