From 4f1421c88e1df5533e231e3ecbf309d9013b07ee Mon Sep 17 00:00:00 2001 From: zontreck Date: Sat, 31 Aug 2024 02:34:17 -0700 Subject: [PATCH] Start adding a registry editor --- compile.bat | 1 + compile.sh | 1 + dart/bin/regedit.dart | 25 +++++++++++++++++++++++++ installscript.sh | 4 +++- 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 dart/bin/regedit.dart diff --git a/compile.bat b/compile.bat index 1b0dbc1..7029b71 100644 --- a/compile.bat +++ b/compile.bat @@ -21,5 +21,6 @@ call dart compile exe -o out\\nbt2snbt.exe bin\\nbt2snbt.dart call dart compile exe -o out\\snbt2nbt.exe bin\\snbt2nbt.dart call dart compile exe -o out\\pause.exe bin\\pause.dart call dart compile exe -o out\\sleep.exe bin\\sleep.dart +call dart compile exe -o out\\regedit.exe bin\\regedit.dart cd .. \ No newline at end of file diff --git a/compile.sh b/compile.sh index 8a9c159..313ae64 100755 --- a/compile.sh +++ b/compile.sh @@ -17,6 +17,7 @@ dart compile exe -o out/snbt2nbt-linux-x64 bin/snbt2nbt.dart dart compile exe -o out/uuidgen-linux-x64 bin/uuidgen.dart dart compile exe -o out/pause-linux-x64 bin/pause.dart dart compile exe -o out/sleep-linux-x64 bin/sleep.dart +dart compile exe -o out/regedit-linux-x64 bin/regedit.dart cd .. diff --git a/dart/bin/regedit.dart b/dart/bin/regedit.dart new file mode 100644 index 0000000..b38379b --- /dev/null +++ b/dart/bin/regedit.dart @@ -0,0 +1,25 @@ +import 'package:dart/constants.dart'; +import 'package:libac_dart/argparse/Args.dart'; +import 'package:libac_dart/argparse/Builder.dart'; +import 'package:libac_dart/argparse/CLIHelper.dart'; +import 'package:libac_dart/argparse/types/Bool.dart'; +import 'package:libac_dart/consts.dart'; + +Future main(List args) async { + String HEADER = "Registry Editor\nVersion: ${HelperConsts.REGEDIT_VERSION}\nUsing Bundled LibAC: ${Constants.VERSION}\nAuthor: Tara Piccari\n"; + + Arguments defaults = ArgumentsBuilder.builder() + .withArgument(BoolArgument(name: "help", description: "Oh hey it's me!")) + .withArgument(BoolArgument(name: "add", description: "Add or update registry value")) + .withArgument(BoolArgument(name: "del", description: "Delete Registry value")) + .build(); + + Arguments parsed = await CLIHelper.parseArgs(args, Arguments()); + + if(parsed.count==0 || parsed.hasArg("help")) { + print("${HEADER}\n\n${CLIHelper.makeArgCLIHelp(defaults)}"); + } + + + return 0; +} \ No newline at end of file diff --git a/installscript.sh b/installscript.sh index 6075c2d..76d1ea5 100644 --- a/installscript.sh +++ b/installscript.sh @@ -69,8 +69,10 @@ download_with_retry "https://ci.zontreck.com/job/Projects/job/Dart/job/SimpleHel download_with_retry "https://ci.zontreck.com/job/Projects/job/Dart/job/SimpleHelperTools/job/main/lastSuccessfulBuild/artifact/dart/out/mkfsreport-linux-x64" "/usr/bin/mkfsreport" +download_with_retry "https://ci.zontreck.com/job/Projects/job/Dart/job/SimpleHelperTools/job/main/lastSuccessfulBuild/artifact/dart/out/regedit-linux-x64" "/usr/bin/regedit" + # Set executable permissions -$SUDO_CMD chmod +x /usr/bin/{nbt2snbt,snbt2nbt,pause,mkfsreport,dbikc,vsleep,uuidgen} +$SUDO_CMD chmod +x /usr/bin/{nbt2snbt,snbt2nbt,pause,mkfsreport,dbikc,vsleep,uuidgen,regedit} echo "Installation Completed" vsleep 5