Last active
July 15, 2024 21:07
-
-
Save roozbehid/f30d111cd38656e7f185034083451ede to your computer and use it in GitHub Desktop.
MSBuild, csproj hack to auto generate wxs file for wix for general dependencies like Microsoft dlls and such
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- | |
| I found this way somethimes saves you good chunk of time | |
| --> | |
| <Target Name="Createwxs" AfterTargets="AfterBuild"> | |
| <ItemGroup> | |
| <MicrosoftDlls Include="$(OutputPath)\Microsoft.*.*" /> | |
| <MicrosoftDlls Include="$(OutputPath)\System.*.*" /> | |
| <MicrosoftDlls Include="$(OutputPath)\JWT*.*" /> | |
| <MicrosoftDlls Include="$(OutputPath)\Swashbuckle.*.*" /> | |
| <Line Include="line01"> | |
| <Text><?xml version="1.0" encoding="UTF-8"?></Text> | |
| </Line> | |
| <Line Include="line02"> | |
| <Text><Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> </Text> | |
| </Line> | |
| <Line Include="line03"> | |
| <Text> | |
| <Fragment> | |
| </Text> | |
| </Line> | |
| <Line Include="line04"> | |
| <Text> | |
| <DirectoryRef Id="TARGETDIR"> | |
| </Text> | |
| </Line> | |
| <Line Include="line05"> | |
| <Text> | |
| <Component Id="MyComponent" Guid="{12DE2CE3-DF71-3E8C-8BC0-111111112345}"> | |
| </Text> | |
| </Line> | |
| <Line Include="line06"> | |
| <Text> <File Name="%(MicrosoftDlls.Filename)%(MicrosoftDlls.Extension)" Source="%(MicrosoftDlls.Identity)" /></Text> | |
| </Line> | |
| <Line Include="line07"> | |
| <Text> </Component> </Text> | |
| </Line> | |
| <Line Include="line08"> | |
| <Text> </DirectoryRef> </Text> | |
| </Line> | |
| <Line Include="line09"> | |
| <Text> </Fragment> </Text> | |
| </Line> | |
| <Line Include="line10"> | |
| <Text></Wix></Text> | |
| </Line> | |
| <LineText Include="%(Line.Text)" /> | |
| </ItemGroup> | |
| <WriteLinesToFile File="MyComponent.wxs" Lines="@(LineText)" Overwrite="true" /> | |
| </Target> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment