File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Collections . Immutable ;
3
+ using System . Text ;
3
4
using System . Xml ;
4
5
5
6
namespace Schneegans . Unattend ;
@@ -16,7 +17,7 @@ Configuration.Default with
16
17
ImageLanguage : generator . Lookup < ImageLanguage > ( "en-US" ) ,
17
18
LocaleAndKeyboard : new LocaleAndKeyboard (
18
19
generator . Lookup < UserLocale > ( "en-US" ) ,
19
- generator . Lookup < KeyboardIdentifier > ( "0409: 00000409" )
20
+ generator . Lookup < KeyboardIdentifier > ( "00000409" )
20
21
) ,
21
22
LocaleAndKeyboard2 : null ,
22
23
LocaleAndKeyboard3 : null ,
@@ -30,11 +31,16 @@ Configuration.Default with
30
31
) ,
31
32
}
32
33
) ;
33
- using XmlWriter writer = XmlWriter . Create ( Console . Out , new XmlWriterSettings ( )
34
+
35
+ string path = Environment . ExpandEnvironmentVariables ( @"%TEMP%\autounattend.xml" ) ;
36
+ using var writer = XmlWriter . Create ( path , new XmlWriterSettings ( )
34
37
{
35
- CloseOutput = false ,
38
+ Encoding = new UTF8Encoding ( encoderShouldEmitUTF8Identifier : false ) ,
39
+ CloseOutput = true ,
36
40
Indent = true ,
41
+ IndentChars = "\t " ,
42
+ NewLineChars = "\r \n " ,
37
43
} ) ;
38
- xml . WriteTo ( writer ) ;
44
+ xml . Save ( writer ) ;
39
45
}
40
46
}
You can’t perform that action at this time.
0 commit comments