Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8534409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:11:24+00:00 2026-06-11T10:11:24+00:00

i have been looking for a way to update my application for ages, and

  • 0

i have been looking for a way to update my application for ages, and still haven’t found a solution. (Please don’t say ClickOnce, it isn’t suitable for this app).

Years ago i used to use MCadmin to run a Minecraft server, and i remembered that when it started, sometimes it would just say “Update downloaded, please restart!”. I have tried to find out how this was done, so i have been looking in the source code and found some things.

Here is some code that i found:

private void CheckUpdateThread()
    {
        Program.AddRTLine(Color.Green, "Verifying existence of essential files...\r\n", false);

        if (!File.Exists("ICSharpCode.SharpZipLib.dll"))
            Util.DownloadURLToFile("https://internal.mcadmin.eu/ICSharpCode.SharpZipLib.dll", "ICSharpCode.SharpZipLib.dll");
        if (!File.Exists("LICENSE.txt"))
            Util.DownloadURLToFile("https://internal.mcadmin.eu/LICENSE.txt", "LICENSE.txt");

        Program.AddRTLine(Color.Green, "Essential file validation completed!\r\n", false);

        if (Program.dontUpdate)
        {
            Program.AddRTLine(Color.Green, "Update checking disabled!!!\r\n", false); 
            return;
        }

        UpdateRunning = true;

        Program.AddRTLine(Color.Green, "Checking for updates...\r\n", false);

        bool isUpdate;

        if (Program.dontUpdateMCAdmin || 1 == 1)
        {
            Program.AddRTLine(Color.Green, "MCAdmin update checking disabled.\r\n", false);
        }
        else
        {
            isUpdate = Util.DownloadURLToAndDiff("https://internal.mcadmin.eu/MCAdmin.exe", "MCAdmin.exe.new", "MCAdmin.exe");
            if (!isUpdate)
            {
                if (OutOfDateMCA)
                {
                    Program.AddRTLine(Color.Orange, "MCAdmin update downloaded! Restart MCAdmin to apply update!\r\n", false);
                    SendAdminMessage("MCAdmin update downloaded, consider restarting.", 4);
                }
                else
                {
                    Program.AddRTLine(Color.Green, "MCAdmin already up to date!\r\n", false);
                }
            }
            else
            {
                try
                {
                    if (File.Exists("MCAdmin.exe.old"))
                        File.Delete("MCAdmin.exe.old");
                }
                catch { }
                try
                {
                    if (File.Exists("MCAdmin.exe"))
                        File.Delete("MCAdmin.exe");
                }
                catch { }

                if (File.Exists("MCAdmin.exe")) 
                    File.Move("MCAdmin.exe", "MCAdmin.exe.old");
                File.Move("MCAdmin.exe.new", "MCAdmin.exe");

                OutOfDateMCA = true;
                Program.AddRTLine(Color.Orange, "MCAdmin update downloaded! Restart MCAdmin to apply update!\r\n", false);

                SendAdminMessage("MCAdmin update downloaded, consider restarting.", 4);
            }

        }

This code is from a single void in a class called “UpdateManager”.

See how it does the whole “MCadmin.exe.old” and “MCadmin.exe.new” files, a bit like shadow copying.

There is more to the updater code, but i don’t quite understand.

Here is the SVN:
https://code.google.com/p/mcadminfork/source/browse/

Could anybody help me find out how this updater was acheived?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:11:25+00:00Added an answer on June 11, 2026 at 10:11 am

    Util.DownloadURLToAndDiff() does the actual downloading and file comparison. So you probably want to look at that.

    Otherwise, it’s pretty simple:

    1. Download MCAdmin.exe.new
    2. Delete MCAdmin.exe.old (leftover from previous update)
    3. Try to delete current MCAdmin.exe
    4. If delete fails (file in use probably), rename MCAdmin.exe MCAdmin.exe.old
    5. Rename MCAdmin.exe.new MCAdmin.exe
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been looking for a way to remove an attachment from Jira using
I have been looking for a way to get rid of the nasty black
I have been looking for a way to allow users to manually override geolocation
I have been looking at the Thinktecture.IdentityModel.40 library as a way of handling the
Hey i have been looking around and i cant find a way to get
I've been struggling looking for an understandable way to do this. I have four
I have been looking for a way to show the iPhone screen (not the
I have been looking into the ways of distributing an iOS application internally in
I've been looking for a way to achieve this behavior and I found this
I have been looking into perlin noise for an application I'm working on its

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.