commit 01137f3cb8d0cfd0df34c84e0bca787416bb1c07 Author: JonatanRek Date: Wed Feb 5 17:48:44 2025 +0100 Intune Package Builder Initialization diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a671a2c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +v1.8.6/* diff --git a/apps/dotNET/bin/windowsdesktop-runtime-8.0.12-win-x64.exe b/apps/dotNET/bin/windowsdesktop-runtime-8.0.12-win-x64.exe new file mode 100644 index 0000000..3476642 Binary files /dev/null and b/apps/dotNET/bin/windowsdesktop-runtime-8.0.12-win-x64.exe differ diff --git a/apps/dotNET/install.ps1 b/apps/dotNET/install.ps1 new file mode 100644 index 0000000..b4a8454 --- /dev/null +++ b/apps/dotNET/install.ps1 @@ -0,0 +1,24 @@ +# array of uninstall args +$uninstallArgs = "/uninstall"," ","/quiet" +$dotnetVersions = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -like "Microsoft .NET*" } + +foreach ($version in $dotnetVersions) { + # update array index 1 with version id + $uninstallArgs[1] = "$($version.id)" + Write-Host "Uninstalling $($version.Name)..." + Start-Process -FilePath "msiexec.exe" -ArgumentList "$uninstallArgs" -Wait +} + +Write-Host "All Microsoft .NET versions uninstalled." + +$uri = "https://download.visualstudio.microsoft.com/download/pr/f1e7ffc8-c278-4339-b460-517420724524/f36bb75b2e86a52338c4d3a90f8dac9b/windowsdesktop-runtime-8.0.12-win-x64.exe" +$installerName =($uri -split "/")[-1] +$installerPath = ('./bin/' + $installerName) +if (-not (Test-Path -Path $installerPath)){ + Invoke-WebRequest -Uri $uri -OutFile $installerPath +} + +$installArgs = " /install"," /quiet"," /norestart" +Start-Process -FilePath $installerPath -ArgumentList "$installArgs" -Wait + +Write-Host ("Microsoft .NET versions installed: " + $installerName) diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000..df86fc2 --- /dev/null +++ b/build.ps1 @@ -0,0 +1,23 @@ +$version = "v1.8.6" +if (-not (Test-Path -Path $version -PathType Container)) { + Invoke-WebRequest -Uri "https://github.com/microsoft/Microsoft-Win32-Content-Prep-Tool/archive/refs/tags/v1.8.6.zip" -OutFile "v1.8.6.zip" + Expand-Archive -Path "v1.8.6.zip" -Force + Remove-Item -Path "v1.8.6.zip" +} + +foreach ($folder in (Get-ChildItem -Path "./apps/" )) { + write-host $folder.Name + $sourceFolder = $folder.FullName + + $sourceFile = $null + foreach ($wntrypoint in @('install.bat', 'install.ps1', '*.msi')) { + $sourceFile = (Get-ChildItem -Path $sourceFolder -Filter $wntrypoint | Select-Object -First 1 ) + if ($null -ne $sourceFile){ + break + } + } + + $buildArgs = " -c ", $folder.FullName, " -s ", $sourceFile.FullName, " -s ", $folder.FullName, " -q" + Start-Process -FilePath ('./{0}/Microsoft-Win32-Content-Prep-Tool-1.8.6/IntuneWinAppUtil.exe' -f $version) -ArgumentList "$buildArgs" -Wait +} + diff --git a/build/.gitkeep b/build/.gitkeep new file mode 100644 index 0000000..e69de29