디버그

This commit is contained in:
leedongmyung[desktop] 2023-10-29 12:44:03 +09:00
parent a051432b33
commit 88770edc1b
2 changed files with 25 additions and 14 deletions

View file

@ -29,7 +29,7 @@ class CommandInstall extends CommandBase {
await target.copy(installFilePath!); await target.copy(installFilePath!);
//Regist path //Regist path
RegistPath.OS?.add(installPath); await RegistPath.OS?.add(installPath);
//Create startup //Create startup
await OSStartup.registStartup(installFilePath, label, await OSStartup.registStartup(installFilePath, label,
@ -62,7 +62,7 @@ class CommandUninstall extends CommandBase {
//To-do: Proccess kill //To-do: Proccess kill
//Regist path //Regist path
RegistPath.OS?.remove(installPath); await RegistPath.OS?.remove(installPath);
//Remove Installed file //Remove Installed file
var installDir = Directory(installPath); var installDir = Directory(installPath);

View file

@ -1,6 +1,7 @@
import 'dart:io'; import 'dart:io';
import 'package:dart_framework/platform/process.dart'; import 'package:dart_framework/platform/process.dart';
import 'package:dart_framework/utils/system_util.dart';
class RegistPath { class RegistPath {
static RegistPath? _instance; static RegistPath? _instance;
@ -18,39 +19,49 @@ class RegistPath {
return _instance; return _instance;
} }
void add(String path) { Future add(String path) async {
_instance?.add(path); return await _instance?.add(path);
} }
void remove(String path) { Future remove(String path) async {
_instance?.remove(path); return await _instance?.remove(path);
} }
} }
class _RegistPathOSX extends RegistPath { class _RegistPathOSX extends RegistPath {
@override @override
void add(String path) {} Future add(String path) async {
return null;
}
@override @override
void remove(String path) {} Future remove(String path) async {
return null;
}
} }
class _RegistPathLinux extends RegistPath { class _RegistPathLinux extends RegistPath {
@override @override
void add(String path) {} Future add(String path) async {
return null;
}
@override @override
void remove(String path) {} Future remove(String path) async {
return null;
}
} }
class _RegistPathWindows extends RegistPath { class _RegistPathWindows extends RegistPath {
@override @override
void add(String path) { Future add(String path) async {
ProcessExecutor.run(StringBuffer('setx path "%path%;$path"')); await ProcessExecutor.run(StringBuffer('setx path "%path%;$path"'));
return simpleFuture;
} }
@override @override
void remove(String path) { Future remove(String path) async {
ProcessExecutor.run(StringBuffer('setx path "%path:$path=%"')); await ProcessExecutor.run(StringBuffer('setx path "%path:$path=%"'));
return simpleFuture;
} }
} }