this.CreateProcess only works when executing IE as administrator?

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

this.CreateProcess only works when executing IE as administrator?
 
Leonardo Pignataro




Posts: 7
Joined: 2012-05-22
I'm using the code suggested in the Developer's Code to invoke the update via ClickTwice of my addon. Eventually, the following statement is executed:


this.CreateProcess(""" + ieFullPath + "" "" + updateUrl + """);


Which in turn invokes the download of the updated <projectname>.exe. However, it seems that the CreateProcess method only works when IE is executing with administrative privileges. When it is not executing with such privileges, the method seems to silently fail, that is, it doesn't invoke the download and it doesn't throw an exception.

I checked the string that is passed to the method in both cases, and it is the same:

"C:\Program Files (x86)\Internet Explorer\iexplore.exe" "http://10.1.1.117/1046/2.17.0/pluginiev2.exe"

What could be wrong?
Posted 22 May, 2012 14:14:57 Top
Leonardo Pignataro




Posts: 7
Joined: 2012-05-22
The whole code follows:


private void update(bool silent) {
	Console.Log("Checking for updates");
	try {
		if (this.IsNetworkDeployed() && this.IsUpdatable()) {
			string updateUrl = this.CheckForUpdates();
			if (!String.IsNullOrEmpty(updateUrl)) {
				if (MessageBox.Show("Uma nova versão do plugin foi detectada!

Você gostaria de realizar a atualização?", this.ModuleName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) {
					string ieFullPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Internet Explorer\iexplore.exe");
					Console.Log("Calling CreateProcess - " + """ + ieFullPath + "" "" + updateUrl + """);
					this.CreateProcess(""" + ieFullPath + "" "" + updateUrl + """);
				}
			} else {
				if (!silent) {
					MessageBox.Show("Não há updates disponíveis!");
				}
			}
		} else {
			if (!silent) {
				MessageBox.Show("Não é possível atualizar o plugin.");
			}
		}
	} catch (Exception ex) {
		Console.Log("Ocorreu um erro ao verificar atualizações: " + ex);
	}
}
Posted 22 May, 2012 14:16:46 Top
Leonardo Pignataro




Posts: 7
Joined: 2012-05-22
And the log follows:


------------------------------------------------------------
22/05/2012 16:07:28: Checking for updates
------------------------------------------------------------
22/05/2012 16:07:29: Calling CreateProcess - "C:\Program Files (x86)\Internet Explorer\iexplore.exe" "http://10.1.1.117/1046/2.19.0/pluginiev2.exe"
------------------------------------------------------------


BTW, the ";" after the "pluginiev2.exe" is being added by the forum...
Posted 22 May, 2012 14:18:13 Top
Leonardo Pignataro




Posts: 7
Joined: 2012-05-22
Oh, and the update does work when executing IE as administrator.
Posted 22 May, 2012 14:58:15 Top
Sergey Grischenko


Add-in Express team


Posts: 7202
Joined: 2004-07-05
Hi Leonardo,

Thank you for the bug report. Please use 'Process.Start(ieFullPath, updateUrl);' instead of 'this.CreateProcess'.
Posted 23 May, 2012 06:31:12 Top
Leonardo Pignataro




Posts: 7
Joined: 2012-05-22
Hello, Sergey.

That did the trick.

Thank you for your assistance!
Posted 24 May, 2012 12:08:37 Top