File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ Future<void> main(List<String> args) async {
1212 if (args.isEmpty) {
1313 final guiPath =
1414 "${mainPath .substring (0 , mainPath .lastIndexOf ("\\ " ))}\\ revitoolw.exe" ;
15- if (await File (guiPath).exists ()) {
15+ if (File (guiPath).existsSync ()) {
1616 await Process .start ('revitoolw' , []);
1717 exit (0 );
1818 }
@@ -21,12 +21,15 @@ Future<void> main(List<String> args) async {
2121
2222 logger.i ('Revision Tool CLI is starting' );
2323
24- final runner = CommandRunner <String >("revitool" ,
25- "Revision Tool CLI v${const String .fromEnvironment ('APP_VERSION' , defaultValue : '1.0.0' )}" )
26- ..addCommand (MSStoreCommand ())
27- ..addCommand (DefenderCommand ())
28- ..addCommand (WindowsPackageCommand ())
29- ..addCommand (PlaybookPatchesCommand ());
24+ final runner =
25+ CommandRunner <String >(
26+ "revitool" ,
27+ "Revision Tool CLI v${const String .fromEnvironment ('APP_VERSION' , defaultValue : '1.0.0' )}" ,
28+ )
29+ ..addCommand (MSStoreCommand ())
30+ ..addCommand (DefenderCommand ())
31+ ..addCommand (WindowsPackageCommand ())
32+ ..addCommand (PlaybookPatchesCommand ());
3033 // ..addCommand(RecommendationCommand());
3134 await runner.run (args);
3235 exit (0 );
Original file line number Diff line number Diff line change @@ -38,11 +38,20 @@ typedef IsRunningCDart = int Function(Pointer<Utf16>);
3838bool isProcessRunning (String name) {
3939 final dllPath =
4040 const bool .fromEnvironment ("dart.vm.product" )
41- ? path.join (path.current, 'process_checker.dll' )
41+ ? path.join (
42+ mainPath.substring (0 , mainPath.lastIndexOf ("\\ " )),
43+ 'process_checker.dll' ,
44+ )
4245 : path.join (
4346 path.current.substring (0 , path.current.lastIndexOf ('\\ ' )),
4447 'native_utils\\ process_checker.dll' ,
4548 ); // for dev purposes
49+
50+ if (! File (dllPath).existsSync ()) {
51+ logger.e ('DLL not found: $dllPath ' );
52+ return false ;
53+ }
54+
4655 final dylib = DynamicLibrary .open (dllPath);
4756
4857 final isRunningC = dylib.lookupFunction <IsRunningCFunc , IsRunningCDart >(
You can’t perform that action at this time.
0 commit comments