diff --git a/lib/cli/commands/command_const.dart b/lib/cli/commands/command_const.dart index ddf2738..ad74bfc 100644 --- a/lib/cli/commands/command_const.dart +++ b/lib/cli/commands/command_const.dart @@ -23,6 +23,10 @@ class _CommandConstantBase { String get installPath { return ''; } + + String get installFilePath { + return ''; + } } class _CommandConstantOSX extends _CommandConstantBase { @@ -30,6 +34,11 @@ class _CommandConstantOSX extends _CommandConstantBase { String get installPath { return ''; } + + @override + String get installFilePath { + return ''; + } } class _CommandConstantLinux extends _CommandConstantBase { @@ -37,6 +46,11 @@ class _CommandConstantLinux extends _CommandConstantBase { String get installPath { return ''; } + + @override + String get installFilePath { + return ''; + } } class _CommandConstantWindows extends _CommandConstantBase { @@ -47,4 +61,10 @@ class _CommandConstantWindows extends _CommandConstantBase { var userPath = Platform.environment['UserProfile']; return '$userPath$windowRoamingPath${CLI.serviceName}'; } + + @override + String get installFilePath { + return '$installPath\\${CLI.serviceName}.exe'; + ; + } } diff --git a/lib/cli/commands/command_install.dart b/lib/cli/commands/command_install.dart index 4f60147..4d9687a 100644 --- a/lib/cli/commands/command_install.dart +++ b/lib/cli/commands/command_install.dart @@ -25,8 +25,8 @@ class CommandInstall extends CommandBase { //Copy executable file var target = File(Platform.resolvedExecutable); - var installFilePath = '$installPath\\$label'; - await target.copy(installFilePath); + var installFilePath = CommandConstant.OS?.installFilePath; + await target.copy(installFilePath!); //Regist path RegistPath.OS?.add(installPath);