Here's the bit that's important:

CAQuietExec:  Import-Module : Could not load file or assembly 
'file:///C:\Program Files\MYCORP
CAQuietExec:  \MYCORP Services\Common\NServiceBus.Core.dll' or one of its 
dependencies. This a
CAQuietExec:  ssembly is built by a runtime newer than the currently loaded 
runtime and cannot be loaded.

This is telling you that the assembly you are trying to load is probably 
compiled against .NET 4 while PowerShell is loading the .NET 2 runtime. 
PowerShell v3 loads the .NET 4 runtime but PowerShell v2 still only loads the 
.NET 2 runtime. The easiest solution if you can manage it is to get 
NServiceBus.Core.dll compiled against the .NET 2 runtime (.NET 3.5 would work 
too). Otherwise you'll need to decide whether you'll only support PowerShell v3 
OR create/customize a PowerShell.exe.config that allows PowerShell to load the 
.NET 4 runtime.

Edwin G. Castro
Software Developer - Staff
Digital Channels
Fiserv
Office: 503-746-0643
Fax: 503-617-0291
www.fiserv.com

> -----Original Message-----
> From: StevenOgilvie [mailto:sogil...@msn.com]
> Sent: Tuesday, March 05, 2013 2:14 PM
> To: wix-users@lists.sourceforge.net
> Subject: [WiX-users] Running PowerShell script...
> 
> Hi guys
> 
> I have googled and done everything I think I should have done but I am
> getting a funky error in the MSI log file, has anyone else had this issue, if 
> so
> how did you fix it?
> 
> Install the Powershell file
> <Component Id="cmp_RegisterNServiceBusLicense"
> Guid="{276C369D-BF32-472F-A7FC-24155DEB18DE}">
>           <File Id="file_RegisterNServiceBusLicense" KeyPath="yes"
> Source="..\$(var.resourcePath)\RegisterLicense.ps1" />
>         </Component>
> 
> 
> Set the custom action
> <CustomAction Id="CA_SetNServiceBusLicense"
> Property="CA_NSERVICEBUSLICENSE"
> Value ="&quot;[POWERSHELLEXE]&quot; -Version 2.0 -NoProfile -
> NonInteractive -InputFormat None -ExecutionPolicy Bypass -Command
> &quot;&amp; '[#file_RegisterNServiceBusLicense]' ; exit
> $$($Error.Count)&quot;" />
>     <CustomAction Id="CA_NSERVICEBUSLICENSE" BinaryKey="WixCA"
> DllEntry="CAQuietExec" Execute="deferred" Return="check"
> Impersonate="no" />
>     <UI>
>       <ProgressText Action="CA_NSERVICEBUSLICENSE">CA: Installing
> NServiceBus license...</ProgressText>
>     </UI>
> 
> Sequence the custom action
> <InstallExecuteSequence>
> <Custom Action="CA_SetNServiceBusLicense"
> After="InstallValidate"></Custom> <Custom
> Action="CA_NSERVICEBUSLICENSE" Before="InstallServices">NOT
> Installed</Custom>
> 
> Get the powershell path:
> 
>     <Property Id="POWERSHELLEXE">
>       <RegistrySearch Id="POWERSHELLEXE"
>                       Type="raw"
>                       Root="HKLM"
> 
> Key="SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell"
>                       Name="Path" />
>     </Property>
>     <Condition Message="This application requires Windows PowerShell.">
> 
>     </Condition>
> 
> The powershell script itself is pretty basic:
> C:
> CD "C:\Program Files\MYCORP\MYCORP Services\Common"
> Import-Module .\NServiceBus.Core.dll
> Install-License -Path .\License.xml
> 
> 
> The error in the msi logfile:
> 
> Action 17:00:34:
> CA_NSERVICEBUSLICENSE.CA23A0DC_B2DE_4F2C_9E74_FD373F99E9D7.
> CA: Installing NServiceBus license...
> MSI (s) (5C:48) [17:00:34:296]: Executing op:
> CustomActionSchedule(Action=CA_NSERVICEBUSLICENSE.CA23A0DC_B2DE_
> 4F2C_9E74_FD373F99E9D7,ActionType=3073,Source=BinaryData,Target=CAQ
> uietExec,CustomActionData="C:\Windows\System32\WindowsPowerShell\v
> 1.0\powershell.exe"
> -Version 2.0 -NoProfile -NonInteractive -InputFormat None -ExecutionPolicy
> Bypass -Command "& 'C:\Program
> Files\MYCORP\MYCORPServices\Common\RegisterLicense.ps1' ; exit
> $($Error.Count)")
> MSI (s) (5C:64) [17:00:34:317]: Invoking remote custom action. DLL:
> C:\Windows\Installer\MSI8EA2.tmp, Entrypoint: CAQuietExec
> CAQuietExec:  Entering CAQuietExec in C:\Windows\Installer\MSI8EA2.tmp,
> version 3.7.1224.0
> CAQuietExec:
> "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
> -Version 2.0 -NoProfile -NonInteractive -InputFormat None -ExecutionPolicy
> Bypass -Command "& 'C:\Program Files\MYCORP\MYCORP
> Services\Common\RegisterLicense.ps1' ; exit $($Error.Count)"
> CAQuietExec:  Import-Module : Could not load file or assembly
> 'file:///C:\Program Files\MYCORP
> CAQuietExec:  \MYCORP Services\Common\NServiceBus.Core.dll' or one of
> its dependencies. This a
> CAQuietExec:  ssembly is built by a runtime newer than the currently loaded
> runtime and cannot be loaded.
> CAQuietExec:  At C:\Program Files\MYCORP\MYCORP
> Services\Common\RegisterLicense.ps1:5 char:14
> CAQuietExec:  + Import-Module <<<<  .\NServiceBus.Core.dll  + CategoryInfo
> : NotSpecified: (:) , BadImageFormatException
> CAQuietExec:      + FullyQualifiedErrorId :
> System.BadImageFormatException,Microsoft.PowerShell.Commands.Import
> ModuleCommand
> CAQuietExec:
> CAQuietExec:  Install-License : The term 'Install-License' is not recognized 
> as
> the name of a
> CAQuietExec:   cmdlet, function, script file, or operable program. Check the
> spelling of the
> CAQuietExec:  name, or if a path was included, verify that the path is correct
> and try again.
> CAQuietExec:  At C:\Program Files\MYCORP\MYCORP
> Services\Common\RegisterLicense.ps1:6 char:16
> CAQuietExec:  + Install-License <<<<  -Path .\License.xml
> CAQuietExec:      + CategoryInfo          : ObjectNotFound:
> (Install-License:String) , Com
> CAQuietExec:     mandNotFoundException
> CAQuietExec:      + FullyQualifiedErrorId : CommandNotFoundException
> CAQuietExec:
> CAQuietExec:  Error 0x80070002: Command line returned an error.
> CAQuietExec:  Error 0x80070002: CAQuietExec Failed CustomAction
> CA_NSERVICEBUSLICENSE.CA23A0DC_B2DE_4F2C_9E74_FD373F99E9D7
> returned actual error code 1603 (note this may not be 100% accurate if
> translation happened inside sandbox)
> 
> thanks,
> 
> Steve
> 
> 
> 
> 
> --
> View this message in context: http://windows-installer-xml-wix-
> toolset.687559.n2.nabble.com/Running-PowerShell-script-tp7584122.html
> Sent from the wix-users mailing list archive at Nabble.com.
> 
> ------------------------------------------------------------------------------
> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
> endpoint security space. For insight on selecting the right partner to tackle
> endpoint security challenges, access the full report.
> http://p.sf.net/sfu/symantec-dev2dev
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to