fangjiaguo
Posts: 18
Joined: Sun Nov 09, 2008 4:12 pm

My requirement for Updater

Hi,
My team now are using Advanced Installer, especially the Updater.

Here is our requirement:
We are using Microsoft VSTO project for Excel Add-in, so the application file are all *.dll files.
What we want to do is when a user clicks our project button on Excel toolbar, Updater.exe should be called and checks for updates (We call Updater.exe in our C# code).

1.How to make Updater and our code sequentially be executed? That means our code will wait until Updater finished.
2.I think it is a serious problem that our executing *.dll will be covered when Updater finished.

Please help me~ Thanks!
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: My requirement for Updater

Hi,

What you need can be done by integrating the Updater into your application. Basically, you can launch the Updater when your code is called. Please note that the User Guide contains the Integrate Updater In C# Application and Wait for updater how-to's which may help you.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
fangjiaguo
Posts: 18
Joined: Sun Nov 09, 2008 4:12 pm

Re: My requirement for Updater

Thank you for your reply!

1.I want to ask a question in "Integrate Updater In C# Application".
When the following code is executed, the executing Form.exe will be replaced by the updated Form.exe(Am I right?).
Will that be a problem?

Code: Select all

    private static void StartSilent()
    {
      Thread.Sleep(10000);

      Process process = Process.Start(updaterModulePath, "/silent");
      process.Close();
    }
2.Can you supply a C# sample for "Wait for Updater". :)
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: My requirement for Updater

Hi,
When the following code is executed, the executing Form.exe will be replaced by the updated Form.exe(Am I right?).
Will that be a problem?
Yes, your application should be updated if the update has this purpose (you determine which files will be updated when you create the update package). Please note that Windows Installer cannot update an application which is running, therefore you should take precautions to make sure that it will be closed when the update is installed. For this you can try using the auto-close feature or a custom action.
Can you supply a C# sample for "Wait for Updater"
Unfortunately we do not have sample C# code for this and our developers are currently working on the 6.7 release. However, I have added on our TODO list a help article with sample C# code (it will be included in a future version of Advanced Installer). Until then, you can try using the approach explained in the article I mentioned (with the sample C++ code).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
palelocust
Posts: 7
Joined: Sun Nov 23, 2008 7:51 pm

Re: My requirement for Updater

Here's a C# example:

Code: Select all

 Process process = Process.Start(_UpdateModulePath, "/checknow");
            process.WaitForExit();

            Process[] proc2 = Process.GetProcessesByName("updater");
            proc2[0].WaitForExit();
where "updater" is the name of your proocess. In my case, I just kept the updater.exe as the default name. If you renamed it, it would be the name you changed it to.

Return to “Common Problems”