Skip to content

Commit

Permalink
Merge branch 'main' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronparker authored Sep 22, 2024
2 parents 30c1f01 + b91cf65 commit 1494d81
Show file tree
Hide file tree
Showing 95 changed files with 601 additions and 966 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/powershell-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Run PSScriptAnalyzer
uses: microsoft/psscriptanalyzer-action@6b2948b1944407914a58661c49941824d149734f
with:
path: ./
path: ./scripts
recurse: true
output: results.sarif

Expand Down
2 changes: 1 addition & 1 deletion Install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function Uninstall-Msi {
Write-LogFile -Message "Uninstall-Msi error: $($_.Exception.Message)" -LogLevel 3
Write-Warning -Message $_.Exception.Message
}
}
}
}
}
}
Expand Down
15 changes: 14 additions & 1 deletion PSAppDeployToolkit/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
**Version 3.10.1 [05/03/2024]**
**Version 3.10.2 [08/13/2024]**
- Added support for MARKs in VSCode. #994
- Added Pester Tests for Copy-File, Execute-ProcessAsUser and Set-ActiveSetup
- Fixed an issue with Test-ServiceExists / Get-LoggedOnUser working in a Windows Sandbox. #1031 #1032 #1035
- Fixed an issue with log file rotation and log file permissions when running in user context. #1024 #1029 #1030
- Fixed a number of issues relating to Robocopy in Copy-Files. #868 #1015 #1020 #1021 #1038
- Fixed an issue where the Show-InstallationPrompt dialog would not display when run through MCM / SCCM in interactive mode. #1004 #1016
- Fixed an issue where Execute-ProcessAsUser would throw a terminating error when no user logged on #1027
- Fixed escaping of invalid characters in Block-AppExecution. #1036
- Fixed a number of issues in Set-ActiveSetup / Execute-ProcessAsUser. #1017
- Fixed an issue in French translations. #1019
- Fixed an issue with Get-FileVersion #1007

**Version 3.10.1 [05/03/2024]**
- Added Turkish language support. Fixes #973.
- Added parameter sets to Configure-EdgeExtensions to ensure mandatory parameters are correctly grouped.
- Added missing elements to XML for Finnish language. Fixes #967.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<!--Configuration
File Details-->
<Config_File>
<Config_Version>3.10.1</Config_Version>
<Config_Date>05/03/2024</Config_Date>
<Config_Version>3.10.2</Config_Version>
<Config_Date>08/13/2024</Config_Date>
</Config_File>

<!--Toolkit
Expand Down Expand Up @@ -318,7 +318,7 @@
<DeferPrompt_WarningMessage>Quand le temps aura expiré, vous n'aurez plus la possibilité de reporter.</DeferPrompt_WarningMessage>
<DeferPrompt_RemainingDeferrals>Nombre(s) de report restant(s):</DeferPrompt_RemainingDeferrals>
<DeferPrompt_Deadline>Temps limite:</DeferPrompt_Deadline>
<WelcomePrompt_CountdownMessage>Le {0} va continuer automatiquement:</WelcomePrompt_CountdownMessage>
<WelcomePrompt_CountdownMessage>L'{0} va continuer automatiquement:</WelcomePrompt_CountdownMessage>
<WelcomePrompt_CustomMessage></WelcomePrompt_CustomMessage>


Expand Down
473 changes: 258 additions & 215 deletions PSAppDeployToolkit/Toolkit/AppDeployToolkit/AppDeployToolkitMain.ps1

Large diffs are not rendered by default.

119 changes: 15 additions & 104 deletions PSAppDeployToolkit/Toolkit/AppDeployToolkit/RunHidden.vbs
Original file line number Diff line number Diff line change
@@ -1,111 +1,22 @@
Option Explicit

Function IsCmdAtEnd(commandLine)
Dim regEx, cmdPattern
' Regular expression pattern to match "cmd" or "cmd.exe" at the end of the string
cmdPattern = "(cmd\.exe|cmd)$"

' Create a RegExp object
Set regEx = New RegExp
regEx.Pattern = cmdPattern
regEx.IgnoreCase = True
regEx.Global = False

' Test the pattern against the provided command line
IsCmdAtEnd = regEx.Test(commandLine)
End Function

Function ArgvQuote(Argument, ForceQuote, CmdDetected)
' Used this article as a reference for this function:
' https://learn.microsoft.com/en-us/archive/blogs/twistylittlepassagesallalike/everyone-quotes-command-line-arguments-the-wrong-way

' This routine modifies the given argument to a command line such
' that CommandLineToArgvW will return the argument string unchanged.
' Arguments in a command line should be separated by spaces; this
' function does not add these spaces.

Dim bQuoteNeeded, sEscapedArgument, i, NumberBackslashes, sMetaChars, j

' Define metacharacters
sMetaChars = "()%!^""<>&|"

' Determine if we need to quote the argument
bQuoteNeeded = ForceQuote Or IsEmpty(Argument) Or InStr(Argument, " ") > 0 Or InStr(Argument, vbTab) > 0 _
Or InStr(Argument, Chr(10)) > 0 Or InStr(Argument, Chr(11)) > 0 Or InStr(Argument, """") > 0

If Not bQuoteNeeded Then
' If cmd detected, escape metacharacters
If CmdDetected Then
For i = 1 To Len(Argument)
If InStr(sMetaChars, Mid(Argument, i, 1)) > 0 Then
sEscapedArgument = sEscapedArgument & "^" & Mid(Argument, i, 1)
Else
sEscapedArgument = sEscapedArgument & Mid(Argument, i, 1)
End If
Next
Else
sEscapedArgument = Argument
End If
Else
For i = 1 To Len(Argument)
' Count the number of backslashes
NumberBackslashes = 0
While Mid(Argument, i, 1) = "\"
i = i + 1
NumberBackslashes = NumberBackslashes + 1
Wend

If i > Len(Argument) Then
' Escape all backslashes, but let the terminating double
' quotation mark we add below be interpreted as a metacharacter.
sEscapedArgument = sEscapedArgument & String(NumberBackslashes * 2, "\")
Exit For
ElseIf Mid(Argument, i, 1) = """" Then
' Escape all backslashes and the following double quotation mark
If CmdDetected Then
sEscapedArgument = sEscapedArgument & String(NumberBackslashes * 2 + 1, "\") & "^" & """"
Else
sEscapedArgument = sEscapedArgument & String(NumberBackslashes * 2 + 1, "\") & """"
End If
Else
' Backslashes aren't special here
If CmdDetected And InStr(sMetaChars, Mid(Argument, i, 1)) > 0 Then
' If cmd detected, escape metacharacters
sEscapedArgument = sEscapedArgument & String(NumberBackslashes, "\") & "^" & Mid(Argument, i, 1)
Else
sEscapedArgument = sEscapedArgument & String(NumberBackslashes, "\") & Mid(Argument, i, 1)
End If
End If
Next

If CmdDetected Then
sEscapedArgument = "^" & """" & sEscapedArgument & "^" & """"
Else
sEscapedArgument = """" & sEscapedArgument & """"
End If
End If
If WScript.Arguments.Count < 1 Then
WScript.Quit
End If

ArgvQuote = sEscapedArgument
End Function
Dim sArg, sCmd, oWShell, iReturn
sCmd = ""

Dim sCmd, oWShell, iReturn, sArg, bCmdDetected, oArgumentList(), iCount
For Each sArg In WScript.Arguments
'Replace the [{quote}] placeholder with a double quote
sArg = Replace(sArg, "[{quote}]", """")
sCmd = sCmd & sArg & " "
Next
'Trim the trailing space
sCmd = Left(sCmd, Len(sCmd) - 1)

iReturn = 0
If WScript.Arguments.Count > 0 Then
' Check if first argument references cmd or cmd.exe
bCmdDetected = IsCmdAtEnd(WScript.Arguments(0))

ReDim oArgumentList(WScript.Arguments.Count - 1)
iCount = 0
For Each sArg In WScript.Arguments
oArgumentList(iCount) = ArgvQuote(sArg, False, bCmdDetected)
iCount = iCount + 1
Next

sCmd = Join(oArgumentList, " ")

Set oWShell = CreateObject("WScript.Shell")
iReturn = oWShell.Run(sCmd, 0, True)
End If

Set oWShell = CreateObject("WScript.Shell")
iReturn = oWShell.Run(sCmd, 0, True)
Set oWShell = Nothing
WScript.Quit iReturn
29 changes: 13 additions & 16 deletions PSAppDeployToolkit/Toolkit/Deploy-Application.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Try {
}

##*===============================================
##* VARIABLE DECLARATION
#region VARIABLE DECLARATION
##*===============================================
## Variables: Application
[String]$appVendor = ''
Expand All @@ -128,8 +128,8 @@ Try {

## Variables: Script
[String]$deployAppScriptFriendlyName = 'Deploy Application'
[Version]$deployAppScriptVersion = [Version]'3.10.1'
[String]$deployAppScriptDate = '05/03/2024'
[Version]$deployAppScriptVersion = [Version]'3.10.2'
[String]$deployAppScriptDate = '08/13/2024'
[Hashtable]$deployAppScriptParameters = $PsBoundParameters

## Variables: Environment
Expand Down Expand Up @@ -171,12 +171,12 @@ Try {
#endregion
##* Do not modify section above
##*===============================================
##* END VARIABLE DECLARATION
#endregion END VARIABLE DECLARATION
##*===============================================

If ($deploymentType -ine 'Uninstall' -and $deploymentType -ine 'Repair') {
##*===============================================
##* PRE-INSTALLATION
##* MARK: PRE-INSTALLATION
##*===============================================
[String]$installPhase = 'Pre-Installation'

Expand All @@ -190,7 +190,7 @@ Try {


##*===============================================
##* INSTALLATION
##* MARK: INSTALLATION
##*===============================================
[String]$installPhase = 'Installation'

Expand All @@ -208,7 +208,7 @@ Try {


##*===============================================
##* POST-INSTALLATION
##* MARK: POST-INSTALLATION
##*===============================================
[String]$installPhase = 'Post-Installation'

Expand All @@ -221,7 +221,7 @@ Try {
}
ElseIf ($deploymentType -ieq 'Uninstall') {
##*===============================================
##* PRE-UNINSTALLATION
##* MARK: PRE-UNINSTALLATION
##*===============================================
[String]$installPhase = 'Pre-Uninstallation'

Expand All @@ -235,7 +235,7 @@ Try {


##*===============================================
##* UNINSTALLATION
##* MARK: UNINSTALLATION
##*===============================================
[String]$installPhase = 'Uninstallation'

Expand All @@ -251,7 +251,7 @@ Try {


##*===============================================
##* POST-UNINSTALLATION
##* MARK: POST-UNINSTALLATION
##*===============================================
[String]$installPhase = 'Post-Uninstallation'

Expand All @@ -261,7 +261,7 @@ Try {
}
ElseIf ($deploymentType -ieq 'Repair') {
##*===============================================
##* PRE-REPAIR
##* MARK: PRE-REPAIR
##*===============================================
[String]$installPhase = 'Pre-Repair'

Expand All @@ -274,7 +274,7 @@ Try {
## <Perform Pre-Repair tasks here>

##*===============================================
##* REPAIR
##* MARK: REPAIR
##*===============================================
[String]$installPhase = 'Repair'

Expand All @@ -288,17 +288,14 @@ Try {
## <Perform Repair tasks here>

##*===============================================
##* POST-REPAIR
##* MARK: POST-REPAIR
##*===============================================
[String]$installPhase = 'Post-Repair'

## <Perform Post-Repair tasks here>


}
##*===============================================
##* END SCRIPT BODY
##*===============================================

## Call the Exit-Script function to perform final cleanup operations
Exit-Script -ExitCode $mainExitCode
Expand Down
2 changes: 1 addition & 1 deletion docs/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Here's an example `App.json` for Adobe Acrobat Reader DC:
"UninstallCommand": "msiexec.exe /X \"{AC76BA86-1033-1033-7760-BC15014EA700}\" /quiet",
"InstallExperience": "system",
"DeviceRestartBehavior": "suppress",
"AllowAvailableUninstall": "false"
"AllowAvailableUninstall": false
},
"RequirementRule": {
"MinimumRequiredOperatingSystem": "W10_1809",
Expand Down
2 changes: 1 addition & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The use of `Install.ps1` is defined in `Program.InstallCommand` section in the `
"UninstallCommand": "msiexec.exe /X \"{AC76BA86-1033-1033-7760-BC15014EA700}\" /quiet",
"InstallExperience": "system",
"DeviceRestartBehavior": "suppress",
"AllowAvailableUninstall": "false"
"AllowAvailableUninstall": false
},
```

Expand Down
2 changes: 1 addition & 1 deletion docs/intunewin32.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ This block contains the desired program information of a Win32 app. InstallComma
"UninstallCommand": "<-- Only required when SetupType is set as EXE -->",
"InstallExperience": "system \\ user",
"DeviceRestartBehavior": "suppress \\ force \\ basedOnReturnCode \\ allow",
"AllowAvailableUninstall": "false \\ true"
"AllowAvailableUninstall": false \\ true
}
```

Expand Down
10 changes: 5 additions & 5 deletions packages/App/AdobeAcrobatReaderDC/App.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
},
"PackageInformation": {
"SetupType": "EXE",
"SetupFile": "AcroRdrDCx642400220759_MUI.exe",
"Version": "24.002.20759",
"SetupFile": "AcroRdrDCx642400320112_MUI.exe",
"Version": "24.003.20112",
"SourceFolder": "Source",
"OutputFolder": "Package",
"IconFile": "https://github.com/aaronparker/icons/raw/main/companyportal/Adobe-AcrobatReader.png"
},
"Information": {
"DisplayName": "Adobe Acrobat Reader DC 24.002.20759 x64",
"DisplayName": "Adobe Acrobat Reader DC 24.003.20112 x64",
"Description": "Adobe Acrobat Reader is the free, trusted global standard for viewing, printing, e-signing, sharing, and annotating PDFs. View PDFs, Leave comments or annotate PDFs, Fill, e-sign, and lock your forms, Collaborate better with PDFs.",
"Publisher": "Adobe",
"InformationURL": "https://www.adobe.com/acrobat/pdf-reader.html",
Expand All @@ -30,7 +30,7 @@
"UninstallCommand": "Deploy-Application.exe -DeploymentType \"Uninstall\" -DeployMode \"Silent\"",
"InstallExperience": "system",
"DeviceRestartBehavior": "suppress",
"AllowAvailableUninstall": "false"
"AllowAvailableUninstall": false
},
"RequirementRule": {
"MinimumRequiredOperatingSystem": "W10_1809",
Expand All @@ -44,7 +44,7 @@
"Path": "C:\\Program Files\\Adobe\\Acrobat DC\\Acrobat",
"FileOrFolder": "Acrobat.exe",
"Operator": "greaterThanOrEqual",
"VersionValue": "24.002.20759",
"VersionValue": "24.003.20112",
"Check32BitOn64System": "false"
}
],
Expand Down
10 changes: 5 additions & 5 deletions packages/App/AdobeAcrobatReaderDCMUI/App.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
},
"PackageInformation": {
"SetupType": "EXE",
"SetupFile": "AcroRdrDCx642400220759_MUI.exe",
"Version": "24.002.20759",
"SetupFile": "AcroRdrDCx642400320112_MUI.exe",
"Version": "24.003.20112",
"SourceFolder": "Source",
"OutputFolder": "Package",
"IconFile": "https://github.com/aaronparker/icons/raw/main/companyportal/Adobe-AcrobatReader.png"
},
"Information": {
"DisplayName": "Adobe Acrobat Reader DC 24.002.20759 x64",
"DisplayName": "Adobe Acrobat Reader DC 24.003.20112 x64",
"Description": "Adobe Acrobat Reader is the free, trusted global standard for viewing, printing, e-signing, sharing, and annotating PDFs. View PDFs, Leave comments or annotate PDFs, Fill, e-sign, and lock your forms, Collaborate better with PDFs.",
"Publisher": "Adobe",
"InformationURL": "https://www.adobe.com/acrobat/pdf-reader.html",
Expand All @@ -30,7 +30,7 @@
"UninstallCommand": "msiexec.exe /X \"{AC76BA86-1033-FF00-7760-BC15014EA700}\" /quiet",
"InstallExperience": "system",
"DeviceRestartBehavior": "basedOnReturnCode",
"AllowAvailableUninstall": "false"
"AllowAvailableUninstall": false
},
"RequirementRule": {
"MinimumRequiredOperatingSystem": "W10_1809",
Expand All @@ -44,7 +44,7 @@
"Path": "C:\\Program Files\\Adobe\\Acrobat DC\\Acrobat",
"FileOrFolder": "Acrobat.exe",
"Operator": "greaterThanOrEqual",
"VersionValue": "24.002.20759",
"VersionValue": "24.003.20112",
"Check32BitOn64System": "false"
}
],
Expand Down
Loading

0 comments on commit 1494d81

Please sign in to comment.