Search code examples
.netwindowspowershellinno-setupgac

GAC install issue with InnoSetup


Windows 8.1 has by default these .net assemblies installed here:

C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.PowerShell.ConsoleHost\v4.0_3.0.0.0__31bf3856ad364e35\Microsoft.PowerShell.ConsoleHost.dll

here:

C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.PowerShell.ConsoleHost.Resources\v4.0_3.0.0.0_es_31bf3856ad364e35\Microsoft.PowerShell.ConsoleHost.Resources.dll

and here:

C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Policy.1.0.Microsoft.PowerShell.ConsoleHost\v4.0_1.0.0.0__31bf3856ad364e35\Policy.1.0.Microsoft.Powershell.ConsoleHost.dll

I would like to install them from my innosetup installer to other Windows 8.1 that has Powershell features removed and the lack of that assemblies.

I've read about the gacinstall flag but I'm not sure how I should do it to reproduce the same structure that Windows has by default and also I'm not sure whether I should locate and specifiy an strong name in the StrongAssemblyName parameter for those dlls, someone could give an installer example?


Solution

  • It is OK to set any target folder such as {app} in [Files] for the assembly file,

    http://odd-staff.blogspot.com/2010/04/well.html

    But you need to specify gacinstall flag so that Inno Setup takes care of registering it into GAC.