@@ -140,26 +140,26 @@ private class TxtSetupFileEntry
140140
141141 public enum ProductMasks
142142 {
143- VER_SUITE_SMALLBUSINESS = 0x00000001 ,
144- VER_SUITE_SMALLBUSINESS_RESTRICTED = 0x00000020 ,
143+ VER_SUITE_SMALLBUSINESS = 0x00000001 ,
144+ VER_SUITE_SMALLBUSINESS_RESTRICTED = 0x00000020 ,
145145
146- VER_SUITE_EMBEDDEDNT = 0x00000040 ,
147- VER_SUITE_EMBEDDED_RESTRICTED = 0x00000800 ,
146+ VER_SUITE_EMBEDDEDNT = 0x00000040 ,
147+ VER_SUITE_EMBEDDED_RESTRICTED = 0x00000800 ,
148148
149- VER_SUITE_TERMINAL = 0x00000010 ,
150- VER_SUITE_SINGLEUSERTS = 0x00000100 ,
151- VER_SUITE_MULTIUSERTS = 0x00020000 ,
149+ VER_SUITE_TERMINAL = 0x00000010 ,
150+ VER_SUITE_SINGLEUSERTS = 0x00000100 ,
151+ VER_SUITE_MULTIUSERTS = 0x00020000 ,
152152
153- VER_SUITE_ENTERPRISE = 0x00000002 ,
154- VER_SUITE_BACKOFFICE = 0x00000004 ,
155- VER_SUITE_COMMUNICATIONS = 0x00000008 ,
156- VER_SUITE_DATACENTER = 0x00000080 ,
157- VER_SUITE_PERSONAL = 0x00000200 ,
158- VER_SUITE_BLADE = 0x00000400 ,
159- VER_SUITE_SECURITY_APPLIANCE = 0x00001000 ,
160- VER_SUITE_STORAGE_SERVER = 0x00002000 ,
161- VER_SUITE_COMPUTE_SERVER = 0x00004000 ,
162- VER_SUITE_WH_SERVER = 0x00008000
153+ VER_SUITE_ENTERPRISE = 0x00000002 ,
154+ VER_SUITE_BACKOFFICE = 0x00000004 ,
155+ VER_SUITE_COMMUNICATIONS = 0x00000008 ,
156+ VER_SUITE_DATACENTER = 0x00000080 ,
157+ VER_SUITE_PERSONAL = 0x00000200 ,
158+ VER_SUITE_BLADE = 0x00000400 ,
159+ VER_SUITE_SECURITY_APPLIANCE = 0x00001000 ,
160+ VER_SUITE_STORAGE_SERVER = 0x00002000 ,
161+ VER_SUITE_COMPUTE_SERVER = 0x00004000 ,
162+ VER_SUITE_WH_SERVER = 0x00008000
163163 }
164164
165165 public string GetSkuFromTxtSetupMedia ( ulong build )
@@ -393,47 +393,63 @@ private void LoadTxtSetupData(IFileSystem originalFs, string pathInFs)
393393 var vdata = el . Value . Split ( ',' ) ;
394394
395395 var filename = el . KeyName ;
396- if ( vdata . Length >= filenameid + 1 && ! string . IsNullOrEmpty ( vdata [ filenameid ] ) )
396+ try
397397 {
398- filename = vdata [ filenameid ] ;
398+ if ( vdata . Length >= filenameid + 1 && ! string . IsNullOrEmpty ( vdata [ filenameid ] ) )
399+ {
400+ filename = vdata [ filenameid ] ;
401+ }
399402 }
403+ catch { }
400404
401405 filename = filename . Replace ( "\" " , "" ) ;
402406
403- if ( filename . Contains ( "%" ) )
407+ try
404408 {
405- var nonescapedpart = filename . Split ( "%" ) [ 1 ] ;
406- var replacement = strings [ nonescapedpart ] ;
407- filename = filename . Replace ( "%" + nonescapedpart + "%" , replacement ) . Replace ( "\" " , "" ) ;
409+ if ( filename . Contains ( "%" ) )
410+ {
411+ var nonescapedpart = filename . Split ( "%" ) [ 1 ] ;
412+ var replacement = strings [ nonescapedpart ] ;
413+ filename = filename . Replace ( "%" + nonescapedpart + "%" , replacement ) . Replace ( "\" " , "" ) ;
414+ }
408415 }
416+ catch { }
409417
410- var directoryId = vdata [ dirid ] ;
411- string directory ;
412- int ret ;
413- if ( directoryId == "" || ! int . TryParse ( directoryId , out ret ) || dstdirs . GetKeyData ( directoryId ) == null )
414- {
415- directory = "system32" ;
416- }
417- else
418+ try
418419 {
419- directory = dstdirs . GetKeyData ( directoryId ) . Value . Replace ( "\" " , "" ) ;
420- }
420+ var directoryId = vdata [ dirid ] ;
421+ string directory ;
422+ int ret ;
423+ if ( directoryId == "" || ! int . TryParse ( directoryId , out ret ) || dstdirs . GetKeyData ( directoryId ) == null )
424+ {
425+ directory = "system32" ;
426+ }
427+ else
428+ {
429+ directory = dstdirs . GetKeyData ( directoryId ) . Value . Replace ( "\" " , "" ) ;
430+ }
421431
422- if ( directory . Contains ( "%" ) )
423- {
424- var nonescapedpart = directory . Split ( "%" ) [ 1 ] ;
425- var replacement = strings [ nonescapedpart ] ;
426- directory = directory . Replace ( "%" + nonescapedpart + "%" , replacement ) . Replace ( "\" " , "" ) ;
427- }
432+ try
433+ {
434+ if ( directory . Contains ( "%" ) )
435+ {
436+ var nonescapedpart = directory . Split ( "%" ) [ 1 ] ;
437+ var replacement = strings [ nonescapedpart ] ;
438+ directory = directory . Replace ( "%" + nonescapedpart + "%" , replacement ) . Replace ( "\" " , "" ) ;
439+ }
440+ }
441+ catch { }
428442
429- if ( directory == @"\" )
430- {
431- fileList . Add ( new TxtSetupFileEntry ( ) { Path = Path . Combine ( defdir , filename ) , DiscLocation = el . KeyName } ) ;
432- }
433- else
434- {
435- fileList . Add ( new TxtSetupFileEntry ( ) { Path = Path . Combine ( defdir , directory , filename ) , DiscLocation = el . KeyName } ) ;
443+ if ( directory == @"\" )
444+ {
445+ fileList . Add ( new TxtSetupFileEntry ( ) { Path = Path . Combine ( defdir , filename ) , DiscLocation = el . KeyName } ) ;
446+ }
447+ else
448+ {
449+ fileList . Add ( new TxtSetupFileEntry ( ) { Path = Path . Combine ( defdir , directory , filename ) , DiscLocation = el . KeyName } ) ;
450+ }
436451 }
452+ catch { }
437453 }
438454
439455 entries = fileList . ToArray ( ) ;
0 commit comments