Exemplo n.º 1
0
        private static void WbClientOnDownloadVersionCompleted(object sender, 
            DownloadStringCompletedEventArgs downloadStringCompletedEventArgs)
        {
            System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
            FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
            string currentVersion = fvi.ProductVersion;
            string latestVersion = downloadStringCompletedEventArgs.Result;
            latestVersion = latestVersion.Replace("\n", "");

            if (currentVersion != latestVersion)
            {
                new UpdatingWindow(true).ShowDialog();
            }
            else
            if (!System.IO.File.Exists(Environment.CurrentDirectory + @"\De.TorstenMandelkow.MetroChart.dll"))
            {
                DllDownloader dllDownloader = new DllDownloader
                {
                    currentForm = new UpdatingWindow(false) { Text = "Updating external dlls..." }
                };
                dllDownloader.DownloadLatestDLL("https://github.com/DanThePman/Hearthstone/raw/master/Download/PlaceContentInThe_SmartBot_Folder/De.TorstenMandelkow.MetroChart.dll",
                    Environment.CurrentDirectory + @"\De.TorstenMandelkow.MetroChart.dll", false);
                dllDownloader.currentForm.ShowDialog();

                MessageBox.Show("De.TorstenMandelkow.MetroChart.dll downloading. Please restart your SmartBot if" +
                                " you planned to use the coach mode", "Information - External dll update",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information);
            }
        }
Exemplo n.º 2
0
        public PopUp(UpdatingWindow updatingFormToUse)
        {
            clickedYes = false;
            clickedNo  = false;

            InitializeComponent();

            HandleDestroyed += (sender, args) =>
            {
                if (!clickedYes && !clickedNo)
                {
                    IntPtr mbWnd = FindWindow(null, "Updating Core...");
                    if (mbWnd != IntPtr.Zero)
                    {
                        SendMessage(mbWnd, WM_CLOSE, IntPtr.Zero, IntPtr.Zero);
                    }
                }
                else if (clickedYes)
                {
                    DllDownloader coreDownloader = new DllDownloader {
                        currentForm = updatingFormToUse
                    };
                    coreDownloader.DownloadLatestDLL("https://github.com/DanThePman/Hearthstone/blob/master/Download/PlaceContentInThe_SmartBot_Folder/HearthstoneMulligan.dll?raw=true",
                                                     Environment.CurrentDirectory + @"\HearthstoneMulliganNew.dll");
                }
            };
        }
Exemplo n.º 3
0
        public PopUp(UpdatingWindow updatingFormToUse)
        {
            clickedYes = false;
            clickedNo = false;

            InitializeComponent();

            HandleDestroyed += (sender, args) =>
            {
                if (!clickedYes && !clickedNo)
                {
                    IntPtr mbWnd = FindWindow(null, "Updating Core...");
                    if (mbWnd != IntPtr.Zero)
                        SendMessage(mbWnd, WM_CLOSE, IntPtr.Zero, IntPtr.Zero);
                }
                else if (clickedYes)
                {
                    DllDownloader coreDownloader = new DllDownloader { currentForm = updatingFormToUse };
                    coreDownloader.DownloadLatestDLL("https://github.com/DanThePman/Hearthstone/blob/master/Download/PlaceContentInThe_SmartBot_Folder/HearthstoneMulligan.dll?raw=true",
                        Environment.CurrentDirectory + @"\HearthstoneMulliganNew.dll");
                }
            };
        }