Skip to content

Commit

Permalink
Update windows_evb_config_generator.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
sun-jiao committed Mar 4, 2024
1 parent 86918af commit 508dc11
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions dev/windows_evb_config_generator.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dart:io';

import 'package:flutter/animation.dart';
import 'package:xml/xml.dart';

void main() {
Expand All @@ -20,7 +21,9 @@ void main() {
builder.element('Enabled', nest: 'True');
builder.element('DeleteExtractedOnExit', nest: 'False');
builder.element('CompressFiles', nest: 'False');
buildDir(builder, '%DEFAULT FOLDER%', entities);
builder.element('Files', nest: () {
buildDir(builder, '%DEFAULT FOLDER%', entities);
});
});
builder.element('Registries', nest: () {
builder.element('Enabled', nest: 'False');
Expand All @@ -43,12 +46,11 @@ void main() {
builder.element('ProcessesOfAnyPlatforms', nest: 'False');
});
builder.element('Storage', nest: () {
builder.element('Storage', nest: () {
builder.element('Files', nest: () {
builder.element('Enabled', nest: 'False');
builder.element('Folder', nest: '%DEFAULT FOLDER%\\');
builder.element('RandomFileNames', nest: 'False');
builder.element('EncryptContent', nest: 'False');
builder.element('ProcessesOfAnyPlatforms', nest: 'False');
});
});
});
Expand Down Expand Up @@ -81,19 +83,19 @@ void buildDir(XmlBuilder builder, String name, List<FileSystemEntity> entities)
builder.element('OverwriteAttributes', nest: 'False');
builder.element('HideFromDialogs', nest: 0);
builder.element('Files', nest: () {
for (final file in entities.whereType<File>()) {
buildFile(builder, file.name, file.absolute.path);
}

for (final dir in entities.whereType<Directory>()) {
buildDir(builder, dir.name, dir.listSync());
}

for (final file in entities.whereType<File>()) {
buildFile(builder, file.name, file.absolute.path);
}
});
});
}

void buildRegistry(XmlBuilder builder, String name) {
builder.element('File', nest: () {
builder.element('Registry', nest: () {
builder.element('Type', nest: 1);
builder.element('Virtual', nest: 'True');
builder.element('Name', nest: name);
Expand Down

0 comments on commit 508dc11

Please sign in to comment.