[wix-users] Running PowerShell script after installer finishes

Edwin Castro egcastr at gmail.com
Thu Jun 14 21:08:19 PDT 2018


Yes, the details matter. I still don't know how you manually invoked the
script so I can't help.

Normally executables can be configured with a manifest that tells the
operating system that they must be executed elevated. Clearly such a
manifest would apply to powershell.exe itself and not to your script so I
don't know how you got the script to "ask for elevation" manually.

Once you share the details I might be able to help you figure out how to
duplicate the behavior in MSI. The behavior you are seeing with the MSI is
what I would expect under normal circumstances running your script.

Without more information I can only guess that in your manually case you
actually elevated powershell or the command prompt yourself and then ran
the script. Is that what you mean? That the script works properly when
executed in an elevated process?

--
Edwin G. Castro


On Thu, Jun 14, 2018, 20:35 <duggal_sunny at yahoo.com> wrote:

> By manual, I mean out of installer actions. I just wanted to say that
> powershell command I specified in the installer does work fine when ran
> independent of installer.
>
> Thx
> Manish
>
> Sent from my iPhone
>
> On Jun 14, 2018, at 6:39 PM, Edwin Castro <egcastr at gmail.com> wrote:
>
> What do you mean by "I was able to invoke my script manually and it does
> ask for the elevation"? Which precise steps do you take to invoke the
> script manually?
>
> --
> Edwin G. Castro
>
> On Thu, Jun 14, 2018, 17:23 manish duggal via wix-users <
> wix-users at lists.wixtoolset.org> wrote:
>
>> Hi
>> I have a requirement to launch a powershell script after my installer
>> finishes. My requirement is to launch it and ask for elevation if needed. I
>> was able to invoke my script manually and it does ask for the elevation.
>> However, the custom action in installer doesn't somehow launching the
>> script.
>> Here is my custom action detail
>> <Property Id='LaunchAction' Value='TO_BE_OVERRIDDEN' />
>> <SetProperty Id='LaunchAction'                      Value='"powershell.exe"
>> -NoProfile -NonInteractive -InputFormat None -ExecutionPolicy Bypass
>> -Command "& '[INSTALLDIR]Script.ps1' -InstallDir
>> '[INSTALLDIR]';"'                     Before='LaunchAction
>>                Sequence='execute' />        <CustomAction
>> Id='LaunchAction'                      BinaryKey='WixCA'
>>   DllEntry='CAQuietExec64'                      Execute='immediate'
>>               Return='ignore'                      Impersonate='no'/>
>> Why it is not getting invoked correctly after installer finishes? I
>> looked at "WixShellExecTarget" but not sure if this could really be used to
>> run a PowerShell script with parameters.
>> Appreciate help in this regard.
>> ThxManish
>>
>> ____________________________________________________________________
>> WiX Toolset Users Mailing List provided by FireGiant
>> http://www.firegiant.com/
>
>


More information about the wix-users mailing list