[RESOLVED] Startup form issues :s
Ok, what i'm trying to do it make my program have an auto update feature, which i already have implemented but i'm chaning the way my program starts so now i need to mix everything around.
This is some information that you will need to try and understand my problem:
My project uses a Splash Screen (frmSplash)
My main form is 'frmMain'
My download update form is 'frmDownloader'
Now when my splash screen launches, it checks for updates. If there is an update is changes a public variable 'blnUpdate' to True.
Then when 'frmMain' loads i have this little clause in the Form_Load event:
Code:
If blnUpdate = True Then
frmDownloader.Show()
Me.Hide()
Exit Sub
End If
But for some reason frmMain still appears (so does frmDownloader).
Any Ideas?
Re: Startup form issues :s
You can't hide a form that hasn't been shown. You shouldn't even be creating the main form if you don't want to show it.
Re: Startup form issues :s
Quote:
Originally Posted by
jmcilhinney
You can't hide a form that hasn't been shown. You shouldn't even be creating the main form if you don't want to show it.
Where can i prevent frmMain from showing then? As it's my startup form, when the splashscreen times out it automatically opens.
I'm not quite sure where i have to intervene to show the downloader form.
Re: Startup form issues :s
You need to create a seperate .exe for your updater, otherwise your .exe will never be updated.
Start your normal .exe and check for update. If update available, call the update.exe en close your .exe.
Re: Startup form issues :s
Quote:
Originally Posted by
Radjesh Klauke
You need to create a seperate .exe for your updater, otherwise your .exe will never be updated.
Nah i don't directly update the .exe file. I do it a wierd way:
1) Downloads an installer package.
2) Runs installer package
3) Closes my .exe
4) Installer package finishes installing & opens updated .exe
Re: Startup form issues :s
It's not weird, but why so "complicated"?
Re: Startup form issues :s
Quote:
Originally Posted by
Radjesh Klauke
It's not weird, but why so "complicated"?
Mainly because the installer .exe it downloads is already compressed so i don't have to use other functions to decompress the file after i download it.
Re: Startup form issues :s
Okay.
- you don't need a splash_screen;
- check for update on the main form;
- if update found open the frm_update;
- download your update_installer;
- if download complete execute the installer from the frm_update and close the app;
- now the installer needs to take-over.
Re: Startup form issues :s
I just want the splash screen to show before the program for shits n giggles.
Is there any way around it?
Re: Startup form issues :s
Don't create a splash-screen, but a standard form which does your thing and when it's done load the other.
Re: Startup form issues :s
Yer fair enough, thanks for the help fellas :)