Esempio n. 1
0
        public async Task InstallAppAsync(string filePath, DeployTargetDevice device)
        {
            try
            {
                var result = await this.RunWinAppDeployCmdAsync(
                    "install",
                    $"-file \"{filePath}\"",
                    $"-ip {device.IP}" //,
                                       //$"-guid {device.Guid}" //,
                                       //$"-pin {pin}"
                    );

                // TODO: Process output
                var sanizited = result.StandarOutput.CleanHeader().CleanFooter();
                // TODO: Parse devices
                if (!sanizited.Contains("Remote action succeeded"))
                {
                    var error = sanizited.GetInstallError();
                    throw new Exception(error);
                }
            }
            catch (Exception ex)
            {
                var aex = 5;
                throw;
            }
        }
Esempio n. 2
0
        public async Task UpdateAppAsync(string filePath, DeployTargetDevice device)
        {
            var result = await this.RunWinAppDeployCmdAsync(
                "update",
                $"-file \"{filePath}\"",
                $"-ip {device.IP}"
                );

            // TODO: Process output
            var sanizited = result.StandarOutput.CleanHeader().CleanFooter();
            // TODO: Parse devices
        }
Esempio n. 3
0
        public async Task UnistallAppAsync(WinApp app, DeployTargetDevice device)
        {
            var result = await this.RunWinAppDeployCmdAsync(
                "uninstall",
                $"-package \"{app.PackageName}\"",
                $"-ip {device.IP}"
                );

            // TODO: Process output
            var success   = result.StandarOutput.IsCmdOperationSuccess();
            var sanizited = result.StandarOutput.CleanHeader().CleanFooter();
            // TODO: Parse devices
        }
Esempio n. 4
0
        public async Task <IList <WinApp> > GetInstalledAppsAsync(DeployTargetDevice device)
        {
            var result = await this.RunWinAppDeployCmdAsync(
                "list",
                $"-ip {device.IP}");

            var sanizited = result.StandarOutput.CleanHeader().CleanFooter().CleanListingHeader().CleanListingFooter().Trim();

            var lines = Regex.Split(sanizited, "\\n", RegexOptions.CultureInvariant);

            var apps = lines
                       .Select(name => new WinApp
            {
                PackageName  = name.Trim(),
                Architecture = this.GetAppArchitecture(name)
            })
                       .ToList();

            return(apps);
        }