Sinisterly
Auto Update application vb.net <HELP> - Printable Version

+- Sinisterly (https://sinister.li)
+-- Forum: Coding (https://sinister.li/Forum-Coding)
+--- Forum: Visual Basic & .NET Framework (https://sinister.li/Forum-Visual-Basic-NET-Framework)
+--- Thread: Auto Update application vb.net <HELP> (/Thread-Auto-Update-application-vb-net-HELP)



Auto Update application vb.net <HELP> - mirzetaga - 07-05-2011

Hello good people

I have this code :
Code:
Private Sub CheckForUpdates() Dim rope As String Dim wc As New WebClient rope = wc.DownloadString("http://mirzetaga.fileave.com/Update.txt") If rope.Contains("1.1") Then 'Change The 1.1 To The Latest Version. If MessageBox.Show("New update has been found, Download?", "YouTube Express; New Update!", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) = DialogResult.Yes Then Dim sfdUpdate As New SaveFileDialog sfdUpdate.Title = "Select Location For; Program Update." sfdUpdate.Filter = "WinRAR archive (.rar)|*.rar" 'Easily Implementable If You Wish To Change To "Executable (.exe)|*.exe" If sfdUpdate.ShowDialog = Windows.Forms.DialogResult.OK Then My.Computer.Network.DownloadFile("http://mirzetaga.fileave.com/Update.rar", sfdUpdate.FileName) If IO.File.Exists(sfdUpdate.FileName) Then Process.Start(sfdUpdate.FileName) End If DialogResult.No Then Me.ResumeLayout() End If End If End If End If End If Exit Sub End Sub

That is visual basic update but now i need source where when i click update application that he delete my program and extract new update that program downloaded or he can just replace... So i need to he updates automaticaly application and start that update.

PLEASE HELP !!!

Thanks all !!!!!


RE: Auto Update application vb.net - mirzetaga - 07-05-2011

(07-05-2011, 06:20 PM)The 7th Sage Wrote: Use File.delete command before you download the new update. Thats all you need.

That is good but i cant find where the windows install application Sad

And can you tell me what will i need to use to update what files ?




RE: Auto Update application vb.net <HELP> - blowdoof - 07-07-2011

or just create an initial setup package...
little trick;
write the destination path to a registry entry on initial setup... on update, just read out that registry key to find where it has been installed..
To write the install path to your registry on install, open up the registry editor in your setup project and add a key similar to this;
installPath = [TARGETDIR]
[TARGETDIR] will be taken from your setup package (even if you let your users decide to install into different folder than the default program folder)


RE: Auto Update application vb.net <HELP> - mirzetaga - 07-07-2011

(07-07-2011, 05:06 PM)blowdoof Wrote: or just create an initial setup package...
little trick;
write the destination path to a registry entry on initial setup... on update, just read out that registry key to find where it has been installed..
To write the install path to your registry on install, open up the registry editor in your setup project and add a key similar to this;
installPath = [TARGETDIR]
[TARGETDIR] will be taken from your setup package (even if you let your users decide to install different folder than the default program folder)

I read this 10 times but i cant understand what you want to say can u please more explain.
[*] i realy dont know how to do this and where i find it (write the destination path to a registry entry on initial setup)




RE: Auto Update application vb.net <HELP> - blowdoof - 07-07-2011

- create a new setup project (or modify an existing)
- in that setup project, you can define/specify which registry values you want to add during setup
..there you can define a registry entry for the install path.. which you can use afterwards for retrieving the exact install path of your application


RE: Auto Update application vb.net <HELP> - mirzetaga - 07-08-2011

I understand you now but can you tell me what type of setup project i must use (InstallShield,Setup Project,Setup Wizard...) I think in install shield have option for registry editor, but i dont have it and when it make new setup.exe and when user open it, then he show msgbox something like "This is trial version of install shield"... ? What i need to use (what type of the setup project)


RE: Auto Update application vb.net <HELP> - blowdoof - 07-08-2011

just create a new setup project


RE: Auto Update application vb.net <HELP> - kevininstructor - 07-31-2011

Regardsless of how you install now it is best to use a installer which allows you to write registryentries. Best place to write is here HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths.