@@ -584,41 +584,39 @@ pplx::task<std::shared_ptr<Application>> AltServerApp::_InstallApplication(std::
584584 *certificate = *tempCertificate;
585585
586586 odslog (" Preparing device..." );
587- return this ->PrepareDevice (device);
587+ return this ->PrepareDevice (device).then ([=](pplx::task<void > task) {
588+ try
589+ {
590+ // Don't rethrow error, and instead continue installing app even if we couldn't install Developer disk image.
591+ task.get ();
592+ }
593+ catch (Error& error)
594+ {
595+ odslog (" Failed to install DeveloperDiskImage.dmg to " << *device << " . " << error.localizedDescription ());
596+ }
597+ catch (std::exception& exception)
598+ {
599+ odslog (" Failed to install DeveloperDiskImage.dmg to " << *device << " . " << exception.what ());
600+ }
601+
602+ if (filepath.has_value ())
603+ {
604+ odslog (" Importing app..." );
605+
606+ return pplx::create_task ([filepath] {
607+ return fs::path (*filepath);
608+ });
609+ }
610+ else
611+ {
612+ odslog (" Downloading app..." );
613+
614+ // Show alert before downloading AltStore.
615+ this ->ShowInstallationNotification (" AltStore" , device->name ());
616+ return this ->DownloadApp ();
617+ }
618+ });
588619 })
589- .then ([=](pplx::task<void > task)
590- {
591- try
592- {
593- // Don't rethrow error, and instead continue installing app even if we couldn't install Developer disk image.
594- task.get ();
595- }
596- catch (Error& error)
597- {
598- odslog (" Failed to install DeveloperDiskImage.dmg to " << *device << " . " << error.localizedDescription ());
599- }
600- catch (std::exception& exception)
601- {
602- odslog (" Failed to install DeveloperDiskImage.dmg to " << *device << " . " << exception.what ());
603- }
604-
605- if (filepath.has_value ())
606- {
607- odslog (" Importing app..." );
608-
609- return pplx::create_task ([filepath] {
610- return fs::path (*filepath);
611- });
612- }
613- else
614- {
615- odslog (" Downloading app..." );
616-
617- // Show alert before downloading AltStore.
618- this ->ShowInstallationNotification (" AltStore" , device->name ());
619- return this ->DownloadApp ();
620- }
621- })
622620 .then ([=](fs::path downloadedAppPath)
623621 {
624622 odslog (" Downloaded app!" );
0 commit comments