You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 23, 2025. It is now read-only.
DialogResultresult2=MessageBox.Show("Would you like to delete the files of this virtual machine as well?","Delete files",MessageBoxButtons.YesNo,MessageBoxIcon.Warning);
908
-
if(result2==DialogResult.No)
902
+
try
909
903
{
910
-
MessageBox.Show("Virtual machine \""+vm.Name+"\" was successfully removed. Its files are still there if you want to re-add it later.","Virtual machine removed",MessageBoxButtons.OK,MessageBoxIcon.Information);
catch(Exceptionex)//Catches "regkey doesn't exist" exceptions and such
910
+
{
911
+
MessageBox.Show("Virtual machine \""+vm.Name+"\" could not be removed due to the following error:\n\n"+ex.Message,"Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
912
+
return;
913
+
}
914
+
915
+
DialogResultresult2=MessageBox.Show("Virtual machine \""+vm.Name+"\" was successfully removed. Would you like to delete its files as well?","Virtual machine removed",MessageBoxButtons.YesNo,MessageBoxIcon.Question);
916
+
if(result2==DialogResult.Yes)
913
917
{
914
918
try
915
919
{
916
920
Directory.Delete(vm.Path,true);
917
921
}
918
-
catch(DirectoryNotFoundException){/*Just ignore this for now*/}
919
-
MessageBox.Show("Virtual machine \""+vm.Name+"\" was successfully removed, along with its files.","Virtual machine and files removed",MessageBoxButtons.OK,MessageBoxIcon.Information);
922
+
catch(UnauthorizedAccessException)//Files are read-only or protected by privileges
923
+
{
924
+
MessageBox.Show("86Box Manager was unable to delete the files of this virtual machine, because they are set as read-only or you don't have sufficient privileges to delete them.\n\nMake sure the files are free for deletion, then remove them manually.","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
925
+
return;
926
+
}
927
+
catch(IOException)//Files are in use by another process
928
+
{
929
+
MessageBox.Show("86Box Manager was unable to delete the files of this virtual machine, because they are currently in use by another process.\n\nMake sure the files are free for deletion, then remove them manually.","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
930
+
return;
931
+
}
932
+
catch(Exceptionex){//Other exceptions
933
+
MessageBox.Show("The following error occurred while trying to remove the files of this virtual machine:\n\n"+ex.Message,"Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
934
+
return;
935
+
}
936
+
MessageBox.Show("Files of virtual machine \""+vm.Name+"\" were successfully deleted.","Virtual machine files removed",MessageBoxButtons.OK,MessageBoxIcon.Information);
0 commit comments