I have successfully executed PowerShell scripts as CustomActions in MSI 
packages.

If you MUST use PowerShell, then all of the warnings concerning difficulty in 
debugging apply. You MUST fully understand the context under which the script 
is executing (user context, filesystem and registry redirection, etc). If you 
have alternatives for your CustomAction, then you should use those alternatives.

If you are deploying a native application, then write a native CustomAction.

If you are deploying a .NET application, then write a .NET CustomAction.

If you MUST use PowerShell to perform a task because the API available to you 
is a cmdlet provided by thirdparty *AND* you have no other way to perform the 
same task, then and only then is it appropriate to use a PowerShell script as a 
CustomAction to perform that task.

Don't bother writing .NET code to host the PowerShell engine to avoid using a 
PowerShell script as that is very, very hard to do correctly.

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

> -----Original Message-----
> From: Raghu [mailto:raghu_ti...@yahoo.com]
> Sent: Monday, March 11, 2013 6:05 PM
> To: wix-users@lists.sourceforge.net
> Subject: [WiX-users] Is using Powershell script as a Wix Custom Action a good
> idea?
> 
> Hello Wix users,
> 
> I have a very simple custom action something on the lines of validating a key
> as part of setup, the min requirement that the setup to run is on Win2k8 R2+.
> Now I can achieve the same thing in a dll but I feel its an overkill and is 
> easily
> achieved in a script, for a while I was pondering over using vbscript until I
> read the warning in
> http://blogs.msdn.com/b/robmen/archive/2004/05/20/136530.aspx and
> decided against vbscript. Could folks point out if doing the same in
> powershell is ok?
> Thanks.,
> Raghu
> ------------------------------------------------------------------------------
> 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