How to use AI to replicate this Wixproj Target TaskAction

Need help authoring your installer? Ask the community for tips and advice.
Post Reply
pcservtn
Posts: 4
Joined: Thu Apr 25, 2019 3:57 pm

How to use AI to replicate this Wixproj Target TaskAction

Post by pcservtn » Wed May 15, 2019 10:54 pm

I'm working on replacing a Wix Msi project with an Advanced Installer project.

I've run into a Target in the .wixproj file that looks like this:

<Target Name="CreateSolutionInstallerConfigFile">
<Copy SourceFiles="Configuration\Setup\SPSolutions.SharePoint.SolutionInstaller.exe.config.template" DestinationFiles="Configuration\Setup\SPSolutions.SharePoint.SolutionInstaller.exe.config" />
<MSBuild.ExtensionPack.Xml.XmlFile TaskAction="UpdateAttribute" File="Configuration\Setup\SPSolutions.SharePoint.SolutionInstaller.exe.config" XPath="/configuration/spSolutions.solutionInstaller/deploymentPlans/deploymentPlan[@name='ExCM']/solutions/solution[@id='{5d85f35b-15e7-4625-8eff-b5c64f3abe4d}']" Key="version" Value="$(ProductVersion)" />
<ItemGroup>
<Content Include="Configuration\Setup\SPSolutions.SharePoint.SolutionInstaller.exe.config" />
</ItemGroup>
</Target>

What this is doing, I believe, is making a copy of an XML file and saving it under a new name and then using MSBuild.ExtensionPack to edit an element in the copied file. Then, the copied and edited file gets deployed by the installer, rather than the original file, which is intended to serve as a template for this task.

What feature(s) in AI would I use to accomplish this same thing?

Thanks,
Jeff

Catalin
Posts: 1121
Joined: Wed Jun 13, 2018 7:49 am

Re: How to use AI to replicate this Wixproj Target TaskAction

Post by Catalin » Fri May 17, 2019 4:18 pm

Hello Jeff,

In what regards the copy operation of the XML file, you can have a look on the following articles:

1. File Operations in the Files And Folders Page

2. File Copy/Move Dialog

In what regards the edit operation for the XML file, you can have a look on the following articleS:

3. How to import and edit an XML file

4. Edit XML File Dialog

However, if I am not mistaken, you want the edit operation for the XML file to happen during install time (please correct me if I'm wrong). In this case, the above points (3 and 4) may not apply. However, this can still be achieved through a custom action. For instance, you can use a "Run Inline PowerShell Script" or any other script type custom action (here you can see a full list of our predefined custom actions).

If you want, you can forward me, either here or by e-mail at support at advancedinstaller dot com the content of your XML file and what you want to be replaced in it and I may be able to help you creating and configuring the custom action.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

pcservtn
Posts: 4
Joined: Thu Apr 25, 2019 3:57 pm

Re: How to use AI to replicate this Wixproj Target TaskAction

Post by pcservtn » Thu May 23, 2019 4:12 pm

Thanks, Catailn. I will email you a zip with my XML file and an explanation of what I need to update in it during the deployment process. Then, you can give me your feedback on the best feature for me to use to update it.

Jeff

Post Reply