コード例 #1
0
 private void SetTextVisibility()
 {
     if (RegistryManager.CheckOemInRegistry(this.SelectedOem?.AppPlayerOem, ""))
     {
         this.NotInstalledTextVisibility = false;
         this.NextButtonText             = LocaleStrings.GetLocalizedString("STRING_NEXT", "");
     }
     else
     {
         this.NotInstalledTextVisibility = true;
         this.NextButtonText             = LocaleStrings.GetLocalizedString("STRING_DOWNLOAD", "");
     }
 }
コード例 #2
0
 private void HandleNextButtonAction()
 {
     if (RegistryManager.CheckOemInRegistry(this.SelectedOem.AppPlayerOem, ""))
     {
         this.OemInstalledCheckABI();
     }
     else
     {
         Messenger.Default.Send <InstanceCreationOemMessage>(new InstanceCreationOemMessage()
         {
             AppPlayerModel = this.SelectedOem
         });
     }
 }
コード例 #3
0
        public int InstallOem()
        {
            string  str     = Path.Combine(Path.GetDirectoryName(RegistryManager.Instance.UserDefinedDir), "BlueStacks" + (this.AppPlayerOem == "bgp" ? string.Empty : "_" + this.AppPlayerOem));
            Process process = Process.Start(new ProcessStartInfo()
            {
                Arguments       = string.Format((IFormatProvider)CultureInfo.InvariantCulture, "-s -pddir:\"{0}\"", (object)str),
                CreateNoWindow  = true,
                WindowStyle     = ProcessWindowStyle.Hidden,
                FileName        = this.DownloadPath,
                UseShellExecute = false
            });

            process.WaitForExit();
            if (process.ExitCode == 0 && RegistryManager.CheckOemInRegistry(this.AppPlayerOem, "Android"))
            {
                this.DeleteFiles();
            }
            return(process.ExitCode);
        }
コード例 #4
0
 private void InstallOemOperation()
 {
     try
     {
         Publisher.PublishMessage(BrowserControlTags.oemInstallStarted, this.ParentWindow.mVmName, (JObject)null);
         int mInstallFailedErrorCode = this.currentDownloadingOem.InstallOem();
         if (mInstallFailedErrorCode != 0 || !RegistryManager.CheckOemInRegistry(this.currentDownloadingOem.AppPlayerOem, "Android"))
         {
             Logger.Warning("Installation failed: " + mInstallFailedErrorCode.ToString());
             string str = mInstallFailedErrorCode == 0 ? LocaleStrings.GetLocalizedString("STRING_INSTALLATION_FAILED", "") : InstallerErrorHandling.AssignErrorStringForInstallerExitCodes(mInstallFailedErrorCode, "STRING_INSTALLATION_FAILED");
             Publisher.PublishMessage(BrowserControlTags.oemInstallFailed, this.ParentWindow.mVmName, new JObject()
             {
                 ["MessageTitle"] = (JToken)LocaleStrings.GetLocalizedString("STRING_INSTALL_FAIL", ""),
                 ["MessageBody"]  = (JToken)str,
                 ["ActionType"]   = (JToken)"failed"
             });
         }
         else
         {
             InstalledOem.SetInstalledCoexistingOems();
             if (this.currentDownloadingOem.AppPlayerOem.Contains("bgp64"))
             {
                 Utils.UpdateValueInBootParams("abivalue", this.currentDownloadingOem.AbiValue.ToString((IFormatProvider)CultureInfo.InvariantCulture), "Android", true, this.currentDownloadingOem.AppPlayerOem);
             }
             RegistryManager.RegistryManagers[this.currentDownloadingOem.AppPlayerOem].Guest["Android"].DisplayName = Strings.ProductDisplayName + " " + this.currentDownloadingOem.Suffix;
             Publisher.PublishMessage(BrowserControlTags.oemInstallCompleted, this.ParentWindow.mVmName, (JObject)null);
         }
     }
     catch (Exception ex)
     {
         Logger.Error("Failed after running installer process: " + ex?.ToString());
         Publisher.PublishMessage(BrowserControlTags.oemInstallFailed, this.ParentWindow.mVmName, new JObject()
         {
             ["MessageTitle"] = (JToken)LocaleStrings.GetLocalizedString("STRING_INSTALL_FAIL", ""),
             ["MessageBody"]  = (JToken)LocaleStrings.GetLocalizedString("STRING_INSTALLATION_FAILED", ""),
             ["ActionType"]   = (JToken)"failed"
         });
     }
 }