@@ -2059,16 +2059,30 @@ private void ExportToVisualStudio_Click(object sender, RoutedEventArgs e)
20592059 Directory . CreateDirectory ( projectDirectory ) ;
20602060
20612061 // Write solution file
2062- File . WriteAllText ( solutionFile ,
2063- Res . VSSolution
2064- . Replace ( "$guid1$" , projectGuid )
2065- . Replace ( "$guid2$" , Guid . NewGuid ( ) . ToString ( ) )
2066- . Replace ( "$guid2$" , Guid . NewGuid ( ) . ToString ( ) )
2067- . Replace ( "$projectname$" , projectName ) ) ;
2062+ if ( ! File . Exists ( projectFile )
2063+ || MessageBox . Show ( $ "The solution file \" { solutionFile } \" already exists.\r \n Do you want to override it ?",
2064+ "Solution file override" ,
2065+ MessageBoxButton . YesNo ,
2066+ MessageBoxImage . Question ) == MessageBoxResult . Yes )
2067+ {
2068+ File . WriteAllText ( solutionFile ,
2069+ Res . VSSolution
2070+ . Replace ( "$guid1$" , projectGuid )
2071+ . Replace ( "$guid2$" , Guid . NewGuid ( ) . ToString ( ) )
2072+ . Replace ( "$guid2$" , Guid . NewGuid ( ) . ToString ( ) )
2073+ . Replace ( "$projectname$" , projectName ) ) ;
2074+ }
20682075
20692076 // Write project file
2070- File . WriteAllText ( projectFile ,
2071- Res . VSProject ) ;
2077+ if ( ! File . Exists ( projectFile )
2078+ || MessageBox . Show ( $ "The project file \" { projectFile } \" already exists.\r \n Do you want to override it ?",
2079+ "Project file override" ,
2080+ MessageBoxButton . YesNo ,
2081+ MessageBoxImage . Question ) == MessageBoxResult . Yes )
2082+ {
2083+ File . WriteAllText ( projectFile ,
2084+ Res . VSProject ) ;
2085+ }
20722086
20732087 // Write Entry file
20742088 File . WriteAllText ( entryFile ,
0 commit comments