Volker
Posts: 3
Joined: Mon Feb 18, 2008 10:18 am

Installer for VSTO Add-In

Hi,
I'm testing, if it's possible to create an installer for an Office 2003 Add-In created by VSTO SE.

As far as I've tested yet, I can deal with the prerequisites, copy all required files and add the required registry keys.

But I don't see how to grant trust to my assemblies. At MSDN is described how to solve this for installers created by Visual Studio (see "Adding a Custom Action to Grant Trust to the Assembly"): http://msdn2.microsoft.com/en-us/librar ... solutions]

How can I achieve that with Advanced Installer (Pro)?

Thanks & best regards
Volker
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

Please note that this article contains a sample custom action which grants trust to an assembly (it is contained by the MSI in the beginning of the article).

You can use that sample custom action to develop your package. You can read more about custom actions here:
http://www.advancedinstaller.com/user-g ... -page.html

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Volker
Posts: 3
Joined: Mon Feb 18, 2008 10:18 am

Hi,
I've searched and tried a bit more. Now I tried to use the command line tool caspol.exe (http://msdn2.microsoft.com/en-us/librar ... S.80).aspx) to grant full trust to my assemblies.

Therefore I added a custom action "Run an Exe File" with an "preexisting file on the target machine".

I've verified in the Project Settings - Search Dialog that my search property (named CASPOL.EXE) is correct.

In the Custom Actions, the poperty name is "CASPOL.EXE". But I'm not sure about the Command Line. Do I have to put only the arguments of caspol or the complete command inclusive caspol?

I've tried these two versions:
[CASPOL.EXE] -af "[#myassembly.dll]"
and
-af "[#myassembly.dll]"

In both cases, I get an error. The log says (for the first case):
PropertySource 3: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CasPol.exe 4: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CasPol.exe -af "C:\Programme\company\programm folder\myassembly.dll"

Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected.

Any hints for me?

Thanks & best regards
Volker
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,
Therefore I added a custom action "Run an Exe File" with an "preexisting file on the target machine". But I'm not sure about the Command Line.
I think you are referring to an Installed custom action ("New Installed Custom Action" in the menu). In this case the "Command Line" field will contain the parameters of the executable. For your example the command line is:

Code: Select all

-af "[#myassembly.dll]"
Have you signed the assembly with a strong name? Note that this is required in order to use the -af parameter. You can read more about this here:
http://msdn2.microsoft.com/en-us/library/cb6t8dtz.aspx
http://msdn2.microsoft.com/en-us/library/wd40t7ad.aspx
http://msdn2.microsoft.com/en-us/library/k5b5tt23.aspx

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Volker
Posts: 3
Joined: Mon Feb 18, 2008 10:18 am

Hi,
thank you for your fast reply!
cosmin wrote: I think you are referring to an Installed custom action ("New Installed Custom Action" in the menu). In this case the "Command Line" field will contain the parameters of the executable. For your example the command line is:

Code: Select all

-af "[#myassembly.dll]"
It's a custom action of the type "EXE with path given by a Property".

Is there a chance to log the output of caspol somewhere? I tried

Code: Select all

-af "[#ReportFactoryExcel.dll]" >c:\log.txt
without success.
cosmin wrote: Have you signed the assembly with a strong name? Note that this is required in order to use the -af parameter.
Yes, my assemblies are sigend and have a strong name.

Thanks & best regards
Volker
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

I'm not sure why you are encountering this behavior. Can you please send us the AIP which shows this problem to support at advancedinstaller dot com so we can investigate it?

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
franklopez
Posts: 10
Joined: Wed Jul 08, 2009 4:38 am

Re: Installer for VSTO Add-In

Did you ever figure out what was wrong?

I need to do the same thing...

meaning, install the VSTO 2.0 SE runtime for my plug-in.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Installer for VSTO Add-In

Hi,

Volker encountered a problem with the custom action which launched the "caspol.exe" tool. This tool doesn't support a log parameter. Are you encountering a similar behavior?

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
franklopez
Posts: 10
Joined: Wed Jul 08, 2009 4:38 am

Re: Installer for VSTO Add-In

We need to do the same exact thing because we have a similar plug-in installer we are building.

Why did this tool not having a "log" parameter become an issue?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Installer for VSTO Add-In

Hi,
Why did this tool not having a "log" parameter become an issue?
Volker used a custom action to launch the tool. He wanted to log the actions of the tool, but the tool doesn't have a logging parameter, so the custom action failed. It was a simple mistake made by the developer of the package.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”