diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 86a4e2d..eca979c 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -38,16 +38,50 @@ jobs:
- name: Install WiX Toolset v4
shell: pwsh
run: |
- dotnet tool install --global wix
- wix extension add WixToolset.UI.wixext --global
+ dotnet tool install --global wix --version "4.0.6"
+ wix extension add "WixToolset.UI.wixext/4.0.6" --global
+
+ - name: Generate WiX file fragment
+ shell: pwsh
+ run: |
+ $stage = "${{ runner.temp }}\stage"
+ $harvestWxs = "${{ runner.temp }}\AppFiles.wxs"
+ $ns = "http://wixtoolset.org/schemas/v4/wxs"
+ $doc = [System.Xml.XmlDocument]::new()
+ $doc.AppendChild($doc.CreateXmlDeclaration("1.0","UTF-8",$null)) | Out-Null
+ $wix = $doc.CreateElement("Wix", $ns); $doc.AppendChild($wix) | Out-Null
+ $frag = $doc.CreateElement("Fragment", $ns); $wix.AppendChild($frag) | Out-Null
+ $cg = $doc.CreateElement("ComponentGroup", $ns)
+ $cg.SetAttribute("Id","AppFiles"); $cg.SetAttribute("Directory","INSTALLFOLDER")
+ $frag.AppendChild($cg) | Out-Null
+ $idx = 0
+ Get-ChildItem -Path $stage -Recurse -File | ForEach-Object {
+ $rel = $_.FullName.Substring($stage.Length + 1)
+ $relDir = [System.IO.Path]::GetDirectoryName($rel)
+ $comp = $doc.CreateElement("Component", $ns)
+ $comp.SetAttribute("Id", "Comp_$idx")
+ $comp.SetAttribute("Guid", ("{$([System.Guid]::NewGuid().ToString().ToUpper())}"))
+ if ($relDir) { $comp.SetAttribute("Subdirectory", $relDir) }
+ $cg.AppendChild($comp) | Out-Null
+ $f = $doc.CreateElement("File", $ns)
+ $f.SetAttribute("Id", "File_$idx")
+ $f.SetAttribute("Source", "`$(var.SourceDir)\$rel")
+ $f.SetAttribute("KeyPath", "yes")
+ $comp.AppendChild($f) | Out-Null
+ $idx++
+ }
+ $doc.Save($harvestWxs)
+ Write-Host "Fragment: $harvestWxs ($idx files)"
- name: Build MSI
shell: pwsh
run: |
- $stage = "${{ runner.temp }}\stage"
+ $stage = "${{ runner.temp }}\stage"
+ $harvestWxs = "${{ runner.temp }}\AppFiles.wxs"
$installerDir = "${{ github.workspace }}\installer"
- $msiName = "IntuneManager-${{ steps.ver.outputs.TAG }}.msi"
- wix build installer\Intune-Manager.wxs `
+ $msiName = "IntuneManager-${{ steps.ver.outputs.TAG }}.msi"
+ wix build installer\Intune-Manager.wxs $harvestWxs `
+ -ext WixToolset.UI.wixext `
-d Version=${{ steps.ver.outputs.VERSION }} `
-d SourceDir=$stage `
-d InstallerDir=$installerDir `
diff --git a/installer/Intune-Manager.wxs b/installer/Intune-Manager.wxs
index 30a4ecd..9b1c919 100644
--- a/installer/Intune-Manager.wxs
+++ b/installer/Intune-Manager.wxs
@@ -21,16 +21,10 @@
-
-
-
-
-
-