Skip to content

Commit

Permalink
✅ Upload v1.3.0
Browse files Browse the repository at this point in the history
* Added automatic download for IntuneWinAppUtil (from GitHub)
* Added Intune direct upload as new feature (only for packages with MSI installer)
* Fixed issue with selecting folder by the clicking on the folder icon
  • Loading branch information
tugich committed May 21, 2023
1 parent 438792a commit d581d05
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 0 deletions.
Binary file added Installer/Setup Packager for Intune.msi
Binary file not shown.
2 changes: 2 additions & 0 deletions Scripts/Intune.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
powershell.exe -NoProfile -NoLogo -ExecutionPolicy ByPass -File "%~dp0Intune.ps1" -Tenant "%~1" -IntuneWinFile "%~2" -DisplayName "%~3"
46 changes: 46 additions & 0 deletions Scripts/Intune.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Parameters
Param(
[Parameter(Mandatory)]
[string]$Tenant,

[Parameter(Mandatory)]
[string]$IntuneWinFile,

[Parameter(Mandatory)]
[string]$DisplayName
)

# Set Execution Policy
Set-ExecutionPolicy ByPass -Scope CurrentUser

# Connect to Intune
# Install-Module -Name "IntuneWin32App"
Connect-MSIntuneGraph -TenantID $Tenant | Out-Null

# Get MSI meta data from .intunewin file
$IntuneWinMetaData = Get-IntuneWin32AppMetaData -FilePath $IntuneWinFile

If ($IntuneWinMetaData.ApplicationInfo.MsiInfo)
{
# Create requirement rule for all platforms and Windows 11
$RequirementRule = New-IntuneWin32AppRequirementRule -Architecture "All" -MinimumSupportedWindowsRelease "W11_22H2"

# Create PowerShell script detection rule
$DetectionRule = New-IntuneWin32AppDetectionRuleMSI -ProductCode $IntuneWinMetaData.ApplicationInfo.MsiInfo.MsiProductCode -ProductVersionOperator "greaterThanOrEqual" -ProductVersion $IntuneWinMetaData.ApplicationInfo.MsiInfo.MsiProductVersion

# Create custom return code
$ReturnCode = New-IntuneWin32AppReturnCode -ReturnCode 1337 -Type "retry"

# Add new EXE Win32 app
$InstallCommandLine = 'msiexec /i "' + $($IntuneWinMetaData.ApplicationInfo.SetupFile) + '" /qn'
$UninstallCommandLine = 'msiexec /x "' + $($IntuneWinMetaData.ApplicationInfo.MsiInfo.MsiProductCode) + '" /qn'

Add-IntuneWin32App -FilePath $IntuneWinFile -DisplayName $DisplayName -Description "Imported with Setup Packager for Intune - by TUGI" -Publisher "SetupPackager" -InstallExperience "system" -RestartBehavior "suppress" -DetectionRule $DetectionRule -RequirementRule $RequirementRule -ReturnCode $ReturnCode -InstallCommandLine $InstallCommandLine -UninstallCommandLine $UninstallCommandLine -Verbose
Exit 0
}
Else
{
CLS
Write-Host "Upload failed: Sorry, MSI only supported."
Exit 1
}
1 change: 1 addition & 0 deletions Scripts/WindowsVersions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
W10_1607,W10_1703,W10_1709,W10_1803,W10_1809,W10_1903,W10_1909,W10_2004,W10_20H2,W10_21H1,W10_21H2,W10_22H2,W11_21H2,W11_22H2
Binary file modified SetupPackager.exe
Binary file not shown.

0 comments on commit d581d05

Please sign in to comment.