Install software on restart

A whole host of issues kicked off:

1) I included the wyUpdate.exe in a update, this meant that the updater could not update itself since the wyUpdate.exe file was in use (trying to update itself).2) I then tried to remove the wyUpdate.exe from the list of Program Files and uploaded a new build....this was to no avail since my software wont run, it freezes at the line "Application.Run(appContext);"

ApplicationContext appContext = new JMApplicationContext(args); if (appContext.MainForm != null) { Application.Run(appContext); }

Now Im lost, if I stop instanciating the new wyDay.Controls.AutomaticUpdater(); then my software will run otherwise, it just hangs. The problem I found out is that the software is calling "wyUpdate.exe" which does not run. I tried running the "wyUpdate.exe" executable and nothing happened.

..it seems if either "client.wyc" is missing or "wyUpdate.exe" is missing the application freezes.

Somewhere the AutomaticUpdater dll knows that there is an update to install so it tries to start the "wyUpdate.exe" application but if this file is not present, then its curtains for our software, the app hangs indefinitely.

Is this the problem you were getting by including wyUpdate.exe in your updates (that you mentioned in another post)? It shouldn't freeze your app. I'll have to look into this.

Yes this is the same issue. Look forward to hearing of your findings

Is there any progress on this? We are having very similar issues.

After wyUpdate updates the exe, the main Form just flashes and then the app quits. Is there a way to stop this?

2 things:

1. It shouldn't do this, we're looking into it right now.2. Don't include wyUpdate.exe in your update. Either in the old versions or in the latest version. If you want to update your own version of wyUpdate via self update then see this article.

Excited to hear what you discover, I sent you earlier today a screen shot with the issue, I hope it helps 😀

I can't reproduce this error. Can you guys send me your project (*.wyp) files to support@wyday.com

Just an update on how we fixed this, maybe it will help others:

1. Our app creates the main Form form via a constructor in main.2. It then calls Application.Run(Form)3. We check ClosingForInstall in the form constructor as per the wyUpdate docs.4. The form was being shown for a split second anyway.5. We fixed the problem by also checking ClosingForInstall in the Form closing method private void Form1_FormClosing(object sender, FormClosingEventArgs e) { if (!automaticUpdater.ClosingForInstall) { don't close items that aren't created and were causing a crash and incomplete install

Thanks for this, could you explain:

"don't close items that aren't created and were causing a crash and incomplete install"

Makes sure objects exist before killing them. The Form_closing method is not the same as a destructor. It seems to get called even if the constructor is not. Probably best to read the manual.

Is there a fix for this? I'm having the same problem and implementingthe check on closing does not fix it for me. So far I've had numerous support requests because of this error.

So far this has worked: Reinstalling my software into a fresh user profile.

And this has not worked: Clearing the %TMP% folders, rebooting.

My app uses:AutomaticUpdater & wyUpdate

If I knew where the pending downloads are stored, then I might be able to implement a check in my app to delete it, to allow proper loading

Thanks!

I'm not sure what problem you're having. Is your app crashing? If so, what's the exception? What happens when you attach a debugger? Are you adding the AutomaticUpdater to your main form? If so, are you creating your main form with Application.Run(...)?

You have no idea how much of heartache your email saved me from. 🙂 I had found"%userprofile%\wc" but it was the "%appdata%\wyUpdate AU" that eluded me.

And btw, in addition to catching "ClosingForInstall" in New(), I added the following 3 lines to the start of my form load event and the problem disappeared. 😮 Such simple solutions... lol----If Me.AutomaticUpdater1.ClosingForInstall Then Exit SubEnd If

Thanks Sam!!!

EDIT:

Also for some reason this works:

If Me.AutomaticUpdater1.ClosingForInstall Then Exit SubEnd If

Call Form_Load_Tasks()

But this does not:

If Me.AutomaticUpdater1.ClosingForInstall = False Then Call Form_Load_Tasks()End If

Thanks Sam!!!

No problem.

Also for some reason this works: [...] But this does not: [...]

Is there an exception? What happens?

When I nested the Call Form_Load_Tasks() within the false check, it did not call "Form_Load_Tasks()", but no worries 🙂 The first method works fine.