MarkusStrobl
Posts: 10
Joined: Wed Jul 09, 2008 7:32 am

Installing .NET publisher policy to GAC

Hi!

I need to deploy some .NET publisher policy files with my MSI file. The MSI package consists of my assemblys, the publisher policy files and the .config file for creating the publisher policys.

When installing the publisher policys with a call to gacutil.exe it works without a problem but when i try to add the publisher policy assembly files to GAC in the assembly tab of Advanced Installer the installation process pops up the attached error message.

I found a bug request of another user concerning this topic but he seemed to have a wrong config file attached.

I'm using Windows XP SP3 and Advanced Installer 7.7.

Thanks a lot for your help!

Greetings
Markus
Attachments
errormessage.JPG
errormessage.JPG (20.32 KiB) Viewed 9248 times
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Installing .NET publisher policy to GAC

Hi Markus,

I'm not sure why this happens. Can you please send us the .AIP (project) file you are using and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them?

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
MarkusStrobl
Posts: 10
Joined: Wed Jul 09, 2008 7:32 am

Re: Installing .NET publisher policy to GAC

Hi Cosmin,

thanks a lot for the quick reply. I've sent a mail with all the information to reproduce the problem including the verbose log you requested to this email adress.

I hope it helps to solve the issue.

Best wishes
Markus
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Installing .NET publisher policy to GAC

Hi Markus,

It seems this error message is not caused by the settings of Advanced Installer. You can read more details on the following link and this one too.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
MarkusStrobl
Posts: 10
Joined: Wed Jul 09, 2008 7:32 am

Re: Installing .NET publisher policy to GAC

Hi Bogdan,

thank you for your answer!

I'm aware of the fact that the original policy file has to be in the same directory as the policy-assembly when installing it into GAC.

This is why i included the original policy file (MySampleComponent.policy.config) in the sample .aip project i provided so it should be deployed to the destination directory.

Installing the files into GAC manually using gacutil.exe works fine but with Advanced Installer it give me the error specified.

Does Advanced Installer copy all the files (including the original policy file) into the destination directory and then performs the GAC-Installation or are those assemblys treated in another way and don't end up in the same directory with the original policy (.config) file ?

Thanks a lot for your help!

Greetings
Markus
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Installing .NET publisher policy to GAC

Hi Markus,
Does Advanced Installer copy all the files (including the original policy file) into the destination directory and then performs the GAC-Installation
Yes, first the files from the Files and Folders page are copied in the location given by APPDIR and then the installation (registration) of the assemblies takes place.

The second step (installation of assemblies) is executed in the last part of the installation so the files already exist on the machine.

I see you are installing them to GAC, can you please try the option "Private Install To:" and select the files added in the Files and Folders page?

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
MarkusStrobl
Posts: 10
Joined: Wed Jul 09, 2008 7:32 am

Re: Installing .NET publisher policy to GAC

Hi Bogdan,

sure! Private install works as expected. All of the 3 files of my sample project (.dll, policy and .config) get installed to the APPDIR folder.

But i need them to end up in GAC...

Greetings Markus
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Installing .NET publisher policy to GAC

Hi Markus,

I suspect the problem is with the installation order of the assemblies. Can you please create two separate package, one that installs the first version, the dependency
and another separate one that installs the second assembly.

The second assembly should now find as already installed its dependency and not give the error encountered.

EDIT: You can also try to add the policy as an aditional file to the new assembly, not as a separate assembly.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
MarkusStrobl
Posts: 10
Joined: Wed Jul 09, 2008 7:32 am

Re: Installing .NET publisher policy to GAC

Hi Bogdan,

adding the .config file to the component of the policy assembly worked for the sample project (with a single policy assembly).

In my real-life-project although i have to deal with 3 policy assemblys. In AI (in the Deployment/Organization-Tab) i'm only allowed to add the .config file to one of the policy assemblys. So the GAC installation failed again when the installation of the policys without config was processed.

Putting the policys in a separate MSI package didn't work either as i was running into the same problem.

As i got a little desperate then i solved the issue by deploying the policys and the config file as a private install and adding custom action tasks with the necessary calls to gacutil.exe.

I'm not 100% happy with this solution but at least it works. Maybe you could focus on this misbehavior in future releases of AI?

Thanks a lot anyway for your help!

Greetings
Markus
diabeteman
Posts: 7
Joined: Fri Feb 18, 2011 2:06 pm

Re: Installing .NET publisher policy to GAC

Hi Bogdan,

I second Markus' request as I need to register policies to the GAC without having to execute regasm or regsvr32.
Right now, I can't find a way to do just that in AI. Any idea ?

What's more, the dependency issue between the policy and its registered component can't be addressed in the same AI project (according to your previous answers).
What do you suggest ?

Thanks,
Robin

Return to “Common Problems”