[wix-users] Excuting Powershell cmdlets in installers
John Cooper
JoCooper at jackhenry.com
Thu May 19 09:26:19 PDT 2016
If it's just these three cmdlets, you can write a C# custom action to run them directly. Doing this is well documented. Is there any output you want to capture?
Running PowerShell directly is like running VBS--it will get your MSI and product marked as unsafe.
--
John Merryweather Cooper
Senior Software Engineer | Integration Development Group | Enterprise Notification Service
Jack Henry & Associates, Inc.® | Lenexa, KS 66214 | Ext: 431050 |JoCooper at jackhenry.com
-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of John Zajac
Sent: Thursday, May 19, 2016 11:22 AM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: [wix-users] Excuting Powershell cmdlets in installers
The e-mail below is from an external source. Please do not open attachments or click links from an unknown or suspicious origin.
As part of a WiX installer project, I need to do things like:
- create send connectors (New-SendConnector)
- receive connector (New-ReceiveConnector)
- Install transport agents (Install-TransportAgent)
and it appears Microsoft's only (officially documented) way to do this is through powershell - I can't seem to find a more direct .net API way of doing this <http://stackoverflow.com/questions/37217447/is-there-a-managed-api-i-can-use-create-exchange-2010-2013-send-connectors-o>
.
(if anyone does know of a way correct me, I haven't poked around the Exchange assemblies I was hoping for something documented/recommended by
Microsoft)
I've been on the interweb surveying how others have done this. Some of which don't feel right (having the scripts in your installer and shelling out to powershell.exe.., for example). I prefer taking an approach of spinning up a runspace like this PowerShellWixExtension <https://github.com/flcdrg/PowerShellWixExtension>.
*My question is: *are there any plans for the WiX toolset to bring in more formal support for Powershell custom actions, such as an extension?
Or, is running powershell cmdlets in an installer a bad route to take, in general (even if wrapped in DTF custom action)?
____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
NOTICE: This electronic mail message and any files transmitted with it are intended
exclusively for the individual or entity to which it is addressed. The message,
together with any attachment, may contain confidential and/or privileged information.
Any unauthorized review, use, printing, saving, copying, disclosure or distribution
is strictly prohibited. If you have received this message in error, please
immediately advise the sender by reply email and delete all copies.
More information about the wix-users
mailing list