It dawned on me that I should output the $prismName variable to a file to
see if it was empty, and sure enough it was. I used this to test that:

$prismName = (Get-AppxPackage -Name PRISMContingency).PackageFamilyName
$prismName | Out-File -FilePath C:\test.txt
C:\Windows\system32\CheckNetIsolation.exe "loopbackexempt" "-a"
"-n=$($prismName)"

When I look at my custom actions in WIX, my windows app should be installed
before the Get-AppxPackage command is ran to get the package family name as
you can see below. The InstallAppx is a powershell script to sideload a
windows all and I need to run the UnblockService afterward the app is
installed. Again, when I run this powershell script after my installer is
finished, and therefore my InstallAppx powershell script is finished, it
works fine. It acts like install isn't "finished" before I try to run my
unblockservice.

<Custom Action="CustomAction.InstallCertificate_Cmd"
              After="InstallFiles">
        NOT Installed
      </Custom>
      <Custom Action="CustomAction.InstallCertificate"
              After="CustomAction.InstallCertificate_Cmd">
        NOT Installed
      </Custom>
      <Custom Action="CustomAction.InstallAppx_Cmd"
              After="CustomAction.InstallCertificate">
        NOT Installed
      </Custom>
      <Custom Action="CustomAction.InstallAppx"
              After="CustomAction.InstallAppx_Cmd">
        NOT Installed
      </Custom>
      <Custom Action="CustomAction.UnblockService_Cmd"
              After="CustomAction.InstallAppx">
        NOT Installed
      </Custom>
      <Custom Action="CustomAction.UnblockService"
              After="CustomAction.UnblockService_Cmd">
        NOT Installed
      </Custom>

On Thu, Jan 22, 2015 at 8:08 PM, Justin Dyer <justin.p.d...@gmail.com>
wrote:

> I am having trouble running a powershell command in my wix installer. I
> have a CustomAction defined in my installer that runs a powershell script.
>
> The powershell script is the following:
>
>> $prismName = (Get-AppxPackage -Name PRISMContingency).PackageFamilyName
>> C:\Windows\system32\CheckNetIsolation.exe "loopbackexempt" "-a"
>> "-n=$($prismName)"
>
>
> If I run this powershell script from powershell, it works properly
> assuming I am running it as administrator. However, it is failing to run
> that script properly during installation. When I look at the log file
> during install, I see this:
>
> MSI (s) (30:E0) [16:52:23:881]: Executing op:
>> CustomActionSchedule(Action=CustomAction.UnblockService,ActionType=3073,Source=BinaryData,Target=CAQuietExec,CustomActionData="C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe"
>> -NoProfile -NonInteractive -InputFormat None -ExecutionPolicy Bypass -File
>> "C:\Program Files (x86)\PRISM Contingency\UnblockService.ps1")
>> MSI (s) (30:BC) [16:52:23:897]: Invoking remote custom action. DLL:
>> C:\Windows\Installer\MSI8C9B.tmp, Entrypoint: CAQuietExec
>> CAQuietExec:  Error: Invalid Parameters
>> CAQuietExec:
>> CAQuietExec:  Usage:
>> CAQuietExec:     CheckNetIsolation LoopbackExempt
>> CAQuietExec:        List of operations:
>> CAQuietExec:            -a  -  Add the AppContainer or Package Family to
>> the loopback
>> CAQuietExec:                   exempted list.
>>
>> CAQuietExec:            -d  -  Delete an AppContainer or Package Family
>> from the
>> CAQuietExec:                   loopback exempted list.
>>
>> CAQuietExec:            -c  -  Clear the list of loopback exempted
>> AppContainers and
>> CAQuietExec:                   Package Families.
>>
>> CAQuietExec:            -s  -  Show a list of loopback exempted
>> AppContainers and
>> CAQuietExec:                   Package Families.
>>
>> CAQuietExec:
>> CAQuietExec:        List of arguments:
>> CAQuietExec:            -n= - AppContainer Name or Package Family Name.
>>
>> CAQuietExec:            -p= - AppContainer or Package Family Security
>> Identifier (SID).
>> CAQuietExec:            -?  - Displays this help message for the
>> LoopbackExempt module.
>> CAQuietExec:
>
>
> It is almost as if the command for CheckNetIsolation isn't formed
> correctly, but when I run the script myself I am not getting this problem.
> Any ideas why the command arguments could be malformed?
>
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to