Show install guide to users that only run shareware

This commit is contained in:
Anders Jenbo 2021-09-26 04:45:39 +02:00
commit fbf6d5ac9a
2 changed files with 10 additions and 0 deletions

View file

@ -75,6 +75,12 @@ public class DataActivity extends Activity {
* Start downloading the shareware
*/
public void sendDownloadRequest(View view) {
File spawnFile = new File(externalDir + "/spawn.mpq-temp");
if (spawnFile.exists() && spawnFile.renameTo(new File(externalDir + "/spawn.mpq"))) {
startGame();
return;
}
String url = "https://github.com/d07RiV/diabloweb/raw/3a5a51e84d5dab3cfd4fef661c46977b091aaa9c/spawn.mpq";
String fileName = "spawn.mpq";

View file

@ -110,7 +110,11 @@ public class DevilutionXSDLActivity extends SDLActivity {
if (!file.exists() || !file.canRead()) {
return;
}
File newPath = new File(externalDir + "/" + file.getName());
if (file.getName().equals("spawn.mpq"))
newPath = new File(externalDir + "/" + file.getName() + "-temp");
if (newPath.exists()) {
if (file.canWrite()) {
//noinspection ResultOfMethodCallIgnored