Updating a ClickTwice installation without hardcoding Internet Explorer

Add-in Express™ Support Service
That's what is more important than anything else

Updating a ClickTwice installation without hardcoding Internet Explorer
 
mscheuner


Guest


I'm looking into the ability to do automatic updates of ClickTwice :) installations, and while the code you provide in the documentation does work - I don't like it "as-is".


if (IsMSINetworkDeployed() && IsMSIUpdatable()) 
{
   string updateUrl = CheckForMSIUpdates();

   if (!String.IsNullOrEmpty(updateUrl)) 
   {
       if (MessageBox.Show(TextRessources.NewVersionDetected, AddinName, 
                           MessageBoxButtons.YesNo, 
                           MessageBoxIcon.Question) == DialogResult.Yes) 
       {
           string ieFullPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), 
                                "Internet Explorer\iexplore.exe");
           CreateProcess(""" + ieFullPath + "" "" + updateUrl + """);
       }
   }
}


What I'm bothered by is the fact you're *hard-coding* a dependency on Internet Explorer into the upgrade process.

Just as a question: isn't there a better, simpler way to do this? Is there any way I could download the EXE-file the "updateUrl" refers to and then execute it in the current process, without having to use Internet Explorer?
Posted 04 Sep, 2014 04:30:46 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Marc,

Of course, you can download and run the .exe using your code. The code above uses IE because the browser automatically downloads and saves the .exe in the 'Temporary Internet Files' folder.
Posted 04 Sep, 2014 05:57:29 Top