Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 07:13

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[VB.NET]Autoupdate

Discussion on [VB.NET]Autoupdate within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2011
Posts: 159
Received Thanks: 57
[VB.NET]Autoupdate

Hey,

How to make it?

So far I have used method like this:
-I have published single exe file
-"Autoupdate" = read newest version number from .txt file from my webpage (weebly) and if version number isnt same as in the exe file then bot opens download link (weebly too).

Well thats a really simple way to do it but this time Id like to know how to it more "professionally" I have thought to publish a whole folder instead of 1 exe file and updater updates just the necessary files. (how to get those? how to update? how to everything?)

I have several plans for this:
-User settings wont change anymore while newer version comes
-The updater should delete earlier version and download newest to same folder (or replace earlier one). At the moment, as I wrote on the top of msg, I have to select the folder every time.

Stubid question: Is this possible? making a startup form which loads "main form" from webpage. User settings / rescoures / etc would also be saved to loading form (but sometimes I should update them too..)

To be honest I have any idea how to start with this.. I hope you have
BeginnerDO is offline  
Old 01/18/2013, 16:39   #2
 
Kraizy​'s Avatar
 
elite*gold: 0
The Black Market: 471/0/0
Join Date: Apr 2010
Posts: 9,696
Received Thanks: 1,811
- check if new version is available
- start updater.exe/bat/...
- delete old version (close old version before deleting it if necessary)
- download new version
- start new version
Kraizy​ is offline  
Old 01/18/2013, 17:02   #3
 
elite*gold: 0
Join Date: Aug 2011
Posts: 159
Received Thanks: 57
Quote:
Originally Posted by Kraizy​ View Post
- check if new version is available
- start updater.exe/bat/...
- delete old version (close old version before deleting it if necessary)
- download new version
- start new version
-The first one is clear. I know how to check
-This is too. I just have to make the updater
-Well I have never before deleted file but with fast googling found . looks it could work.
-download, how? I have earlier made: process.start() and this is the way I dont want to do anymore and how to get the location where earlier one is saved? (so it should autosave it to the same place)
BeginnerDO is offline  
Old 01/18/2013, 17:05   #4
 
Kraizy​'s Avatar
 
elite*gold: 0
The Black Market: 471/0/0
Join Date: Apr 2010
Posts: 9,696
Received Thanks: 1,811
Quote:
Originally Posted by BeginnerDO View Post
download, how? I have earlier made: process.start() and this is the way I dont want to do anymore
WebClient.DownloadFile(Async)

Quote:
Originally Posted by BeginnerDO View Post
and how to get the location where earlier one is saved? (so it should autosave it to the same place)
Well, what about Dropbox? Just drag your new version in the same folder (and replace it with the old version), the download link would be the same everytime.

Edit: Sorry didn't understand your second question.

PHP Code:
Dim myPath As String Application.ExecutablePath 
You could just pass myPath as a startup parameter to your updater.exe.
Kraizy​ is offline  
Thanks
1 User
Old 01/18/2013, 17:17   #5
 
elite*gold: 0
Join Date: Aug 2011
Posts: 159
Received Thanks: 57
Quote:
Originally Posted by Kraizy​ View Post
WebClient.DownloadFile(Async)



Well, what about Dropbox? Just drag your new version in the same folder (and replace it with the old version), the download link would be the same everytime.

Edit: Sorry didn't understand your second question.

PHP Code:
Dim myPath As String Application.ExecutablePath 
You could just pass myPath as a startup parameter to your updater.exe.
Thanks a lot

I think I get now the idea. I'll try later this evening
BeginnerDO is offline  
Old 01/22/2013, 04:00   #6
 
»jD«'s Avatar
 
elite*gold: 237
Join Date: Sep 2010
Posts: 1,152
Received Thanks: 4,910
I generally generate an exe on runtime and launch that, that way that exe has access to overwrite/remove/create an exe that has the same name as the main program!

-jD
»jD« is offline  
Old 06/11/2013, 10:11   #7
 
elite*gold: 0
Join Date: Aug 2011
Posts: 159
Received Thanks: 57
Code:
    Public Shared Sub poista(nimi As String)
        Dim FileToDelete As String
        FileToDelete = Application.ExecutablePath.ToString()
        
        If System.IO.File.Exists(FileToDelete) = True Then
            System.IO.File.Delete(FileToDelete) 
        Else
           '
        End If

    End Sub
I quess this requires running as admistator? cause it's giving error: Access to the path [path] is denied. So it there any other way to do that? Or can I somehow ask "run as admistator" only for this?

I am also really getting annoyed with this updating cause its working correctly... Say whats wrong

Code:
 Dim linkki As Uri 'Download link'
 Dim Uusitiedosto As String 'Name of the newest version'

Uusitiedosto = xml.<NewDataSet>.<WebUpdate>.<Nimi1>.Value.ToString()
linkki = New Uri(xml.<NewDataSet>.<WebUpdate>.<DownloadLink>.Value)
            
            Try
                poista(tiedosto) 'this is above and gives the error'
            Catch ex As Exception
                MsgBox("Earlier version of cannot be deleted." & vbNewLine & vbNewLine & ex.ToString())
            End Try

            lataa(linkki, Uusitiedosto) 'downloads newest version with webclient.downloadFileAsync'

            MsgBox("Bot should be updated now :)" & vbNewLine & vbNewLine & "Restarting...") 'lets say this is MsgBoxA'

            Process.Start(Uusitiedosto) 'Another problem here'
            Form1.Close()
how can I make application wait that download is 100% ready? Now if I close MsgBoxA just after it popped up, process.start() doesnt work - it starts earlier version again (the same as application.restart() ). If I wait until the download is 100% ready and close the MsgBoxA after it then everything is working.
BeginnerDO is offline  
Old 06/11/2013, 13:45   #8
 
YatoDev's Avatar
 
elite*gold: 50
Join Date: Sep 2012
Posts: 3,841
Received Thanks: 1,462
Quote:
Originally Posted by »jD« View Post
I generally generate an exe on runtime and launch that, that way that exe has access to overwrite/remove/create an exe that has the same name as the main program!

-jD
hoe do you create a .exe in runtime ?
Your coding C# right ?

Can you give me a little example ?

hmm Thread a little bit to old ^^
YatoDev is offline  
Old 06/11/2013, 14:35   #9
 
»Barney«'s Avatar
 
elite*gold: 0
Join Date: May 2012
Posts: 868
Received Thanks: 947
Quote:
Originally Posted by »FlutterShy™ View Post
hoe do you create a .exe in runtime ?
Your coding C# right ?

Can you give me a little example ?

hmm Thread a little bit to old ^^
He saves it into the global::Properties.Resources class, and creates the executable using a FileStream.
»Barney« is offline  
Old 06/11/2013, 18:31   #10
 
YatoDev's Avatar
 
elite*gold: 50
Join Date: Sep 2012
Posts: 3,841
Received Thanks: 1,462
Quote:
Originally Posted by chichi011 View Post
He saves it into the global::Properties.Resources class, and creates the executable using a FileStream.
ahh i thought he creates a .net exe in runtime and compile it and i thought wtf ^^
YatoDev is offline  
Old 06/11/2013, 20:41   #11
 
»Barney«'s Avatar
 
elite*gold: 0
Join Date: May 2012
Posts: 868
Received Thanks: 947
Quote:
Originally Posted by »FlutterShy™ View Post
ahh i thought he creates a .net exe in runtime and compile it and i thought wtf ^^
Nah that's hard, not impossible but pretty hard. Add me in skype when you have time
»Barney« is offline  
Old 06/11/2013, 22:27   #12
 
'Heaven.'s Avatar
 
elite*gold: 1
The Black Market: 331/0/0
Join Date: Jun 2012
Posts: 5,819
Received Thanks: 3,200
Use codedom...
'Heaven. is offline  
Old 06/12/2013, 13:37   #13
 
»Barney«'s Avatar
 
elite*gold: 0
Join Date: May 2012
Posts: 868
Received Thanks: 947
Quote:
Originally Posted by 'Heaven. View Post
Use codedom...
Much harder that way
»Barney« is offline  
Old 06/12/2013, 13:45   #14
 
YatoDev's Avatar
 
elite*gold: 50
Join Date: Sep 2012
Posts: 3,841
Received Thanks: 1,462
Quote:
Originally Posted by chichi011 View Post
Nah that's hard, not impossible but pretty hard. Add me in skype when you have time
i dont want to do this
I can code myself
I only want to know how he's doing it
YatoDev is offline  
Reply


Similar Threads Similar Threads
help with autoupdate
07/22/2012 - SRO Private Server - 11 Replies
I have been trying to make autoupdate in my server but when i do it ,it say cant create file transfer manager i checked in errors errors i get : 1- CFileSystem::OpenFile() - È*ÀÏ ¿ÀÇÂ½ÇÆÐ 2-
Shaiya Bot ( Autoupdate, nearly all Versions )
11/25/2011 - Shaiya Hacks, Bots, Cheats & Exploits - 118 Replies
IT DOES NOT WORK FOR Shaiya PH. Some of the Hacks may also doesnt work anymore ( page 3 ) I did test it for Shaiya DE and Shaiya US, it should also work on serveral Privat server. DOWNLOAD: uploaded.to - where your files have to be uploaded to
WTB AUTOUPDATE HACKS
08/31/2010 - Dekaron Trading - 1 Replies
Im not sure if this is the right section or not but im Looking to Buy autoupdating Hacks or for sumone to provide me with updated hacks whenever the game updates if sumone has all the hacks message me or post here if ur interested hacks im looking for include:skill for summy devilswing,DA,poisonswrd,spiritdagger,/Bagi:madblo ods/Mage Inimid,creulty lightning, and the usuall Vac a good one not sum garbage one,Non Aggro again a good one, GM detect,GM privlages,Zoom,Far eye etc.... im sure u get...
AutoUpDate Trouble!
08/22/2009 - Dekaron Private Server - 2 Replies
I need to know what i have to Upload to my webspace if i will use the Updater? I know i have to insert my "IP" in this file: "Update.ini" Code: <Section1> IP path /update username anonymous
autoupdate
06/05/2007 - World of Warcraft - 13 Replies
hio, irgendjemand hat hier mal ein addon/programm gepostet, was automatisch nach den neusten versionen von addons sucht, die man selber benutzt. hab aber vergessen wie es hieß und wo es war. kann sich jemand erinnern?



All times are GMT +1. The time now is 07:14.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.