public WindowsPhoneWebBrowser(ILogger logger, Func <byte[]> xapHost)
        {
            _logger  = logger;
            _xapHost = xapHost;

            var      dsmgrObj = new DatastoreManager(1033);
            Platform wp7Sdk   = dsmgrObj.GetPlatforms().First();

            foreach (var device in wp7Sdk.GetDevices())
            {
                _logger.Debug(device.Name);
            }

            //TODO: hook up to real wp7 phone and see if we can get StatLight to run on that?
            bool useEmulator = true;

            if (useEmulator)
            {
                _wp7Device = wp7Sdk.GetDevices().Single(d => d.Name == "Windows Phone 7 Emulator" || d.Name == "Windows Phone Emulator");
            }
            else
            {
                _wp7Device = wp7Sdk.GetDevices().Single(d => d.Name == "Windows Phone 7 Device");
            }
        }
Esempio n. 2
0
        private static void Usage()
        {
            Console.WriteLine("DeployNetCF {platformId} {deviceId} {package} {cabfilename.cab}");

            var dsmgr = new DatastoreManager(1033);

            Console.WriteLine();
            Console.WriteLine("PlatformId can be:");
            foreach (var platform in dsmgr.GetPlatforms())
            {
                Console.WriteLine("  {0}: {1}", platform.Id, platform.Name);
            }

            Console.WriteLine();
            Console.WriteLine("DevicesId can be:");
            foreach (var platform in dsmgr.GetPlatforms())
            {
                foreach (var device in platform.GetDevices())
                {
                    Console.WriteLine("  {0}: {1}", device.Id, device.Name);
                }
            }

            Console.WriteLine();
            Console.WriteLine("Package ID can be:");
            Console.WriteLine("  ABD785F0-CDA7-41c5-8375-2451A7CBFF26: .NET Compact Framework 2.0");
            Console.WriteLine("  ABD785F0-CDA7-41c5-8375-2451A7CBFF37: .NET Compact Framework 3.5");
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            DatastoreManager dsmgrObj = new DatastoreManager(1033);
            Platform WP8SDK = dsmgrObj.GetPlatforms().Single(p => p.Name == "Windows Phone 8");

            bool useEmulator = true;
            Device WP8Device = null;

            if (args[4] == "dev")
                useEmulator = false;

            if (useEmulator)
           //     WP8Device = WP8SDK.GetDevices().First(d => d.Name.StartsWith("Windows Phone Emulator") || d.Name.StartsWith("Windows Phone 8 Emulator"));
                WP8Device = WP8SDK.GetDevices().First(d => d.Name.StartsWith("Emulator WVGA"));
            else
                WP8Device = WP8SDK.GetDevices().First(d => d.Name.StartsWith("Windows Phone Device") || d.Name.StartsWith("Windows Phone 8 Device"));

            Console.WriteLine("Connecting to Windows Phone 8 Emulator/Device...");
            WP8Device.Connect();
            Console.WriteLine("Windows Phone 8 Emulator/Device Connected...");

            Guid appID = new Guid(args[0]);
            RemoteApplication app;
            if (WP8Device.IsApplicationInstalled(appID))
            {
                Console.WriteLine("Updating sample XAP to Windows Phone 8 Emulator/Device...");

                app = WP8Device.GetApplication(appID);

                //app.Uninstall();
                app.UpdateApplication(args[1],
                                      args[2],
                                      args[3]);

                Console.WriteLine("Sample XAP Updated on Windows Phone 8 Emulator/Device...");

                Console.WriteLine("Launching sample app on Windows Phone 8 Emulator...");
                app.Launch();
                Console.WriteLine("Launched sample app on Windows Phone 8 Emulator...");

                return;
            }

            Console.WriteLine("Installing sample XAP to Windows Phone 8 Emulator/Device...");

            app = WP8Device.InstallApplication(
                appID,
                appID,
                args[1],
                args[2],
                args[3]);

            Console.WriteLine("Sample XAP installed to Windows Phone 8 Emulator...");

            Console.WriteLine("Launching sample app on Windows Phone 8 Emulator...");
            app.Launch();
            Console.WriteLine("Launched sample app on Windows Phone 8 Emulator...");
        }
        public void Setup()
        {
            Manager = new DatastoreManager("abcd");

            var factory = new Mock <IApiRequestFactory>();

            ApiRequestFactory.Current = factory.Object;
            RequestFactory            = factory;
        }
Esempio n. 5
0
        public static Device GetDevice()
        {
            DatastoreManager dsm        = new DatastoreManager(1033);
            ObjectId         pocketPCId = new ObjectId(POCKET_PC_PLATFORM_ID);
            Platform         platform   = dsm.GetPlatform(pocketPCId);

            ObjectId pocketPC2003VGA = new ObjectId("E282E6BE-C7C3-4ece-916A-88FB1CF8AF3C");

            return(platform.GetDevice(pocketPC2003VGA));
        }
Esempio n. 6
0
 private void Initialize()
 {
     if (!m_initialized)
     {
         var manager = new DatastoreManager(m_apiToken);
         m_ds    = manager.GetOrCreate(m_datastoreId.ToLowerInvariant());
         m_table = m_ds.GetTable <TEntity>(typeof(TEntity).Name);
         m_ds.Pull();
         m_initialized = true;
     }
 }
Esempio n. 7
0
 static void ListDevices()
 {
     // Get CoreCon WP7 SDK
     DatastoreManager dsmgrObj = new DatastoreManager(1033);
     Platform WP7SDK = dsmgrObj.GetPlatforms().Single(p => p.Name == "Windows Phone 7");
     Collection<Device> devices = WP7SDK.GetDevices();
     for (int index = 0; index < devices.Count; index++)
     {
         Device d = devices[index];
         string info = string.Format("{0} : {1} : {2}", index.ToString(), d.Id, d.Name);
         Log(info);
     }
 }
Esempio n. 8
0
        static void ListDevices()
        {
            // Get CoreCon WP7 SDK
            DatastoreManager    dsmgrObj = new DatastoreManager(1033);
            Platform            WP7SDK   = dsmgrObj.GetPlatforms().Single(p => p.Name == "Windows Phone 7");
            Collection <Device> devices  = WP7SDK.GetDevices();

            for (int index = 0; index < devices.Count; index++)
            {
                Device d    = devices[index];
                string info = string.Format("{0} : {1} : {2}", index.ToString(), d.Id, d.Name);
                Log(info);
            }
        }
        private Device FindDevice()
        {
            DatastoreManager      manager   = new DatastoreManager(1033);
            Collection <Platform> platforms = manager.GetPlatforms();

            if (platforms.Count == 0)
            {
                throw new WindowsPhoneDriverException("Found no platforms");
            }

            Platform platform = platforms.FirstOrDefault(p => p.Name.StartsWith("Windows Phone ", StringComparison.OrdinalIgnoreCase));

            this.SendStatusUpdate("Found platform {0}.", platform.Name);
            Collection <Device> devices = platform.GetDevices();

            if (devices.Count == 0)
            {
                throw new WindowsPhoneDriverException("Found no devices");
            }

            this.SendStatusUpdate("Searching for {1} device with name '{0}'.", this.deviceName, this.kind == ControllerKind.Emulator ? "emulated" : "physical");
            Device device = devices.FirstOrDefault(d => d.Name == this.deviceName && d.IsEmulator() == (this.kind == ControllerKind.Emulator));

            if (device != null)
            {
                this.SendStatusUpdate("Found device {0}.", device.Name);
            }
            else
            {
                this.SendStatusUpdate("No device found with name exactly matching '{0}'; looking for device with name contains '{0}'.", this.deviceName);
                device = devices.FirstOrDefault(d => d.Name.Contains(this.deviceName) && d.IsEmulator() == (this.kind == ControllerKind.Emulator));
            }

            if (device == null)
            {
                StringBuilder errorBuilder = new StringBuilder();
                errorBuilder.AppendFormat("No {1} device found for name matching or containing '{0}'. Found devices:", this.deviceName, this.kind == ControllerKind.Emulator ? "emulated" : "physical");
                foreach (Device currentDevice in devices)
                {
                    errorBuilder.AppendLine();
                    errorBuilder.AppendFormat("    {0} ({1} device)", currentDevice.Name, currentDevice.IsEmulator() ? "emulated" : "physical");
                }

                this.SendStatusUpdate(errorBuilder.ToString());
            }

            return(device);
        }
Esempio n. 10
0
        private static void Main()
        {
            Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location));

            Console.Title = Title;

            DatastoreManager.Initialise();
            foreach (CLandBlockInfo landBlockInfo in DatastoreManager.CellDatastore.GetLandBlockInfo())
            {
                if (landBlockInfo.IsDungeon())
                {
                    GenerateLandBlockTiles(landBlockInfo);
                }
            }

            log.Info("Finished!");
            Console.ReadLine();
        }
Esempio n. 11
0
 internal static XapDeployer.DeviceInfoClass[] GetDevices()
 {
     List<XapDeployer.DeviceInfoClass> list1 = new List<XapDeployer.DeviceInfoClass>();
     DatastoreManager datastoreManager1 = new DatastoreManager(CultureInfo.CurrentUICulture.LCID);
     IEnumerator<Platform> ienumerator1 = datastoreManager1.GetPlatforms().GetEnumerator();
     while (ienumerator1.MoveNext())
     {
         Platform platform1 = ienumerator1.Current;
         IEnumerator<Device> ienumerator2 = platform1.GetDevices().GetEnumerator();
         while (ienumerator2.MoveNext())
         {
             Device device1 = ienumerator2.Current;
             XapDeployer.DeviceInfoClass dev = new XapDeployer.DeviceInfoClass(platform1.Id.ToString(), device1.Id.ToString(), device1.Name);
             list1.Add(dev);
         }
     }
     return list1.ToArray();
 }
Esempio n. 12
0
        static void Main(string[] args)
        {
            DatastoreManager dsmgrObj = new DatastoreManager(1033);
            Platform WP7SDK = dsmgrObj.GetPlatforms().Single(p => p.Name == "Windows Phone 7");

            bool useEmulator = true;
            Device WP7Device = null;
            if (useEmulator)
                WP7Device = WP7SDK.GetDevices().Single(d => d.Name == "Windows Phone 7 Emulator");
            else
                WP7Device = WP7SDK.GetDevices().Single(d => d.Name == "Windows Phone 7 Device");

            Console.WriteLine("Connecting to Windows Phone 7 Emulator/Device...");
            WP7Device.Connect();
            Console.WriteLine("Windows Phone 7 Emulator/Device Connected...");

            Guid appID = new Guid(args[0]);
            RemoteApplication app;
            if (WP7Device.IsApplicationInstalled(appID))
            {
                Console.WriteLine("Uninstalling sample XAP to Windows Phone 7 Emulator/Device...");

                app = WP7Device.GetApplication(appID);
                app.Uninstall();

                Console.WriteLine("Sample XAP Uninstalled from Windows Phone 7 Emulator/Device...");
            }

            Console.WriteLine("Installing sample XAP to Windows Phone 7 Emulator/Device...");

            app = WP7Device.InstallApplication(
                appID,
                appID,
                args[1],
                args[2],
                args[3]);

            Console.WriteLine("Sample XAP installed to Windows Phone 7 Emulator...");

            Console.WriteLine("Launching sample app on Windows Phone 7 Emulator...");
            app.Launch();
            Console.WriteLine("Launched sample app on Windows Phone 7 Emulator...");
        }
Esempio n. 13
0
        internal static XapDeployer.DeviceInfoClass[] GetDevices()
        {
            List <XapDeployer.DeviceInfoClass> list1 = new List <XapDeployer.DeviceInfoClass>();
            DatastoreManager       datastoreManager1 = new DatastoreManager(CultureInfo.CurrentUICulture.LCID);
            IEnumerator <Platform> ienumerator1      = datastoreManager1.GetPlatforms().GetEnumerator();

            while (ienumerator1.MoveNext())
            {
                Platform             platform1    = ienumerator1.Current;
                IEnumerator <Device> ienumerator2 = platform1.GetDevices().GetEnumerator();
                while (ienumerator2.MoveNext())
                {
                    Device device1 = ienumerator2.Current;
                    XapDeployer.DeviceInfoClass dev = new XapDeployer.DeviceInfoClass(platform1.Id.ToString(), device1.Id.ToString(), device1.Name);
                    list1.Add(dev);
                }
            }
            return(list1.ToArray());
        }
Esempio n. 14
0
        public override void Run()
        {
            DatastoreManager dsmgr    = new DatastoreManager(1033);
            Platform         platform = dsmgr.GetPlatforms().Single(p => p.Name == "Windows Phone 7");
            Device           WP7emu   = platform.GetDevices().Single(d => d.Name == "Windows Phone 7 Emulator");

            WP7emu.Connect();
            Guid appGUID = new Guid(_xap.appID);
            RemoteApplication app;

            if (WP7emu.IsApplicationInstalled(appGUID))
            {
                app = WP7emu.GetApplication(appGUID);
                app.Launch();
            }
            else
            {
                MessageBox.Show("Application was not found!", "Error");
                return;
            }
        }
        /// <summary>
        /// Get Current Support Platform Device Object
        /// </summary>
        /// <param name="localId">Region Local Id</param>
        /// <returns>Device Object</returns>
        public static Device GetSupportPlatformDeviceObj(int localId,bool isDevice)
        {
            //Note By chenkai:
            //1033 is the LCID for English, United States and 1031 is the LCID for German, Germany.
            //Please Check List of Locale ID (LCID) Values as Assigned by Microsoft.
            //http://msdn.microsoft.com/zh-cn/goglobal/bb964664.aspx
            //Now Use English is 1031

            if (localId == 0)
                localId = 1031;
            Device currentDeviceObj = null;
            DatastoreManager datastoreManagerObj = new DatastoreManager(localId);
            Platform wp7Platform = datastoreManagerObj.GetPlatforms().Single(p => p.Name == "Windows Phone 7");
            if (wp7Platform != null)
            {
                if (isDevice)
                    currentDeviceObj = wp7Platform.GetDevices().Single(x => x.Name == "Windows Phone Device");
                else
                    currentDeviceObj = wp7Platform.GetDevices().Single(x => x.Name == "Windows Phone Emulator");
            }
            return currentDeviceObj;
        }
Esempio n. 16
0
        public static void RunXap(string xapPackage, string iconPath, Guid appGuid, string platformName, string deviceName)
        {
            var      datastoreManager = new DatastoreManager(1033);
            Platform wp7    = datastoreManager.GetPlatforms().Single(p => p.Name == platformName);
            Device   device = wp7.GetDevices().Single(c => c.Name == deviceName);

            try
            {
                Console.WriteLine("Connecting to {0}...", device.Name);
                device.Connect();
                Console.WriteLine("Connected.");
                bool isInstalled = device.IsApplicationInstalled(appGuid);
                RemoteApplication app;

                if (isInstalled)
                {
                    app = device.GetApplication(appGuid);
                    Console.WriteLine("Stopping running instances...");
                    app.TerminateRunningInstances();
                    Console.WriteLine("Application {0} installed. Removing...", appGuid);
                    app.Uninstall();
                }

                Console.WriteLine("Installing XAP...");
                app = device.InstallApplication(appGuid, appGuid, "apps.normal", iconPath, xapPackage);
                Console.WriteLine("Launching app...");
                app.Launch();
                Console.WriteLine("Launched...");
            }
            finally
            {
                if (device.IsConnected())
                {
                    Console.WriteLine("Disconnecting from {0}...", device.Name);
                    device.Disconnect();
                }
            }
        }
Esempio n. 17
0
        public static void RunXap(string xapPackage, string iconPath, Guid appGuid, string platformName, string deviceName)
        {
            var datastoreManager = new DatastoreManager(1033);
            Platform wp7 = datastoreManager.GetPlatforms().Single(p => p.Name == platformName);
            Device device = wp7.GetDevices().Single(c => c.Name == deviceName);
            try
            {
                Console.WriteLine("Connecting to {0}...", device.Name);
                device.Connect();
                Console.WriteLine("Connected.");
                bool isInstalled = device.IsApplicationInstalled(appGuid);
                RemoteApplication app;

                if (isInstalled)
                {
                    app = device.GetApplication(appGuid);
                    Console.WriteLine("Stopping running instances...");
                    app.TerminateRunningInstances();
                    Console.WriteLine("Application {0} installed. Removing...", appGuid);
                    app.Uninstall();
                }

                Console.WriteLine("Installing XAP...");
                app = device.InstallApplication(appGuid, appGuid, "apps.normal", iconPath, xapPackage);
                Console.WriteLine("Launching app...");
                app.Launch();
                Console.WriteLine("Launched...");
            }
            finally
            {
                if (device.IsConnected())
                {
                    Console.WriteLine("Disconnecting from {0}...", device.Name);
                    device.Disconnect();
                }
            }
        }
Esempio n. 18
0
        private void ConnectToDevice()
        {
            lock (_hasDeviceLock)
            {
                if (!_hasDevice)
                {
                    var dsmgrObj = new DatastoreManager(1033);
                    InvokeOnLogOutput("Platforms:");
                    foreach (var p in dsmgrObj.GetPlatforms())
                    {
                        InvokeOnLogOutput(" - " + p.Name);
                    }
                    InvokeOnLogOutput(" Looking for WP7 ");
                    var wp7Sdk =
                        dsmgrObj.GetPlatforms().Single(
                            p => p.Name == "New Windows Mobile 7 SDK" || p.Name == "Windows Phone 7");

                    InvokeOnLogOutput("Devices:");
                    foreach (var p in wp7Sdk.GetDevices())
                    {
                        InvokeOnLogOutput(" - " + p.Name);
                    }
                    InvokeOnLogOutput(" Looking for Emulator or Device ");
                    _wp7Device = UseEmulator
                                     ? wp7Sdk.GetDevices().Single(
                        d => d.Name.Contains("Windows Phone") && d.Name.Contains("Emulator"))
                                     : wp7Sdk.GetDevices().Single(
                        d => d.Name.Contains("Windows Phone") && d.Name.Contains("Device"));

                    InvokeOnLogOutput("Connecting to " + _wp7Device.Name);
                    _wp7Device.Connect();
                    InvokeOnLogOutput("Connected...");
                    _hasDevice = true;
                }
            }
        }
Esempio n. 19
0
 internal static XapDeployer.DeployResult InstallApplication(XapDeployer.DeviceInfoClass DeviceInfoClass, Guid appGuid, Version appVersion, string applicationGenre, string iconFile, string xapFile, XapDeployer.DeployBehaviourType DeployBehaviourType, ref Exception Exception)
 {
     Exception = null;
     try
     {
         DatastoreManager datastoreManager1 = new DatastoreManager(CultureInfo.CurrentUICulture.LCID);
         if (datastoreManager1 != null)
         {
             Platform platform1 = datastoreManager1.GetPlatform(new ObjectId(DeviceInfoClass.PlatformId));
             if (platform1 != null)
             {
                 Device device1 = platform1.GetDevice(new ObjectId(DeviceInfoClass.DeviceId));
                 if (device1 != null)
                 {
                     device1.Connect();
                     SystemInfo systemInfo1 = device1.GetSystemInfo();
                     Version version1 = new Version(systemInfo1.OSMajor, systemInfo1.OSMinor);
                     bool flag1 = appVersion.CompareTo(version1) > 0;
                     if (flag1)
                     {
                         device1.Disconnect();
                         return XapDeployer.DeployResult.NotSupported;
                     }
                     flag1 = device1.IsApplicationInstalled(appGuid);
                     if (flag1)
                     {
                         bool flag2 = DeployBehaviourType == XapDeployer.DeployBehaviourType.SkipApplication;
                         if (flag2)
                         {
                             device1.Disconnect();
                             return XapDeployer.DeployResult.Success;
                         }
                         else
                         {
                             RemoteApplication remoteApplication1 = device1.GetApplication(appGuid);
                             flag2 = DeployBehaviourType == XapDeployer.DeployBehaviourType.ForceUninstall;
                             if (flag2)
                             {
                                 remoteApplication1.Uninstall();
                             }
                             else
                             {
                                 flag2 = DeployBehaviourType == XapDeployer.DeployBehaviourType.UpdateApplication;
                                 if (flag2)
                                 {
                                     remoteApplication1.UpdateApplication(applicationGenre, iconFile, xapFile);
                                     device1.Disconnect();
                                     return XapDeployer.DeployResult.Success;
                                 }
                             }
                         }
                     }
                     device1.InstallApplication(appGuid, appGuid, applicationGenre, iconFile, xapFile);
                     device1.Disconnect();
                     return XapDeployer.DeployResult.Success;
                 }
             }
         }
     }
     catch (Exception e)
     {
         return XapDeployer.DeployResult.DeployError;
     }
     return XapDeployer.DeployResult.DeployError;
 }
Esempio n. 20
0
        static int Main(string[] args)
        {
            try
            {
                if (args.Length != 4)
                {
                    Usage();
                    return 1;
                }

                string platformId = args[0];
                string deviceId = args[1];
                string packageID;

                switch (args[2])
                {
                    case "2.0":
                        packageID = NetCf20PackageId;
                        break;

                    case "3.5":
                        packageID = NetCf35PackageId;
                        break;

                    default:
                        packageID = args[2];
                        break;
                }

                string cabName = args[3];

                // Get the datastore object
                var dsmgr = new DatastoreManager(1033);

                var platform = dsmgr.GetPlatform(new ObjectId(platformId));
                var device = platform.GetDevice(new ObjectId(deviceId));

                Console.WriteLine("Connecting to device...");
                device.Connect();

                FileDeployer fileDeployer = device.GetFileDeployer();

                Console.WriteLine("Deploying package...");
                fileDeployer.DownloadPackage(new ObjectId(packageID));

                Console.WriteLine("Installing package...");
                RemoteProcess installer = device.GetRemoteProcess();
                installer.Start("wceload.exe", cabName);
                while (installer.HasExited() != true)
                {
                    System.Threading.Thread.Sleep(1000);
                }
                var exitCode = installer.GetExitCode();
                if (exitCode != 0)
                {
                    Console.WriteLine("Installation failed. Exit code: {0}", exitCode);
                }
                else
                {
                    Console.WriteLine("Installation succeeded.");
                }
                return exitCode;
            }
            catch (Exception ex)
            {
                Console.WriteLine("ERROR: {0}", ex);
                return 1;
            }
        }
Esempio n. 21
0
        private static void Usage()
        {
            Console.WriteLine("DeployNetCF {platformId} {deviceId} {package} {cabfilename.cab}");

            var dsmgr = new DatastoreManager(1033);

            Console.WriteLine();
            Console.WriteLine("PlatformId can be:");
            foreach (var platform in dsmgr.GetPlatforms())
            {
                Console.WriteLine("  {0}: {1}", platform.Id, platform.Name);
            }

            Console.WriteLine();
            Console.WriteLine("DevicesId can be:");
            foreach (var platform in dsmgr.GetPlatforms())
            {
                foreach (var device in platform.GetDevices())
                {
                    Console.WriteLine("  {0}: {1}", device.Id, device.Name);
                }
            }

            Console.WriteLine();
            Console.WriteLine("Package ID can be:");
            Console.WriteLine("  ABD785F0-CDA7-41c5-8375-2451A7CBFF26: .NET Compact Framework 2.0");
            Console.WriteLine("  ABD785F0-CDA7-41c5-8375-2451A7CBFF37: .NET Compact Framework 3.5");
        }
Esempio n. 22
0
        static void Main(string[] args)
        {
            int deviceIndex = 0;

            string iconFilePath = "";
            string xapFilePath = "";
            Guid appID = Guid.Empty;

            string root = Directory.GetCurrentDirectory();

            if (args.Length < 1)
            {
                Usage();
                ReadWait();
                return;
            }
            else if (args[0] == "-devices")
            {
                ListDevices();
                return;
            }
            else if (args[1].StartsWith("-d:"))
            {
                deviceIndex = int.Parse(args[1].Substring(3));
            }

            if (Directory.Exists(args[0]))
            {
                DirectoryInfo info = new DirectoryInfo(args[0]);
                root = info.FullName;
            }

            appID = ReadAppId(root);
            if (appID == Guid.Empty)
            {
                // Logging of errors is done in ReadAppId
                return;
            }

            if (File.Exists(root + @"\ApplicationIcon.png"))
            {
                iconFilePath = root + @"\ApplicationIcon.png";
            }
            else
            {
                Log(string.Format("Error: could not find application icon at {0}", root + @"\ApplicationIcon.png"));
                ReadWait();
                return;
            }

            xapFilePath = Directory.GetFiles(root, "*.xap").FirstOrDefault();
            if (string.IsNullOrEmpty(xapFilePath))
            {
                Log(string.Format("Error: could not find application .xap in folder {0}", root));
                ReadWait();
                return;
            }

            // Get CoreCon WP7 SDK
            DatastoreManager dsmgrObj = new DatastoreManager(1033);
            Collection<Platform> WP7SDKs = dsmgrObj.GetPlatforms();
            Platform WP7SDK = dsmgrObj.GetPlatforms().Single(p => p.Name == "Windows Phone 7");

            Collection<Device> devices = null;

            devices = WP7SDK.GetDevices();

            //// Get Emulator / Device
            Device WP7Device = devices[deviceIndex];

            if (WP7Device != null)
            {
                RemoteApplication app;
                bool isConnected = WP7Device.IsConnected();

                Debug.WriteLine(WP7Device.ToString());

                if (!isConnected)
                {
                    try
                    {
                        WP7Device.Connect();
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("Error: " + ex.Message);
                        ReadWait();
                        return;
                    }
                }

                if (WP7Device.IsApplicationInstalled(appID))
                {
                    Log("Uninstalling XAP from " + WP7Device.Name);
                    app = WP7Device.GetApplication(appID);
                    app.Uninstall();
                }

                Log("Installing app on " + WP7Device.Name);
                app = WP7Device.InstallApplication(appID, appID, "NormalApp", iconFilePath, xapFilePath);

                Log("Launching app on " + WP7Device.Name);
                app.Launch();

                ReadWait();
            }
        }
Esempio n. 23
0
		public static Device GetDevice()
		{
			DatastoreManager dsm = new DatastoreManager(1033);
			ObjectId pocketPCId = new ObjectId(POCKET_PC_PLATFORM_ID);
			Platform platform = dsm.GetPlatform(pocketPCId);

			ObjectId pocketPC2003VGA = new ObjectId("E282E6BE-C7C3-4ece-916A-88FB1CF8AF3C");
			return platform.GetDevice(pocketPC2003VGA);
		}
Esempio n. 24
0
        static void Main(string[] args)
        {
            int deviceIndex = 0;

            string iconFilePath = "";
            string xapFilePath  = "";
            Guid   appID        = Guid.Empty;

            string root = Directory.GetCurrentDirectory();

            if (args.Length < 1)
            {
                Usage();
                ReadWait();
                return;
            }
            else if (args[0] == "-devices")
            {
                ListDevices();
                return;
            }
            else if (args.Length > 1 && args[1].StartsWith("-d:"))
            {
                deviceIndex = int.Parse(args[1].Substring(3));
            }


            if (Directory.Exists(args[0]))
            {
                DirectoryInfo info = new DirectoryInfo(args[0]);
                root = info.FullName;
            }

            appID = ReadAppId(root);
            if (appID == Guid.Empty)
            {
                // Logging of errors is done in ReadAppId
                return;
            }

            if (File.Exists(root + @"\ApplicationIcon.png"))
            {
                iconFilePath = root + @"\ApplicationIcon.png";
            }
            else
            {
                Log(string.Format("Error: could not find application icon at {0}", root + @"\ApplicationIcon.png"));
                ReadWait();
                return;
            }


            xapFilePath = Directory.GetFiles(root + @"\Bin\Debug", "*.xap").FirstOrDefault();
            if (string.IsNullOrEmpty(xapFilePath))
            {
                Log(string.Format("Error: could not find application .xap in folder {0}", root));
                ReadWait();
                return;
            }


            // Get CoreCon WP7 SDK
            DatastoreManager      dsmgrObj = new DatastoreManager(1033);
            Collection <Platform> WP7SDKs  = dsmgrObj.GetPlatforms();
            Platform WP7SDK = dsmgrObj.GetPlatforms().Single(p => p.Name == "Windows Phone 7");

            Collection <Device> devices = null;

            devices = WP7SDK.GetDevices();

            //// Get Emulator / Device
            Device WP7Device = devices[deviceIndex];

            if (WP7Device != null)
            {
                RemoteApplication app;
                bool isConnected = WP7Device.IsConnected();

                Debug.WriteLine(WP7Device.ToString());

                if (!isConnected)
                {
                    try
                    {
                        WP7Device.Connect();
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("Error: " + ex.Message);
                        ReadWait();
                        return;
                    }
                }

                if (WP7Device.IsApplicationInstalled(appID))
                {
                    Log("Uninstalling XAP from " + WP7Device.Name);
                    app = WP7Device.GetApplication(appID);
                    app.Uninstall();
                }

                Log("Installing app on " + WP7Device.Name);
                app = WP7Device.InstallApplication(appID, appID, "NormalApp", iconFilePath, xapFilePath);

                Log("Launching app on " + WP7Device.Name);
                app.Launch();

                ReadWait();
            }
        }
Esempio n. 25
0
        static void Main(string[] args)
        {
            DatastoreManager dsmgrObj = new DatastoreManager(1033);
            Platform WP8SDK = dsmgrObj.GetPlatforms().Single(p => p.Name == "Windows Phone 8");

            bool useEmulator = true;
            Device WP8Device = null;

            if (args.Length < 5)
            {
                Console.WriteLine("Invalid parameters");
                return;
            }

            if (args[4] == "dev")
                useEmulator = false;

            if (useEmulator)
           //     WP8Device = WP8SDK.GetDevices().First(d => d.Name.StartsWith("Windows Phone Emulator") || d.Name.StartsWith("Windows Phone 8 Emulator"));
                WP8Device = WP8SDK.GetDevices().First(d => d.Name.StartsWith("Emulator WVGA"));
            else
                WP8Device = WP8SDK.GetDevices().First(d => d.Name.StartsWith("Windows Phone Device") || d.Name.StartsWith("Windows Phone 8 Device") || d.Name.StartsWith("Device"));

            Console.WriteLine("Connecting to Windows Phone 8 Emulator/Device...");
            WP8Device.Connect();
            Console.WriteLine("Windows Phone 8 Emulator/Device Connected...");

            Guid appID = new Guid(args[0]);
            RemoteApplication app;
            if (WP8Device.IsApplicationInstalled(appID))
            {
                Console.WriteLine("Updating sample XAP to Windows Phone 8 Emulator/Device...");

                app = WP8Device.GetApplication(appID);

                if (args.Length == 6)
                {
                    var remoteIso = app.GetIsolatedStore();
                    string targetDesktopFilePath = @args[5];
                    remoteIso.ReceiveFile("rho/rholog.txt", targetDesktopFilePath, true);
                    return;
                }

                app.Uninstall();
               /* app.UpdateApplication(args[1],
                                      args[2],
                                      args[3]);

                Console.WriteLine("Sample XAP Updated on Windows Phone 8 Emulator/Device...");

                Console.WriteLine("Launching sample app on Windows Phone 8 Emulator...");
                //app.Launch();
                Console.WriteLine("Launched sample app on Windows Phone 8 Emulator...");*/

                //var remoteIso = app.GetIsolatedStore();
                //bool result = remoteIso.FileExists("rholog.txt");
                //result = remoteIso.FileExists("rho/apps/app/loading.png");

                //return;
            }            

            Console.WriteLine("Installing sample XAP to Windows Phone 8 Emulator/Device...");

            app = WP8Device.InstallApplication(
                appID,
                appID,
                args[1],
                args[2],
                args[3]);

            Console.WriteLine("Sample XAP installed to Windows Phone 8 Emulator...");

            Console.WriteLine("Launching sample app on Windows Phone 8 Emulator...");
            app.Launch();
            Console.WriteLine("Launched sample app on Windows Phone 8 Emulator...");
        }
Esempio n. 26
0
        static void Main(string[] args)
        {
            DatastoreManager dsmgrObj = new DatastoreManager(1033);
            Platform         WP7SDK   = dsmgrObj.GetPlatforms().Single(p => p.Name == "Windows Phone 7");

            bool   useEmulator = true;
            Device WP7Device   = null;

            if (args[4] == "dev")
            {
                useEmulator = false;
            }

            if (useEmulator)
            {
                WP7Device = WP7SDK.GetDevices().First(d => d.Name.StartsWith("Windows Phone Emulator"));
            }
            else
            {
                WP7Device = WP7SDK.GetDevices().First(d => d.Name.StartsWith("Windows Phone Device"));
            }

            Console.WriteLine("Connecting to Windows Phone 7 Emulator/Device...");
            WP7Device.Connect();
            Console.WriteLine("Windows Phone 7 Emulator/Device Connected...");

            Guid appID = new Guid(args[0]);
            RemoteApplication app;

            if (WP7Device.IsApplicationInstalled(appID))
            {
                Console.WriteLine("Updating sample XAP to Windows Phone 7 Emulator/Device...");

                app = WP7Device.GetApplication(appID);

                //app.Uninstall();
                app.UpdateApplication(args[1],
                                      args[2],
                                      args[3]);

                Console.WriteLine("Sample XAP Updated on Windows Phone 7 Emulator/Device...");

                Console.WriteLine("Launching sample app on Windows Phone 7 Emulator...");
                app.Launch();
                Console.WriteLine("Launched sample app on Windows Phone 7 Emulator...");

                return;
            }

            Console.WriteLine("Installing sample XAP to Windows Phone 7 Emulator/Device...");

            app = WP7Device.InstallApplication(
                appID,
                appID,
                args[1],
                args[2],
                args[3]);

            Console.WriteLine("Sample XAP installed to Windows Phone 7 Emulator...");

            Console.WriteLine("Launching sample app on Windows Phone 7 Emulator...");
            app.Launch();
            Console.WriteLine("Launched sample app on Windows Phone 7 Emulator...");
        }
Esempio n. 27
0
        static int Main(string[] args)
        {
            try
            {
                if (args.Length != 4)
                {
                    Usage();
                    return(1);
                }

                string platformId = args[0];
                string deviceId   = args[1];
                string packageID;

                switch (args[2])
                {
                case "2.0":
                    packageID = NetCf20PackageId;
                    break;

                case "3.5":
                    packageID = NetCf35PackageId;
                    break;

                default:
                    packageID = args[2];
                    break;
                }

                string cabName = args[3];

                // Get the datastore object
                var dsmgr = new DatastoreManager(1033);

                var platform = dsmgr.GetPlatform(new ObjectId(platformId));
                var device   = platform.GetDevice(new ObjectId(deviceId));

                Console.WriteLine("Connecting to device...");
                device.Connect();

                FileDeployer fileDeployer = device.GetFileDeployer();

                Console.WriteLine("Deploying package...");
                fileDeployer.DownloadPackage(new ObjectId(packageID));

                Console.WriteLine("Installing package...");
                RemoteProcess installer = device.GetRemoteProcess();
                installer.Start("wceload.exe", cabName);
                while (installer.HasExited() != true)
                {
                    System.Threading.Thread.Sleep(1000);
                }
                var exitCode = installer.GetExitCode();
                if (exitCode != 0)
                {
                    Console.WriteLine("Installation failed. Exit code: {0}", exitCode);
                }
                else
                {
                    Console.WriteLine("Installation succeeded.");
                }
                return(exitCode);
            }
            catch (Exception ex)
            {
                Console.WriteLine("ERROR: {0}", ex);
                return(1);
            }
        }
Esempio n. 28
0
        static void Main(string[] args)
        {
            DatastoreManager dsmgrObj = new DatastoreManager(1033);
            Platform         WP8SDK   = dsmgrObj.GetPlatforms().Single(p => p.Name == "Windows Phone 8");

            bool   useEmulator = true;
            Device WP8Device   = null;

            if (args.Length < 5)
            {
                Console.WriteLine("Invalid parameters");
                return;
            }

            if (args[4] == "dev")
            {
                useEmulator = false;
            }

            if (useEmulator)
            {
                //     WP8Device = WP8SDK.GetDevices().First(d => d.Name.StartsWith("Windows Phone Emulator") || d.Name.StartsWith("Windows Phone 8 Emulator"));
                WP8Device = WP8SDK.GetDevices().First(d => d.Name.StartsWith("Emulator WVGA"));
            }
            else
            {
                WP8Device = WP8SDK.GetDevices().First(d => d.Name.StartsWith("Windows Phone Device") || d.Name.StartsWith("Windows Phone 8 Device") || d.Name.StartsWith("Device"));
            }

            Console.WriteLine("Connecting to Windows Phone 8 Emulator/Device...");
            WP8Device.Connect();
            Console.WriteLine("Windows Phone 8 Emulator/Device Connected...");

            Guid appID = new Guid(args[0]);
            RemoteApplication app;

            if (WP8Device.IsApplicationInstalled(appID))
            {
                Console.WriteLine("Updating sample XAP to Windows Phone 8 Emulator/Device...");

                app = WP8Device.GetApplication(appID);

                if (args.Length == 6)
                {
                    var    remoteIso             = app.GetIsolatedStore();
                    string targetDesktopFilePath = @args[5];
                    remoteIso.ReceiveFile("rho/rholog.txt", targetDesktopFilePath, true);
                    return;
                }

                app.Uninstall();

                /* app.UpdateApplication(args[1],
                 *                     args[2],
                 *                     args[3]);
                 *
                 * Console.WriteLine("Sample XAP Updated on Windows Phone 8 Emulator/Device...");
                 *
                 * Console.WriteLine("Launching sample app on Windows Phone 8 Emulator...");
                 * //app.Launch();
                 * Console.WriteLine("Launched sample app on Windows Phone 8 Emulator...");*/

                //var remoteIso = app.GetIsolatedStore();
                //bool result = remoteIso.FileExists("rholog.txt");
                //result = remoteIso.FileExists("rho/apps/app/loading.png");

                //return;
            }

            Console.WriteLine("Installing sample XAP to Windows Phone 8 Emulator/Device...");

            app = WP8Device.InstallApplication(
                appID,
                appID,
                args[1],
                args[2],
                args[3]);

            Console.WriteLine("Sample XAP installed to Windows Phone 8 Emulator...");

            Console.WriteLine("Launching sample app on Windows Phone 8 Emulator...");
            app.Launch();
            Console.WriteLine("Launched sample app on Windows Phone 8 Emulator...");
        }
        private Device FindDevice()
        {
            DatastoreManager manager = new DatastoreManager(1033);
            Collection<Platform> platforms = manager.GetPlatforms();
            if (platforms.Count == 0)
            {
                throw new ConsoleDriverException("Found no platforms");
            }

            Platform platform = platforms.FirstOrDefault((p) => { return p.Name.StartsWith("Windows Phone "); });
            Console.WriteLine("Found platform {0}.", platform.Name);
            Collection<Device> devices = platform.GetDevices();
            if (devices.Count == 0)
            {
                throw new ConsoleDriverException("Found no devices");
            }

            Device device = devices.FirstOrDefault((d) => { return platform.Name == this.deviceName && d.IsEmulator() == (this.kind == ControllerKind.Emulator); });
            if (device != null)
            {
                Console.WriteLine("Found device {0}.", device.Name);
            }
            else
            {
                Console.WriteLine("No device found with name exactly matching '{0}'; looking for device with name contains '{0}'.", this.deviceName);
                device = devices.FirstOrDefault((d) => { return d.Name.Contains(this.deviceName) && d.IsEmulator() == (this.kind == ControllerKind.Emulator); });
            }

            return device;
        }
Esempio n. 30
0
        public override void Run()
        {
            DatastoreManager dsmgr = new DatastoreManager(1033);
            Platform platform = dsmgr.GetPlatforms().Single(p => p.Name == "Windows Phone 7");
            Device WP7emu = platform.GetDevices().Single(d => d.Name == "Windows Phone 7 Emulator");
            WP7emu.Connect();
            Guid appGUID = new Guid(_xap.appID);
            RemoteApplication app;

            if (WP7emu.IsApplicationInstalled(appGUID))
            {
                app = WP7emu.GetApplication(appGUID);
                app.Launch();
            }
            else
            {
                MessageBox.Show("Application was not found!", "Error");
                return;
            }
        }
Esempio n. 31
0
 public WP7DeviceFinder()
 {
     devicesStorage = new DatastoreManager(1033);
 }
Esempio n. 32
0
        public override void Run()
        {
            if (!_xap.isUnpacked) _xap.ParseXAP();
            if (_xap.StripDRM())
            {
                _mainfrm.BeginInvoke(_mainfrm.AddTextDelegate, "DRM file was removed." + Environment.NewLine);
            }
            foreach (string item in _xap.dllFiles)
            {
                if (!_xap.IsTarget(item.Substring(item.LastIndexOf("\\") + 1)))
                {
                    _mainfrm.BeginInvoke(_mainfrm.AddTextDelegate, "Skipping excluded assembly: " + item + Environment.NewLine);
                    continue;
                }
                try
                {
                    System.Reflection.AssemblyName.GetAssemblyName(item);
                    _mainfrm.BeginInvoke(_mainfrm.AddTextDelegate, "Patching " + item + Environment.NewLine);
                    XAPAssembly asmTarget = new XAPAssembly(item);
                    asmTarget.InjectProlouge();
                }
                catch (System.BadImageFormatException)
                {
                    _mainfrm.BeginInvoke(_mainfrm.AddTextDelegate, "Skipping native dll file:" + item + Environment.NewLine);
                }
            }
            _mainfrm.BeginInvoke(_mainfrm.AddTextDelegate, "Finished patching target assebmlies." + Environment.NewLine);
            _mainfrm.BeginInvoke(_mainfrm.AddTextDelegate, "Signing dll files...");
            _xap.ReplaceSignature();
            _mainfrm.BeginInvoke(_mainfrm.AddTextDelegate, "(Done)" + Environment.NewLine + "Creating new XAP file...");
            string tmp = Directory.GetParent(_xap.GetPath()).ToString() + "\\" + _xap.appID;
            string zipfilename = tmp + ".zip";
            string newfilename = tmp + ".xap";
            System.IO.File.Delete(zipfilename);
            System.IO.File.Delete(newfilename);
            ZipFolder(_xap.GetPath(), zipfilename);
            System.Threading.Thread.Sleep(_config.zipWaitTime);    //wait for shell32.dll
            System.IO.File.Move(zipfilename, newfilename);
            _mainfrm.BeginInvoke(_mainfrm.AddTextDelegate, "(Done)" + Environment.NewLine + "Connecting to emulator...");
            DatastoreManager dsmgr = new DatastoreManager(1033);
            Platform platform = dsmgr.GetPlatforms().Single(p => p.Name == "Windows Phone 7");
            Device WP7emu = platform.GetDevices().Single(d => d.Name == "Windows Phone 7 Emulator");
            WP7emu.Connect();

            Guid appGUID = new Guid(_xap.appID);
            RemoteApplication app;

            if (WP7emu.IsApplicationInstalled(appGUID))
            {
                _mainfrm.BeginInvoke(_mainfrm.AddTextDelegate, "(Done)" + Environment.NewLine + "Uninstalling previous version...");
                app = WP7emu.GetApplication(appGUID);
                app.Uninstall();
            }
            _mainfrm.BeginInvoke(_mainfrm.AddTextDelegate, "(Done)" + Environment.NewLine + "Deploying application....");
            app = WP7emu.InstallApplication(appGUID, appGUID, "NormalApp", _xap.iconPath, newfilename);
            _mainfrm.BeginInvoke(_mainfrm.AddTextDelegate, "(Done)" + Environment.NewLine + "You can now launch the XDEMonitor from tools menu and then run the application on the phone."+Environment.NewLine);
            RunXDEMonitor();
            _mainfrm.BeginInvoke(_mainfrm.resetButtonDelegate, "run");
        }
Esempio n. 33
0
        /// <summary>
        /// Initializes a new instance of the TargetDevice type.
        /// </summary>
        public TargetDevice(TargetDeviceInfo deviceInfo)
        {
            this.deviceInfo = deviceInfo;

            this.manager = new DatastoreManager(deviceInfo.Locale);
        }
Esempio n. 34
0
        public override void Run()
        {
            if (!_xap.isUnpacked)
            {
                _xap.ParseXAP();
            }
            if (_xap.StripDRM())
            {
                _mainfrm.BeginInvoke(_mainfrm.AddTextDelegate, "DRM file was removed." + Environment.NewLine);
            }
            foreach (string item in _xap.dllFiles)
            {
                if (!_xap.IsTarget(item.Substring(item.LastIndexOf("\\") + 1)))
                {
                    _mainfrm.BeginInvoke(_mainfrm.AddTextDelegate, "Skipping excluded assembly: " + item + Environment.NewLine);
                    continue;
                }
                try
                {
                    System.Reflection.AssemblyName.GetAssemblyName(item);
                    _mainfrm.BeginInvoke(_mainfrm.AddTextDelegate, "Patching " + item + Environment.NewLine);
                    XAPAssembly asmTarget = new XAPAssembly(item);
                    asmTarget.InjectProlouge();
                }
                catch (System.BadImageFormatException)
                {
                    _mainfrm.BeginInvoke(_mainfrm.AddTextDelegate, "Skipping native dll file:" + item + Environment.NewLine);
                }
            }
            _mainfrm.BeginInvoke(_mainfrm.AddTextDelegate, "Finished patching target assebmlies." + Environment.NewLine);
            _mainfrm.BeginInvoke(_mainfrm.AddTextDelegate, "Signing dll files...");
            _xap.ReplaceSignature();
            _mainfrm.BeginInvoke(_mainfrm.AddTextDelegate, "(Done)" + Environment.NewLine + "Creating new XAP file...");
            string tmp         = Directory.GetParent(_xap.GetPath()).ToString() + "\\" + _xap.appID;
            string zipfilename = tmp + ".zip";
            string newfilename = tmp + ".xap";

            System.IO.File.Delete(zipfilename);
            System.IO.File.Delete(newfilename);
            ZipFolder(_xap.GetPath(), zipfilename);
            System.Threading.Thread.Sleep(_config.zipWaitTime);    //wait for shell32.dll
            System.IO.File.Move(zipfilename, newfilename);
            _mainfrm.BeginInvoke(_mainfrm.AddTextDelegate, "(Done)" + Environment.NewLine + "Connecting to emulator...");
            DatastoreManager dsmgr    = new DatastoreManager(1033);
            Platform         platform = dsmgr.GetPlatforms().Single(p => p.Name == "Windows Phone 7");
            Device           WP7emu   = platform.GetDevices().Single(d => d.Name == "Windows Phone 7 Emulator");

            WP7emu.Connect();

            Guid appGUID = new Guid(_xap.appID);
            RemoteApplication app;

            if (WP7emu.IsApplicationInstalled(appGUID))
            {
                _mainfrm.BeginInvoke(_mainfrm.AddTextDelegate, "(Done)" + Environment.NewLine + "Uninstalling previous version...");
                app = WP7emu.GetApplication(appGUID);
                app.Uninstall();
            }
            _mainfrm.BeginInvoke(_mainfrm.AddTextDelegate, "(Done)" + Environment.NewLine + "Deploying application....");
            app = WP7emu.InstallApplication(appGUID, appGUID, "NormalApp", _xap.iconPath, newfilename);
            _mainfrm.BeginInvoke(_mainfrm.AddTextDelegate, "(Done)" + Environment.NewLine + "You can now launch the XDEMonitor from tools menu and then run the application on the phone." + Environment.NewLine);
            RunXDEMonitor();
            _mainfrm.BeginInvoke(_mainfrm.resetButtonDelegate, "run");
        }
Esempio n. 35
0
		public WP7DeviceFinder()
		{
			devicesStorage = new DatastoreManager(1033);
		}
Esempio n. 36
0
        /// <summary>
        /// Initializes a new instance of the TargetDevice type.
        /// </summary>
        public TargetDevice(TargetDeviceInfo deviceInfo)
        {
            this.deviceInfo = deviceInfo;

            this.manager = new DatastoreManager(deviceInfo.Locale);
        }
Esempio n. 37
0
 internal static XapDeployer.DeployResult InstallApplication(XapDeployer.DeviceInfoClass DeviceInfoClass, Guid appGuid, Version appVersion, string applicationGenre, string iconFile, string xapFile, XapDeployer.DeployBehaviourType DeployBehaviourType, ref Exception Exception)
 {
     Exception = null;
     try
     {
         DatastoreManager datastoreManager1 = new DatastoreManager(CultureInfo.CurrentUICulture.LCID);
         if (datastoreManager1 != null)
         {
             Platform platform1 = datastoreManager1.GetPlatform(new ObjectId(DeviceInfoClass.PlatformId));
             if (platform1 != null)
             {
                 Device device1 = platform1.GetDevice(new ObjectId(DeviceInfoClass.DeviceId));
                 if (device1 != null)
                 {
                     device1.Connect();
                     SystemInfo systemInfo1 = device1.GetSystemInfo();
                     Version    version1    = new Version(systemInfo1.OSMajor, systemInfo1.OSMinor);
                     bool       flag1       = appVersion.CompareTo(version1) > 0;
                     if (flag1)
                     {
                         device1.Disconnect();
                         return(XapDeployer.DeployResult.NotSupported);
                     }
                     flag1 = device1.IsApplicationInstalled(appGuid);
                     if (flag1)
                     {
                         bool flag2 = DeployBehaviourType == XapDeployer.DeployBehaviourType.SkipApplication;
                         if (flag2)
                         {
                             device1.Disconnect();
                             return(XapDeployer.DeployResult.Success);
                         }
                         else
                         {
                             RemoteApplication remoteApplication1 = device1.GetApplication(appGuid);
                             flag2 = DeployBehaviourType == XapDeployer.DeployBehaviourType.ForceUninstall;
                             if (flag2)
                             {
                                 remoteApplication1.Uninstall();
                             }
                             else
                             {
                                 flag2 = DeployBehaviourType == XapDeployer.DeployBehaviourType.UpdateApplication;
                                 if (flag2)
                                 {
                                     remoteApplication1.UpdateApplication(applicationGenre, iconFile, xapFile);
                                     device1.Disconnect();
                                     return(XapDeployer.DeployResult.Success);
                                 }
                             }
                         }
                     }
                     device1.InstallApplication(appGuid, appGuid, applicationGenre, iconFile, xapFile);
                     device1.Disconnect();
                     return(XapDeployer.DeployResult.Success);
                 }
             }
         }
     }
     catch (Exception e)
     {
         return(XapDeployer.DeployResult.DeployError);
     }
     return(XapDeployer.DeployResult.DeployError);
 }