public static string[] ReplaceArgs(string[] args, string productId) { for (int i = 0; i < args.Length; ++i) { if (args[i].Equals("${passport}")) { Passport pass = Passport.GetPassport(Config.Instance.AuthInfo).Result; args[i] = pass.passport; } if (args[i].Equals("${windir}")) { args[i] = $"\"{Environment.GetEnvironmentVariable("WINDIR")}\""; } if (args[i].Equals("${product_id}")) { args[i] = productId; } if (args[i].Contains("${language_code}")) { args[i] = args[i].Replace("${language_code}", "en_US"); } } return(args); }