How do I show "Finished installing" notification after silently installing apps with InPlaceHostingManager

Enkhbold Munkhbold 136 Reputation points
2020-08-04T06:42:11.56+00:00

I have used InPlaceHostingManager to install one or several apps silently on the client-side.
And now I want them to know when it finishes installing so they can start using it. I don't plan on using any progress bar or anything, just needed to install any number of installations as one batch (with one click).
I just need to notify the user when the installation process ends even if my own app that started the installation is closed before it finishes.

InPlaceHostingManager has this line:
iphm.DownloadApplicationCompleted += new EventHandler<DownloadApplicationCompletedEventArgs>(iphm_DownloadApplicationCompleted); and shows a messagebox like so
`void iphm_DownloadApplicationCompleted(object sender, DownloadApplicationCompletedEventArgs e)
{
if (e.Error != null)
{
MessageBox.Show("Could not download and install application. Error: " + e.Error.Message);
return;
}

        // When Application is successfully installed on the client computer.
        MessageBox.Show("Application installed! You may now run it from the Start menu.");
    }`

should I run a service? or call something after my program closes. Someone told me just call the event after you close your program but I think I should do it on the installation side.

How should I do this?

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,783 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.