File tree Expand file tree Collapse file tree
StreamDeckSimHub.Installer/Actions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,11 +41,22 @@ private bool DeleteExistingInstallation(string pluginDir)
4141 {
4242 try
4343 {
44- // Delete all files in the base directory
4544 var baseDirInfo = new DirectoryInfo ( pluginDir ) ;
45+
46+ // Delete all files in the base directory.
47+ // This is where most user issues arise, which is why we keep very detailed logs here.
4648 foreach ( var fileInfo in baseDirInfo . EnumerateFiles ( ) )
4749 {
48- fileInfo . Delete ( ) ;
50+ try
51+ {
52+ fileInfo . Delete ( ) ;
53+ }
54+ catch ( Exception e )
55+ {
56+ SetAndLogError ( e , $ "Could not delete existing installation: File={ fileInfo . FullName } , " +
57+ "Type={e.GetType().FullName}, HResult=0x{e.HResult:x8}, Message={e.Message}" ) ;
58+ return false ;
59+ }
4960 }
5061
5162 // Delete all directories recursive in the base directory - except "images"
@@ -65,7 +76,8 @@ private bool DeleteExistingInstallation(string pluginDir)
6576 }
6677 catch ( Exception e )
6778 {
68- SetAndLogError ( e , $ "Could not delete existing installation: { e . Message } ") ;
79+ SetAndLogError ( e , $ "Could not delete existing installation: File=(subdirectory), " +
80+ "Type={e.GetType().FullName}, HResult=0x{e.HResult:x8}, Message={e.Message}" ) ;
6981 return false ;
7082 }
7183 }
You can’t perform that action at this time.
0 commit comments