clickTwice error "unable to find a version of the runtime to run this application"

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

clickTwice error "unable to find a version of the runtime to run this application"
 
Ledan Thomas




Posts: 4
Joined: 2012-10-15
Hi Add-in Express Team,

I'm facing an error when I try to deploy my Office add-in (Excel, PowerPoint and Word) with clickTwice technology. This add-in is a per-user COM add-in.
The MSI generated by the setup project works fine when executed the classic way.

Now, I've followed the clickTwice documentation : I'm able to generate the downloader and I copied all generated files to a custom websites with a single page providing a link to the downloader.

On a virtual machine, with .Net 4.0 Client profile already installed, I have 2 users, one is admin, the other is not.

When the admin user click on the link, everything is ok, msi is downloaded and executed.
When the "normal" user cick on the link, I got the error "unable to find a version of the runtime to run this application".
When the "normal" user right-clicks on the link, downloads the target (the downloader executable file) and executes it from the desktop, everything works fine.

It seems that when the "normal" user tries to execute the downloader, it is launch in a "internet explorer context" that doesn't detect that .Net 4.0 frmaework is already installed...

As a test I regenerate files after checking the ".Net Framework 4.0 Client Profile" in the Prerequisites forms of the Publish ADX Project Wizard and repeat the whole process (and modified the link to the setup.exe file, of course). Then the setup.exe wants to install the .Net 4.0 Client Profile framework for both users.

Do you have any solutions ?

Thanks,
Thomas
Posted 15 Oct, 2012 12:25:54 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello Thomas,

Is is possible that localizations of .NET 4 Client Profile on your PC differs from that on the target PC?

What .NET version is used in your project? Note that the downloader is created and built using this .NET version. BTW, is .NET properly updated on your developement PC?


Andrei Smolin
Add-in Express Team Leader
Posted 16 Oct, 2012 11:43:34 Top
Ledan Thomas




Posts: 4
Joined: 2012-10-15
Thanks Andrei for your response,

Unfortunately it didn't help : I have the same exact version of .Net Framework (4.0 Client Profile v 4.0.30319 / 1033 according to registry) on both machine. My developement machine is up to date and the add-in project is build with .net 4.0 Client Profile (according to project properties windows in VS)

I have made some more testing and found that I can reproduce the problem even with an admin user: indeed the problem only occurs on Internet Explorer (i've only tested on IE 9) when the site is in "Trusted Sites" or "Local Intranet" zones with default security level.
On other zone or when "tweaking" security level, Internet Explorer offers me to "Run" or to "Save" the file (downloader executable), which in every case download the file (temporary file folder if I choose "Run") then executes it.

Of course, I can't modify user's Internet Explorer settings nor explain that they need to change their default browser to use my add-in, so I'm still looking for a solution.

Thomas
Posted 19 Oct, 2012 03:41:37 Top
Sergey Grischenko


Add-in Express team


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

How did you include prerequites in the publish wizard: from the same location with the application or from the vendor's web site?
Posted 19 Oct, 2012 11:24:12 Top
Thomas Ledan




Posts: 4
Joined: 2012-10-15
Hi Sergey,

I don't have prerequisites at the moment, I added them just for the test.

As launching Internet Explorer to download the bootstraper seamed to cause the problem in my case :

string ieFullPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Internet Explorer\iexplore.exe");
this.CreateProcess(""" + ieFullPath + "" "" + updateUrl + """);


I replace the upper chunk of code by this :

string fileName = @"bluekiwi.office.addin.exe";
string filePath = FileHelper.DownloadFile(updateURL, fileName, 10000);

///Execute bootstrapper
try
{
		Process p = new Process();
		p.StartInfo.FileName = filePath;
		p.Start();
		p.WaitForExit();

		result = true;
}
catch (Exception ex)
{
		Trc.LogError(ex, "Unable to run the 'clickTwice downloader'");
}

FileHelper.DeleteTmpAttachmentsFile(new s tring[] { filePath });


FileHelper is one of our utility class to manipulate file.

Although I would like to understand why Internet Explorer causes an error, my problem is solved for the moment.

Thomas
Posted 22 Oct, 2012 04:08:27 Top
Sergey Grischenko


Add-in Express team


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

I think the problem occurs because the .NET Framework version installed on the target PC does not match the .NET Framework version that was used for building the ClickTwice downloader. Please try to build the add-in with '.Net Framework 4.0 Full Version'. I am going to add the 'LaunchUpdate(string installationUrl)' method to the new version of the product. It will do the same as the code above.
Posted 22 Oct, 2012 07:32:56 Top