What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal
RebornBuddy Forums

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Auto updater for CC by erenion

bossland

Well-Known Member
Joined
Jan 15, 2010
Messages
14,883
I wrote an auto-updater for ePriest. Feel free to use it for all your CCs. My only requirement is it is turned off by default and users must be told that is turned off by default (to avoid headaches for Hawker and Bossland). This means that this function doesn't get called (no WebClient created). Please also include that it will be accessing your website (so that people know you may be able to track their IP etc).

Code:
        private void autoUpdate()//Created by erenion
        {
            try
            {
                string fileUrl = "http://www.gliderapps.com/ePriest/Priest.cs";
                string localFile = "./CustomClasses/Priest.cs";
                WebClient wc = new WebClient();
                FileStream fs = new FileStream(localFile, FileMode.OpenOrCreate);
                long localFileLength = fs.Length;
                fs.Close();
                if (wc.DownloadData(fileUrl).Length != localFileLength)
                {
                    wc.DownloadFile(fileUrl, localFile);
                }
            }
            catch
            { 
            }

        }

Erenion
 
Keep in mind it only works for CCs that don't have a config inside the file as it checks file size.
 
Also shouldnt work with dll's cus they are write protected... know this from experience give its a restart every upgrade :(

Would need to do a Get (with different name) then forced restart and a delete on old version or something wierd, all in all not advisable
 
Back
Top