Skip to content

Commit

Permalink
Merge pull request bsmg#266 from DomDom3333/master
Browse files Browse the repository at this point in the history
Added check and Warning for Uninstalling BSIPA
  • Loading branch information
luludotdev authored Nov 5, 2020
2 parents 1c1332f + 0ff1c51 commit b5223f3
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 5 deletions.
2 changes: 2 additions & 0 deletions ModAssistant/Localisation/de.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@
<sys:String x:Key="Mods:FailedExtract">Fehler beim Extrahieren von {0}, neuer Versuch in {1} Sekunden. ({2}/{3})</sys:String>
<sys:String x:Key="Mods:FailedExtractMaxReached">Fehler beim Extrahieren von {0} nach {1} Versuchen, wird übersprungen. Dieser Mod funktioniert möglicherweise nicht richtig, also gehe auf eigenes Risiko vor</sys:String>
<sys:String x:Key="Mods:SearchLabel">Suchen...</sys:String>
<sys:String x:Key="Mods:UninstallBSIPANotFound:Title">Failed to Uninstall BSIPA</sys:String> <!-- NEEDS TRANSLATING -->
<sys:String x:Key="Mods:UninstallBSIPANotFound:Body">BSIPA installation not found, uninstall operation skipped.</sys:String> <!-- NEEDS TRANSLATING -->

<!-- About Page -->
<sys:String x:Key="About:Title">Über</sys:String>
Expand Down
2 changes: 2 additions & 0 deletions ModAssistant/Localisation/en-DEBUG.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@
<sys:String x:Key="Mods:FailedExtract">{0} {1} {2} {3} Mods:FailedExtract</sys:String>
<sys:String x:Key="Mods:FailedExtractMaxReached">{0} {1} Mods:FailedExtractMaxReached</sys:String>
<sys:String x:Key="Mods:SearchLabel">Mods:SearchLabel</sys:String>
<sys:String x:Key="Mods:UninstallBSIPANotFound:Title">Mods:UninstallBSIPANotFound:Title</sys:String>
<sys:String x:Key="Mods:UninstallBSIPANotFound:Body">Mods:UninstallBSIPANotFound:Body</sys:String>

<!-- About Page -->
<sys:String x:Key="About:Title">About:Title</sys:String>
Expand Down
2 changes: 2 additions & 0 deletions ModAssistant/Localisation/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@
<sys:String x:Key="Mods:FailedExtract">Failed to extract {0}, trying again in {1} seconds. ({2}/{3})</sys:String>
<sys:String x:Key="Mods:FailedExtractMaxReached">Failed to extract {0} after max attempts ({1}), skipping. This mod might not work properly so proceed at your own risk</sys:String>
<sys:String x:Key="Mods:SearchLabel">Search...</sys:String>
<sys:String x:Key="Mods:UninstallBSIPANotFound:Title">Failed to Uninstall BSIPA</sys:String>
<sys:String x:Key="Mods:UninstallBSIPANotFound:Body">BSIPA installation not found, uninstall operation skipped.</sys:String>

<!-- About Page -->
<sys:String x:Key="About:Title">About</sys:String>
Expand Down
3 changes: 2 additions & 1 deletion ModAssistant/Localisation/fr.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@
<sys:String x:Key="Mods:FailedExtract">Échec de l'extraction de {0}, nouvelle tentative dans {1} secondes. ({2}/{3})</sys:String>
<sys:String x:Key="Mods:FailedExtractMaxReached">Échec de l'extraction de {0} après le maximum de tentatives ({1}), abandon. Ce mod pourrait ne pas fonctionner correctement, continuez à vos propres risques</sys:String>
<sys:String x:Key="Mods:SearchLabel">Recherche...</sys:String>

<sys:String x:Key="Mods:UninstallBSIPANotFound:Title">Failed to Uninstall BSIPA</sys:String> <!-- NEEDS TRANSLATING -->
<sys:String x:Key="Mods:UninstallBSIPANotFound:Body">BSIPA installation not found, uninstall operation skipped.</sys:String> <!-- NEEDS TRANSLATING -->

<!-- About Page -->
<sys:String x:Key="About:Title">À propos</sys:String>
Expand Down
4 changes: 3 additions & 1 deletion ModAssistant/Localisation/it.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@
<sys:String x:Key="Mods:FailedExtract">Impossibile estrarre {0}, prossimo tentativo in {1} secondi. ({2}/{3})</sys:String>
<sys:String x:Key="Mods:FailedExtractMaxReached">Non sono riuscito ad estrarre {0} dopo aver raggiunto il numero massimo di tentativi ({1}), salto questa mod. Questa protrebbe anche non funzionare correttamente, quindi procedi a tuo rischio e pericolo</sys:String>
<sys:String x:Key="Mods:SearchLabel">Cerca...</sys:String>

<sys:String x:Key="Mods:UninstallBSIPANotFound:Title">Failed to Uninstall BSIPA</sys:String> <!-- NEEDS TRANSLATING -->
<sys:String x:Key="Mods:UninstallBSIPANotFound:Body">BSIPA installation not found, uninstall operation skipped.</sys:String> <!-- NEEDS TRANSLATING -->

<!-- About Page -->
<sys:String x:Key="About:Title">Info</sys:String>
<sys:String x:Key="About:PageTitle">Info su Mod Assistant</sys:String>
Expand Down
2 changes: 2 additions & 0 deletions ModAssistant/Localisation/ko.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@
<sys:String x:Key="Mods:FailedExtract">{0}를 추출하는데 실패했습니다. {1}초 안에 재시도합니다. ({2}/{3})</sys:String>
<sys:String x:Key="Mods:FailedExtractMaxReached">({1})회동안 {0}를 추출하는데 실패했습니다. 이 모드가 제대로 작동하지 않을지도 모릅니다</sys:String>
<sys:String x:Key="Mods:SearchLabel">Search...</sys:String> <!-- NEEDS TRANSLATING -->
<sys:String x:Key="Mods:UninstallBSIPANotFound:Title">Failed to Uninstall BSIPA</sys:String> <!-- NEEDS TRANSLATING -->
<sys:String x:Key="Mods:UninstallBSIPANotFound:Body">BSIPA installation not found, uninstall operation skipped.</sys:String> <!-- NEEDS TRANSLATING -->

<!-- About Page -->
<sys:String x:Key="About:Title">정보</sys:String>
Expand Down
2 changes: 2 additions & 0 deletions ModAssistant/Localisation/nl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@
<sys:String x:Key="Mods:FailedExtract">Kon {0} niet uitpakken, probeer opniew over {1} seconden. ({2}/{3})</sys:String>
<sys:String x:Key="Mods:FailedExtractMaxReached">Kon {0} niet uitpakken na maximaal aantal pogingen ({1}), deze word nu overgeslagen. Deze mod werkt misschien niet goed dus ga verder op eigen risico</sys:String>
<sys:String x:Key="Mods:SearchLabel">Zoek...</sys:String>
<sys:String x:Key="Mods:UninstallBSIPANotFound:Title">Failed to Uninstall BSIPA</sys:String> <!-- NEEDS TRANSLATING -->
<sys:String x:Key="Mods:UninstallBSIPANotFound:Body">BSIPA installation not found, uninstall operation skipped.</sys:String> <!-- NEEDS TRANSLATING -->

<!-- About Page -->
<sys:String x:Key="About:Title">Over</sys:String>
Expand Down
4 changes: 3 additions & 1 deletion ModAssistant/Localisation/ru.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@
<sys:String x:Key="Mods:FailedExtract">Не удалось извлечь {0}, попробуйте снова через {1} секунд. ({2}/{3})</sys:String>
<sys:String x:Key="Mods:FailedExtractMaxReached">Не удалось извлечь {0} после попыток ({1}), пропускается. Эта модификация может работать некорректно, используйте на свой страх и риск</sys:String>
<sys:String x:Key="Mods:SearchLabel">Поиск...</sys:String>
<sys:String x:Key="Mods:UninstallBSIPANotFound:Title">Failed to Uninstall BSIPA</sys:String> <!-- NEEDS TRANSLATING -->
<sys:String x:Key="Mods:UninstallBSIPANotFound:Body">BSIPA installation not found, uninstall operation skipped.</sys:String> <!-- NEEDS TRANSLATING -->

<!-- About Page -->
<!-- About Page -->
<sys:String x:Key="About:Title">Информация</sys:String>
<sys:String x:Key="About:PageTitle">Про Mod Assistant</sys:String>
<sys:String x:Key="About:List:Header">Я ассистент, и я создал Mod Assistant для помощи модификациям с некоторыми личными принципами:</sys:String>
Expand Down
2 changes: 2 additions & 0 deletions ModAssistant/Localisation/sv.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@
<sys:String x:Key="Mods:FailedExtract">Extrahering misslyckades {0}, försöker igen om {1} sekunder. ({2}/{3})</sys:String>
<sys:String x:Key="Mods:FailedExtractMaxReached">Misslyckades med att extrahera {0} efter maxantalet försök ({1}), hoppar över. Denna mod kanske inte fungerar som den ska så fortsätt på egen risk.</sys:String>
<sys:String x:Key="Mods:SearchLabel">Sök...</sys:String>
<sys:String x:Key="Mods:UninstallBSIPANotFound:Title">Failed to Uninstall BSIPA</sys:String> <!-- NEEDS TRANSLATING -->
<sys:String x:Key="Mods:UninstallBSIPANotFound:Body">BSIPA installation not found, uninstall operation skipped.</sys:String> <!-- NEEDS TRANSLATING -->

<!-- About Page -->
<sys:String x:Key="About:Title">Om</sys:String>
Expand Down
2 changes: 2 additions & 0 deletions ModAssistant/Localisation/zh.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@
<sys:String x:Key="Mods:FailedExtract">{0}解压失败,将在{1}秒后重试。({2}/{3})</sys:String>
<sys:String x:Key="Mods:FailedExtractMaxReached">{0}在重试{1}次后仍然无法解压,将被跳过。注意,这个Mod可能无法使用。</sys:String>
<sys:String x:Key="Mods:SearchLabel">搜索...</sys:String>
<sys:String x:Key="Mods:UninstallBSIPANotFound:Title">Failed to Uninstall BSIPA</sys:String> <!-- NEEDS TRANSLATING -->
<sys:String x:Key="Mods:UninstallBSIPANotFound:Body">BSIPA installation not found, uninstall operation skipped.</sys:String> <!-- NEEDS TRANSLATING -->

<!-- About Page -->
<sys:String x:Key="About:Title">关于</sys:String>
Expand Down
17 changes: 15 additions & 2 deletions ModAssistant/Pages/Mods.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -693,8 +693,21 @@ public void UninstallMod(Mod mod)
break;
}
}
if (mod.name.ToLower() == "bsipa")
UninstallBSIPA(links);
if (mod.name.ToLower() == "bsipa") {
var hasIPAExe = File.Exists(Path.Combine(App.BeatSaberInstallDirectory, "IPA.exe"));
var hasIPADir = Directory.Exists(Path.Combine(App.BeatSaberInstallDirectory, "IPA"));

if (hasIPADir && hasIPAExe){
UninstallBSIPA(links);
}
else
{
var title = (string)FindResource("Mods:UninstallBSIPANotFound:Title");
var body = (string)FindResource("Mods:UninstallBSIPANotFound:Body");

System.Windows.Forms.MessageBox.Show(body, title, MessageBoxButtons.OK,MessageBoxIcon.Warning);
}
}
foreach (Mod.FileHashes files in links.hashMd5)
{
if (File.Exists(Path.Combine(App.BeatSaberInstallDirectory, files.file)))
Expand Down

0 comments on commit b5223f3

Please sign in to comment.