microsoft / shell-intune-samples

Sample shell scripts for Intune admins.
MIT License
684 stars 222 forks source link

App sample script fails to install pkg when containing X.X.X version in file name #75

Closed sveinungre closed 1 year ago

sveinungre commented 1 year ago

The sample script is able to download the file but fails to install it. If I rename the file - remove the -X.X.X.pkg in the file name, it works just fine. From log file (actual app name replaced with AppName and actual version number replaced with X.X.X):

##############################################################

Mon Nov 7 09:21:35 CET 2022 | Logging install of [AppName] to [/Library/Logs/Microsoft/IntuneScripts/AppName/AppName.log]

############################################################

Mon Nov 7 09:21:35 CET 2022 | Checking if we need Rosetta 2 or not Mon Nov 7 09:21:35 CET 2022 | Waiting for other [/usr/sbin/softwareupdate] processes to end Mon Nov 7 09:21:35 CET 2022 | No instances of [/usr/sbin/softwareupdate] found, safe to proceed Mon Nov 7 09:21:35 CET 2022 | Rosetta is already installed and running. Nothing to do. Mon Nov 7 09:21:35 CET 2022 | Checking if we need to install or update [AppName] Mon Nov 7 09:21:35 CET 2022 | [AppName] not installed, need to download and install Mon Nov 7 09:21:35 CET 2022 | Dock is here, lets carry on Mon Nov 7 09:21:35 CET 2022 | Starting downlading of [AppName] Mon Nov 7 09:21:35 CET 2022 | Waiting for other [curl -f] processes to end Mon Nov 7 09:21:35 CET 2022 | No instances of [curl -f] found, safe to proceed Mon Nov 7 09:21:35 CET 2022 | Downloading AppName [https://somethingsomething.blob.core.windows.net/something/AppName-X.X.X.pkg] Mon Nov 7 09:21:35 CET 2022 | Downloaded [AppName.app] to [/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.AQTprJVD/AppName-X.X.X.pkg] Mon Nov 7 09:21:35 CET 2022 | Detected install type as [PKG] Mon Nov 7 09:21:35 CET 2022 | Waiting for other [/Applications/AppName.app/Contents/MacOS/AppName] processes to end Mon Nov 7 09:21:35 CET 2022 | No instances of [/Applications/AppName.app/Contents/MacOS/AppName] found, safe to proceed Mon Nov 7 09:21:35 CET 2022 | Installing AppName installer: Error - the package path specified was invalid: '/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.AQTprJVD/AppName-X.X.X.pkg'. Mon Nov 7 09:21:35 CET 2022 | Failed to install AppName

theneiljohnson commented 1 year ago

I can't repro this, i even validated with Nudge which has the same structure. What app are you trying to deploy exactly?

sveinungre commented 1 year ago

I later found that this applied to GlobalProtect, I think the pkg name was GlobalProtect-6.1.0.pkg. Once I renamed to GlobalProtect.pkg it worked fine.

theneiljohnson commented 1 year ago

Really odd, I just can't repro this at all. What version of the sample script are you using?

sveinungre commented 1 year ago

I don't remember if it was the latest version of sh script or the zsh. But it seems to only apply to GlobalProtect, I have later used the same script for other PKGs (even with . and - in file name) and it worked.

theneiljohnson commented 1 year ago

Hmm, ok. I'm going to close for now, but if you come across it again, re-open and we can take a better look.