添加远程执行快捷参数

This commit is contained in:
yi-ge 2019-08-25 23:46:35 +08:00
parent 533f74e116
commit 5c2bc0824f
2 changed files with 38 additions and 17 deletions

View File

@ -152,16 +152,22 @@ SOFTWARE.
"
echo "What do you want to do?"
select var in "Install (I accept the MIT License.)" "Uninstall" "Exit"; do
break;
done
echo "You have selected $var."
if [[ $var == "Install (I accept the MIT License.)" ]]; then
if [[ "$1" == "--install" ]]; then
Install
elif [[ $var == "Uninstall" ]]; then
elif [[ "$1" == "--uninstall" ]]; then
Uninstall
else
exit 0
echo "What do you want to do?"
select var in "Install (I accept the MIT License.)" "Uninstall" "Exit"; do
break;
done
echo "You have selected $var."
if [[ $var == "Install (I accept the MIT License.)" ]]; then
Install
elif [[ $var == "Uninstall" ]]; then
Uninstall
else
exit 0
fi
fi

View File

@ -139,7 +139,8 @@ namespace setup
return output;
}
} catch (Exception ex)
}
catch (Exception ex)
{
return ex.ToString();
}
@ -285,12 +286,26 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.");
Console.WriteLine("");
Console.WriteLine("");
Console.WriteLine("What do you want to do?");
Console.WriteLine("1) Install (I accept the MIT License.)");
Console.WriteLine("2) Uninstall");
Console.WriteLine("3) Exit");
Console.Write("#?");
string cmd = Console.ReadLine();
string cmd = "";
if (args.Length > 0 && (args[0] == "--install" || args[0] == "/install"))
{
cmd = "1";
}
else if (args.Length > 0 && (args[0] == "--uninstall" || args[0] == "/uninstall"))
{
cmd = "2";
}
else
{
Console.WriteLine("What do you want to do?");
Console.WriteLine("1) Install (I accept the MIT License.)");
Console.WriteLine("2) Uninstall");
Console.WriteLine("3) Exit");
Console.Write("#?");
cmd = Console.ReadLine();
}
if (cmd == "1")
{
@ -314,7 +329,7 @@ SOFTWARE.");
Mkdir("C:\\WINDOWS\\dc-agent\\bin");
DownLoadOneFile(downloadURL, "C:\\WINDOWS\\dc-agent\\bin\\dc-agent.exe");
Console.WriteLine(ExecuteOutCmd("C:\\WINDOWS\\dc-agent\\bin\\dc-agent.exe", "install"));
Console.WriteLine(ExecuteOutCmd("C:\\WINDOWS\\dc-agent\\bin\\dc-agent.exe", "start"));