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? |
|
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. |
|